* Brandon S. Allbery KF8NH <allb...@ece.cmu.edu> [2009-07-11 17:01:35-0400]
> 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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to