Chimeric syntax

Scott Michel at
Tue Apr 28 22:33:45 EDT 2009

On Tue, Apr 28, 2009 at 1:09 PM, Max Bolingbroke
<batterseapower at> wrote:
> 2009/4/28 Scott Michel < at>:
>> This got me to thinking that either ghc has issues or I have some
>> fundamental misunderstanding of Haskell syntax. Or, maybe I should use
>> someone else's grammar.
> GHC's parser is over-generous by design. See
> A
> precise description of what is valid Haskell it is certainly NOT, but
> it will certainly accept any valid Haskell program. This may not be
> quite what you want for an IDE - but it might be good enough for a
> first cut.

Actually, given what ghc will accept, I seriously doubt that the LR
grammar can ever successfully translate to a LL(*) grammar. Liberal,
it may be, but it probably should be valid. I just followed the
current parser rules to their ultimate conclusion. I suspect that
people would be quite surprised by what Parser.y.pp will actually

Basically, my understanding is that a 'let' should not be allowed in a
'class' declaration and yet, ghc is quite happy to allow it. So my
understanding is correct, but ghc grammar is (perhaps) too flexible.


PS: Anyone got a multicore Haskell experience they want to share at
Supercomputing this year? The guys from Galois did a great job
shocking the audience last year.

More information about the Glasgow-haskell-users mailing list