
11 Jul
2009
11 Jul
'09
5:54 p.m.
* Brandon S. Allbery KF8NH
On Jul 11, 2009, at 14:31 , Jeremy Yallop wrote:
Why does compiling the following program give an error?
{-# LANGUAGE TypeFamilies, RankNTypes #-}
type family TF a
identity :: (forall a. TF a) -> (forall a. TF a) identity x = x
The scope of each a is the surrounding parentheses, so the de facto type is TF a -> TF b. Or, put otherwise, you're saying that for *any* type (TF a)
No, for any (forall a. TF a), which should make the difference.
you can produce *any* type (TF a) (because of the delimited forall-s), but then the code asserts that they are the same type.
-- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain