
Hi Jan,
On Wed, Sep 15, 2010 at 10:30, Jan Christiansen
Hi,
I want to define a function which is generic for all unary type constructors using the regular package. More precisely, I want to define a function like the following, which replaces every polymorphic component by the position of the component in the generic representation.
shape :: (Regular f, Shape (PF f)) => f a -> f [Bool]
I'm not sure I fully understand what you're trying to do. Could you provide typical use cases of your function, to several arguments of different types? Cheers, Pedro
Is it correct that it is not possible to implement a function like this using regular? Or do I miss something?
I have implemented the function by using different representation types K, I and so forth that take an additional argument. Furthermore I have added an additional type to mark the polymorphic component.
Thanks, Jan _______________________________________________ Generics mailing list Generics@haskell.org http://www.haskell.org/mailman/listinfo/generics