map and fmap

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Mon Aug 14 18:37:50 EDT 2006


On Mon, 2006-08-14 at 20:55 +0100, Jon Fairbairn wrote:
> On 2006-08-14 at 12:00PDT "Iavor Diatchki" wrote:
> > Hello,
> > I never liked the decision to rename 'map' to 'fmap', because it
> > introduces two different names for the same thing (and I find the name
> > `fmap' awkward).
> 
> I strongly concur. There are far too many maps even without
> that, and having two names for the same thing adds to the
> confusion.

If it goes in that direction it'd be nice to consider the issue of
structures which cannot support a polymorphic map. Of course such
specialised containers (eg unboxed arrays or strings) are not functors
but they are still useful containers with a sensible notion of map.

The proposals to allow this involve MPTCs where the element type is a
parameter. That allows instances which are polymorphic in the element
type or instances which constrain it.

Duncan



More information about the Haskell-prime mailing list