Monad: Allow patterns in 'let*' notation #108
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #97
This actually reverts and improves a change in #99 (i.e., the ability to add type signatures in bindings was also removed from
let*
; this PR adds it back, in a terser fashion).I think the main thing left in that issue to resolve was:
And I don't think so.
It was only just added.
IMO
let* _ := _ in _
is much nicer to the point that I would recommend always using this style.Maybe it clashes with a Scheme convention, but OCaml gives a precedent for this notation. And in PLT "let" is in fact closely related to monads.
If I am guessing correctly, the notation
_ <- _ ;; _
comes from trying to emulate Haskell'sdo
-notation, but a crucial difference is that in Haskell it is a much less ambiguous syntax because it is announced by ado
keyword and delimited by layout or braces. In Coq, those benefits don't apply so it doesn't work quite as well.