|
|
|
# Proposal: \<name\>
|
|
|
|
|
|
|
|
**Ticket:** [\#30](https://gitlab.haskell.org//haskell/prime/issues/30)
|
|
|
|
|
|
|
|
<table><tr><th> Type </th>
|
|
|
|
<th> change
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> Status </th>
|
|
|
|
<th> discussion
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> Owner </th>
|
|
|
|
<th> Simon Marlow
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> Section </th>
|
|
|
|
<th> Syntax Reference
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> Dependencies </th>
|
|
|
|
<th>
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> Related </th>
|
|
|
|
<th> [NegativeSyntax](negative-syntax)
|
|
|
|
</th></tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
## Compiler support
|
|
|
|
|
|
|
|
|
|
|
|
<table><tr><th> GHC </th>
|
|
|
|
<th> full (no flag)
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> nhc98 </th>
|
|
|
|
<th> full (no flag)
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> Hugs </th>
|
|
|
|
<th> full (no flag)
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> UHC </th>
|
|
|
|
<th> full (no flag)
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> JHC </th>
|
|
|
|
<th> full (no flag)
|
|
|
|
</th></tr>
|
|
|
|
<tr><th> LHC </th>
|
|
|
|
<th> full (no flag)
|
|
|
|
</th></tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
## Summary
|
|
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Problem
|
|
|
|
|
|
|
|
|
|
|
|
|
| ... | ... | @@ -41,7 +89,7 @@ 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.
|
|
|
|
|
|
|
|
|
|
|
|
## The Solution
|
|
|
|
### The Solution
|
|
|
|
|
|
|
|
|
|
|
|
|
| ... | ... | @@ -60,3 +108,12 @@ This would also let us expand the current paultry set of 9 fixity levels to an a |
|
|
|
Sample code for resolving fixities is here: [resolve.hs](/attachment/wiki/FixityResolution/resolve.hs)[](/raw-attachment/wiki/FixityResolution/resolve.hs). I believe this implements Haskell 98 fixity resolution, without prefix negation (prefix negation could be added, but we might not need to; see [NegativeSyntax](negative-syntax)). The core of the parser is 12 lines of code, with a few lines of datatype declarations and pretty-printing. Note that there is no upper limit on precedence levels, but there is a lower limit of zero. This code could serve as the basis for specifying fixity resolution in the Haskell' report.
|
|
|
|
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
|
|
|
|
- **Ticket:** [\#30](https://gitlab.haskell.org//haskell/prime/issues/30)
|
|
|
|
- [resolve.hs](/attachment/wiki/FixityResolution/resolve.hs)[](/raw-attachment/wiki/FixityResolution/resolve.hs)
|
|
|
|
|
|
|
|
## Report Delta
|
|
|
|
|
|
|
|
|