
3 Jan
2014
3 Jan
'14
12:21 a.m.
For the record, I have described the implementation of generic map (which is fmap implemented generically, once and for all). http://okmij.org/ftp/Haskell/generics.html#gmap The article stresses a drawback of a fake gmap in terms of gfoldl: a fake gmap is non-parametric. It fails the law gmap f . gmap g == gmap (f.g). OTH, the genuine gmap satisfies the law, as behooves to the generic version of fmap. Although gmap is implemented in terms of the parametricity-breaking type-introspecting SYB, the gmap is parametric nevertheless.