|
|
|
|
|
This is a proposal that doesn't affect anything except the presentation of the report, because all Haskell implementations currently do it this way anyway. There are some legal Haskell programs, according to the report, that aren't accepted by current implementations (see below). I propose we make the language specification match the implementations.
|
|
|
|
|
|
|
|
|
## The Problem
|
|
|
|
|
|
|
|
|
|
|
|
The Haskell 98 context-free syntax includes fixity resolution as part of the grammar, with a fixed number of fixities (\[1..9\]), essentially using macro expansion to define the grammar. Apart from being really ugly, and not corresponding to any known implementation (long ago GHC used a yacc parser formulated like this, but not any more), this gives rise to some constructions that are very hard to parse correctly. For example, the expression:
|
|
|
|
|
|
|
... | ... | @@ -27,7 +34,10 @@ This is legal syntax, and parses as `do { a == b } == c`, again because `==` is |
|
|
|
|
|
|
|
|
|
|
|
As far as I know, no Haskell compiler gets this right.
|
|
|
As far as I know, no Haskell compiler gets this right.
|
|
|
|
|
|
|
|
|
## The Solution
|
|
|
|
|
|
|
|
|
|
... | ... | |