
18 Dec
2013
18 Dec
'13
9:06 a.m.
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 http://www.haskell.org/pipermail/generics/2008-July/000349.html The fake described in haskellwiki/SYB#fmap with unsafeCoerce is not needed at all. There is a genuine gmap.