[Hs-Generics] compositional gMap in SYB1
Johan Jeuring
johanj at cs.uu.nl
Tue Jul 29 04:01:00 EDT 2008
> I have done so. I have committed a new version of
> /comparison/SYB1_2/GMap.lhs
> with gmap2 of the type
Interesting.
>> gmap2 :: forall a b c . (Data a, Data b,
>> Data (c a), Data (c b), Data (c X)) =>
>> (a -> b) -> c a -> c b
>
> The compositionality tests seem to pass. There are no unsafe
> operations or any unsafe extensions. Only standard Data.Typeable and
> Generics.Data operations are being used. The code also contains an
> optimization: if it is determined that a structured value has no
> components to map, no traversal is performed and the value is returned
> as it is. That should speed things up a little. The trick is producing
> something out of nothing.
>
> Too bad that the deadline to amend a Haskell workshop paper
> has passed, and so has the deadline for the generics workshop. Perhaps
> we should write a separate paper?
We're thinking about extending the Haskel Symposium paper to a journal
version, in which we would also take efficiency into account (i.e., also
try to set up something like a benchmark for generic programming).
Would something like that be suitable you think?
-- Johan
More information about the Generics
mailing list