Adding (??) into Data.Functor

Nikita Volkov nikita.y.volkov at gmail.com
Sun Feb 16 20:42:23 UTC 2014


I too find such a function useful and deserving a place in the "base",
however I don't think that it's a good idea to make it an operator,
especially such a misleading one. I bet that I'm hardly alone in perception
of question marks as of indicator of a questionable data (e.g., Maybe), but
in no way of lists or functions. Therefore I suggest to instead consider
some verbal name for it. E.g., "mapApp" or "mapf" (as an opposite to
"fmap").

Also, since the variable input of this combinator seems to be on the
functor side I suggest to inverse the arguments order order, i.e.:

    mapf :: a -> f (a -> b) -> f b

This way it'll target composition. And since it's a combinator over
functions it's a pretty important thing. E.g.:

    mapf 2 . map (*) $ [1..10]

So, +1 for the combinator, -1 for the proposed name and arguments order .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140217/90181849/attachment.html>


More information about the Libraries mailing list