On Tue, Feb 17, 2015 at 1:14 PM, Alexander Berntsen <alexander@plaimi.net> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 17/02/15 05:30, Greg Weber wrote:
> I had an idea whose goal is to ease people into Foldable,
> Traversable, etc. There could be a notation that shows the
> generalization that is occurring.
>
> map :: Functor [_] => (a -> b) -> [a] -> [b]
>
> This means that the syntax for the list type is now syntax for the
> variable created by the Functor constraint.
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

 
The existing IsList machinery gets you the [], [x], and [x,y] cases, but not (x:xs).

-Edward