HOL icon indicating copy to clipboard operation
HOL copied to clipboard

Pattern matching in do notation

Open formrre opened this issue 5 years ago • 1 comments

HOL currently doesn't support the following inside do-od notation:

(SOME x) <- action;
f x

Monad syntax includes a field for fail, which could be used to implement this in the style of Haskell's MonadFail.

In particular the above should desugar to:

action `mbind` (\y. case y of
                        | SOME x -> f x
                        | _ -> fail)

formrre avatar Nov 26 '19 15:11 formrre

Sounds great!

mn200 avatar Nov 26 '19 23:11 mn200