Skip to content

Pattern matching in do notation #756

Open
@formrre

Description

@formrre

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions