[Haskell-cafe] ScopedTypeVariables in let-bindings (not where-bindings!) and bug 4347
p.giarrusso at gmail.com
Sat May 21 17:32:52 CEST 2011
On Sat, May 21, 2011 at 17:13, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Sat, May 21, 2011 at 10:49, Paolo Giarrusso <p.giarrusso at gmail.com>
>> On Sat, May 21, 2011 at 16:27, Brandon Allbery <allbery.b at gmail.com>
>> > On Sat, May 21, 2011 at 10:17, Paolo G. Giarrusso
>> > <p.giarrusso at gmail.com>
>> > wrote:
>> >> First, thanks to you and everybody for the alternative. But I'm still
>> >> convinced that the syntax is supposed to work, and you're just
>> >> workarounding the bug.
>> > Hm, I think we have differing expectations; the syntax everyone
>> > presented is
>> > the one that is normally used for such things in ghci, and while perhaps
>> > the
>> > one you tried is supposed to work, it's a bit unusual and therefore
>> > probably
>> > not very well tested.
>> Yes, it was my guess as well - and for some reason I missed the usual
>> A sincere question about the usual syntax: where do you learn it? It's
> It's just the desugaring of layout, with the braces being optional because
> it's all on one line. Since you can't use layout in ghci, you have to
> manually convert.
> It is perhaps not entirely obvious (I was a bit surprised
> when, as a complete Haskell newbie, I decided to try it and it worked) that
> you can specify types in both let and where clauses in the same way you do
> at the top level:
Exactly. I've seen examples with where, but only today I've seen this
example with let. Luckily I was aware of layout desugaring - that's
explained in most tutorials I know.
>> let a :: a -> a
>> a = a a
I hope some more advanced tutorial, some day, will also show such examples.
Paolo Giarrusso - Ph.D. Student
More information about the Haskell-Cafe