map* for Data.List

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Sun Nov 5 05:25:04 EST 2006


"J. Garrett Morris" <trevion at gmail.com> writes:

> On 11/4/06, Neil Mitchell <ndmitchell at gmail.com> wrote:
> > mapSnd is map and snd
> 
> Actually, mapSnd is ($) and snd, which is why I always preferred the
> names from Control.Arrow (first and second) -- they don't include a
> reference to a fictional mapping operation.

Well, you could call it fmapSnd if you preferred, using fmap at the
identity instance of Functor.  The concept of map (fmap) is more general
than just lists!  It is about type conversion (a->b) embedded through
all relevant locations in a data structure.

Regards,
    Malcolm


More information about the Libraries mailing list