Overloadable list type notation

Gabriel Gonzalez gabriel439 at gmail.com
Tue Feb 17 18:21:06 UTC 2015


On 2/17/15 10:14 AM, Alexander Berntsen wrote:
> I don't know how useful this is by itself.
>
> What I *really* want is list-style syntax sugar for pattern matching. I.e.
>
>    f = \xs  -> case xs of
>      []     -> foo
>      [x]    -> bar x
>      [x:y]  -> fu  x y
>      (x:xs) -> baz x xs
>
>

You can already use list-style syntax sugar for pattern matching. The 
only thing you'd have to change in your example is to replace `[x:y]` 
with `[x, y]`.


More information about the Libraries mailing list