Overloadable list type notation

Greg Weber greg at gregweber.info
Tue Feb 17 04:30:33 UTC 2015

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.

Adding such a thing to the language is probably not a good idea, but
someone might possibly like such a notation for pedagogy. Of course, it
will be pointed out that a Functor is not just a container. But Foldable is
sometimes expressed as "anything that toList can be called on", so it
should make sense there.

Greg Weber
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150216/2210f28c/attachment.html>

More information about the Libraries mailing list