Pattern matching notation for monadic binds
Compare changes
+ 7
− 18
@@ -887,25 +887,14 @@ Notation "(≫= f )" := (mbind f) (only parsing) : stdpp_scope.
@@ -918,9 +907,9 @@ Class MGuard (M : Type → Type) :=
This gets rid of the old hack to have specific notations for pairs up to a fixed arity, and moreover allows to do fancy things like:
Record test := Test { t1 : nat; t2 : nat }.
Definition foo (x : option test) : option nat :=
''(Test a1 a2) ← x;
Some a1.
There are some problems, however:
' x
for Zpos x
. Fortunately, the breakage is in the right direction: the proposed monadic notation breaks Coq's ' x
. Furthermore, I believe said notation should be removed from Coq, see https://github.com/coq/coq/pull/6155
'
. As such, this means we need a double '
.