[Haskell-cafe] ScopedTypeVariables in let-bindings (not where-bindings!) and bug 4347

Daniel Fischer daniel.is.fischer at googlemail.com
Sat May 21 15:17:25 CEST 2011


On Saturday 21 May 2011 14:55:54, Paolo G. Giarrusso wrote:
> However, it turns out that
> Prelude> let id2 :: Int -> Int = \x -> x
> works but there's no way whatsoever to make the following work:
> Prelude> let (id2 :: forall t. t -> t) = \x -> x

Works without problems or extensions in the form

Prelude> let id2 :: t -> t; id2 = \x -> x
Prelude> :t id2
id2 :: t -> t

Also

Prelude> let a :: t -> t; a = a a
Prelude> :i a
a :: t -> t     -- Defined at <interactive>:1:18

(of course, using a loops).



More information about the Haskell-Cafe mailing list