
11 Jul
2009
11 Jul
'09
5:01 p.m.
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) you can produce *any* type (TF a) (because of the delimited forall-s), but then the code asserts that they are the same type. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH