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:
Sebastian Graf 2025-04-10 16:49:03 +02:00 committed by GitHub
parent 69536808ca
commit d2f4ce0158
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.
-/