
28 Sep
2021
28 Sep
'21
6 a.m.
From the department of improbable syntax/I don't get how this works, but it does:
f :: [a] -> [a] ;; f xs = xs ++ reverse xs
Nicely (to my eye) groups/indents the binding under the signature. Especially handy with ScopedTypeVariables, to show how the scoped vars 'belong'
f :: forall a. [a] -> [a] ;; f xs = xs ++ ys where ys :: [a] ys = reverse xs
The doubled `;;` stands out like a ditto. It could be a single semicolon (which means there's an empty decl/binding between the semis -- I don't see that's allowed by the syntax). Unfortunately, for multi-line bindings you need to repeat the `;;`
f :: [a] -> [a] ;; f [] = [] ;; f xs = xs ++ reverse xs