[Haskell-cafe] type inference question

Martijn van Steenbergen martijn at van.steenbergen.nl
Thu Oct 8 05:18:14 EDT 2009


minh thu wrote:
> Also, I'd like to know why
> 
> id id True
> 
> is permitted but not
> 
> (\f -> f f True) id

Because this requires rank-2 types:

> Prelude> :set -XScopedTypeVariables
> Prelude> :set -XRank2Types
> Prelude> (\(f :: forall a. a -> a) -> f f True) id
> True

HTH,

Martijn.



More information about the Haskell-Cafe mailing list