Compare commits

...

2 Commits

Author SHA1 Message Date
Scott Morrison
4a80863130 suggestion from review
oops

oops
2024-04-17 14:43:24 +10:00
Scott Morrison
4bd632bf76 chore: rename Option.toMonad and remove argument 2024-04-17 14:42:33 +10:00
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