Benjamin Franksen wrote:
This is extremely cool. The type of unwrap is indeed general enough. Unfortunately, it doesn't help, because the result type of wrap
Wrap (forall a. a -> a)
still isn't accepted in an instance declaration. Neither is the pair
(unwrap, Wrap (forall a. a -> a))
Or maybe I have not quite understood what you proposed to do with these definitions.
No, you're right, cool but useless! I think I lost sight of the problem... we want to wrap higher order types like: (forall a . a -> a) "Wrap a" makes the higher order type a parameter - which is still not "wrapped"... Template-haskell would need to generate a new unique type: newtype ForallAzdAzaA = ForallAzdAzaA { forallAzdAzaA : forall a . a -> a } Then all occurances of the plain type (forall a . a -> a) would need replacing with ForallAzdAzaA. The tricky bit would be determining where in the code to put the wrap and unwrap bits. But the point is moot anyway. Without first class labels you still need to write the newtype declaration... Keean.