chore: rename Option.toMonad and remove argument (#3865)

This commit is contained in:
Kim Morrison 2024-04-17 06:58:54 +02:00 committed by GitHub
parent c6fbeaa721
commit cefba8abd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -132,6 +132,8 @@ fact.def :
* The change to the instance name algorithm (described above) can break projects that made use of the auto-generated names.
* `Option.toMonad` has been renamed to `Option.getM` and the unneeded `[Monad m]` instance argument has been removed.
v4.7.0
---------

View file

@ -13,10 +13,14 @@ namespace Option
deriving instance DecidableEq for Option
deriving instance BEq for Option
def toMonad [Monad m] [Alternative m] : Option α → m α
/-- Lifts an optional value to any `Alternative`, sending `none` to `failure`. -/
def getM [Alternative m] : Option α → m α
| none => failure
| some a => pure a
@[deprecated getM] def toMonad [Monad m] [Alternative m] : Option α → m α :=
getM
@[inline] def toBool : Option α → Bool
| some _ => true
| none => false