[Haskell-cafe] Re: type families and type signatures

Tom Schrijvers Tom.Schrijvers at cs.kuleuven.be
Wed Apr 9 05:04:57 EDT 2008

> However, I have this feeling that
>  bar :: forall a . Id a -> String
> with a type family  Id  *is* parametric in the sense that no matter what  a 
> is, the result always has to be the same. Intuitively, that's because we may 
> not "pattern match on the branch" of a definition like
>  type instance Id String = ..
>  type instance Id Int    = ..
>  ..

But in a degenerate case there could be just this one instance:

 	type instance Id x = GADT x

which then reduces this example to the GADT case of which you said that is 
was "clearly parametric".

Tom Schrijvers

Department of Computer Science
K.U. Leuven
Celestijnenlaan 200A
B-3001 Heverlee

tel: +32 16 327544
e-mail: tom.schrijvers at cs.kuleuven.be
url: http://www.cs.kuleuven.be/~toms/

More information about the Haskell-Cafe mailing list