... | ... | @@ -190,4 +190,7 @@ Example: |
|
|
headOf :: (ListLike l) => l a -> Maybe a
|
|
|
headOf Nil = Nothing
|
|
|
headOf (Cons x _) = Just x
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
```
|
|
|
|
|
|
|
|
|
One could go one step further and leave out the `pattern` keyword to obtain *associated constructors*, which are required to be bidirectional. The capitalized constructor would indicate that a pattern synonym is being defined. For complicated cases one could resort to the `where` syntax (shown above). |