fix: Add Inhabited instance for OptionT (#7901)
This PR adds `instance [Pure f] : Inhabited (OptionT f α)`, so that `Inhabited (OptionT Id Empty)` synthesizes. Co-authored-by: Sebastian Graf <sg@lean-fro.org>
This commit is contained in:
parent
69536808ca
commit
d2f4ce0158
1 changed files with 3 additions and 0 deletions
|
|
@ -59,6 +59,9 @@ instance : Monad (OptionT m) where
|
|||
pure := OptionT.pure
|
||||
bind := OptionT.bind
|
||||
|
||||
instance {m : Type u → Type v} [Pure m] : Inhabited (OptionT m α) where
|
||||
default := pure (f:=m) default
|
||||
|
||||
/--
|
||||
Recovers from failures. Typically used via the `<|>` operator.
|
||||
-/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue