Generalizing map?

Nikita Volkov nikita.y.volkov at gmail.com
Fri Mar 13 10:00:34 UTC 2015


I don't know any function that is used more frequently. The only argument
for the existence of the specialised `map` that I've heard is that it's
supposed to make the type signatures simpler for the newbies. I find this
argument outright wrong. The simplicity of the Prelude ship has sailed long
ago. With the already scheduled changes it's gonna sail twice as far. Also
I find the sole premise of trying to look simple to the newbies a waste of
effort and consistency of API.

2015-03-13 12:40 GMT+03:00 Erik Hesselink <hesselink at gmail.com>:

> Why is this change so important when fmap is already in the prelude?
>
> Erik
>
> On Fri, Mar 13, 2015 at 10:35 AM, Nikita Volkov
> <nikita.y.volkov at gmail.com> wrote:
> > I can't +1 this enough to express how much I desire that change!
> >
> > 2015-03-13 12:32 GMT+03:00 Fumiaki Kinoshita <fumiexcel at gmail.com>:
> >>
> >> A dozen of functions like concat, foldr, mapM, have been generalized
> >> through BBP.
> >>
> >> Then, why do we leave `map` just for lists? Obviously `map` can be
> >> generalized, so
> >>
> >> map :: Functor f => (a -> b) -> f a -> f b
> >> map = fmap
> >>
> >> The current definition of `map` looks too special to be a special case
> of
> >> mapM (map f = runIdentity . mapM (Identity . f)).
> >>
> >> _______________________________________________
> >> Libraries mailing list
> >> Libraries at haskell.org
> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >>
> >
> >
> > _______________________________________________
> > Libraries mailing list
> > Libraries at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150313/2f941a9e/attachment.html>


More information about the Libraries mailing list