Skip to content

Commit

Permalink
Add bidi type inference to monad class constructors
Browse files Browse the repository at this point in the history
This improves error messages when the fields are messed up.
  • Loading branch information
JasonGross committed May 3, 2023
1 parent 6c63eac commit a200254
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/theories/monad_utils.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ Class Monad@{d c} (m : Type@{d} -> Type@{c}) : Type :=
{ ret : forall {t : Type@{d}}, t -> m t
; bind : forall {t u : Type@{d}}, m t -> (t -> m u) -> m u
}.
Global Arguments Build_Monad _ & _ _. (* for better type inference and error messages *)

Class MonadExc E (m : Type -> Type) : Type :=
{ raise : forall {T}, E -> m T
; catch : forall {T}, m T -> (E -> m T) -> m T
}.
Global Arguments Build_MonadExc _ _ & _ _. (* for better type inference and error messages *)


Module MCMonadNotation.
Expand Down

0 comments on commit a200254

Please sign in to comment.