map :: Functor [] => (a -> b) -> [a] -> [b]

already has existing, different, semantics today to what Greg is proposing here.

It is asking for an instance of Functor for [] to be supplied. 

Since that instance exists an is scope, the constraint is trivially satisfied, so this collapses to

map :: (a -> b) -> [a] -> [b]

the signature we already have, with the semantics we already have.

-Edward

On Tue, Feb 17, 2015 at 3:38 AM, Henning Thielemann <lemming@henning-thielemann.de> wrote:


On Mon, 16 Feb 2015, 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.

Btw. there is already a prefix name for the list type constructor, namely '[]'. Thus I think your example would be:

map :: Functor [] => (a -> b) -> [a] -> [b]
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries