Re: SYB supports genuine gmap

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: SYB supports genuine gmap

oleg-30

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.



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe