[Haskell-cafe] Type families and polymorphism

Jeremy Yallop jeremy.yallop at ed.ac.uk
Sat Jul 11 14:31:28 EDT 2009

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

GHC 6.10.3 gives me:

     Couldn't match expected type `TF a1' against inferred type `TF a'
     In the expression: x
     In the definition of `identity': identity x = x

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

More information about the Haskell-Cafe mailing list