[Haskell-cafe] SYB supports genuine gmap. [Was: Polymorphic updating with TC/TFs?]

oleg at okmij.org oleg at okmij.org
Wed Dec 18 09:06:20 UTC 2013

adam vogt wrote
> Changing type parameters isn't supported by the ones I know (syb), but
> you can still fake it: <http://www.haskell.org/haskellwiki/SYB#fmap>.

SYB supports the type-changing generic map, of the signature
> gmap2 :: forall a b c . (Data a, Data b,
>                          Data (c a), Data (c b), Data (c X)) =>
>          (a -> b) -> c a -> c b

It was discovered back in 2008. Please see the following thread starting 


The fake described in haskellwiki/SYB#fmap with unsafeCoerce is not
needed at all. There is a genuine gmap.

More information about the Haskell-Cafe mailing list