Repository navigation
Rewrite pattern section to introduce failable and failure-free patterns. - #74
Conversation
failable and failure-free patterns.
|
This was the original text in the Haskell 1.3 report, with a proto-version of the |
e8772e1 to
27da397
Compare
|
I like what's here so far. I'm wondering what the pattern syntax looks like; is it possible to include a screenshot of the visual changes? Might be worth adding it to CI so reviewers can just click on the relevant check, but that might be more complicated than it's worth doing. |
There should be no change to the syntax of patterns, the grammar has just been moved into a different subsection. The main changes are a) editorial by introducing more subsections into a long passage of text, and b) spelling out outcomes of pattern matching, linearity, failability and refutability more explicitly in separate subsections. Failability was missing from the report (it is identical to what the Haskell 1.3 report specified), and necessary for the upcoming specification of do-notation desugaring. |
|
@mpilgrem @Superstar64 @L0neGamer @noughtmare @blamario @exaexa @adamgundry @endgame @jmct @gilgamec I have marked this PR as ready for voting: This PR is necessary for us to fully incorporate the MonadFail proposal, since that proposal requires the definition of failure-free patterns. |
L0neGamer
left a comment
There was a problem hiding this comment.
Pending other folks' suggestions, looks good to me!
|
+1 |
adamgundry
left a comment
There was a problem hiding this comment.
One very minor syntactic suggestion, which you are welcome to ignore if you prefer. Otherwise looks good, thanks!
endgame
left a comment
There was a problem hiding this comment.
Voting in favour, but with a few final nits.
Co-authored-by: Mario <blamario@protonmail.com>
5d461a2 to
5981519
Compare
This is a slightly bigger rewrite of the section on patterns and pattern matching. In particular, we need a clear and precise definition of failable and failure-free patterns vs refutable and irrefutable patterns in order to specify the desugaring rules for do-notation in terms of
MonadFail. I added a few numbered subsections to give more structure to the text. I added a new section onPatternsthat is different from the section which explains the semantics of pattern matching.This also fixes #56 by giving precise definitions of both
irrefutableandfailure-freepatterns.