
15 Sep
2010
15 Sep
'10
4:30 a.m.
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] 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