[Haskell-cafe] Re: Aren't type system extensions fun? [Further insight]

Isaac Dupree isaacdupree at charter.net
Wed May 28 16:31:37 EDT 2008


Andrew Coppin wrote:
> Finally, that seems to make actual sense. I have one final question though:
> 
>  forall x, y. x -> y -> Z
>  forall x. x -> (forall y. y -> Z)
> 
> Are these two types the same or different? [Ignoring for a moment the 
> obvious fact that you'll have one hell of a job writing a total function 
> with such a type!]

they're the same type: foralls in function *results* can be moved to the 
outside with no change in meaning.  They don't make it a higher rank 
type. (though some definitions in typically-uncurried languages like to 
call it higher rank, that's not relevant to us).  (modulo GHC issues 
with impredicative polymorphism, which ideally shouldn't even come into 
the picture here, because you're only using/exploring RankNTypes)

-Isaac


More information about the Haskell-Cafe mailing list