Skip to content

Replace `MGuard` typeclass by uniform definition based on a new `MFail`

As proposed here by @Blaisorblade, slightly adjusted:

Definition guard `{MFail M, MRet M} P `{Decision P} :=
  match decide P with
  | left H => mret H
  | right _ => mfail
end.

MonadSet could also have laws for MFail.