Update some Result docs

This commit is contained in:
Richard Feldman 2024-01-21 12:52:39 -05:00
parent e7dde9bffc
commit a1656381c5
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -84,8 +84,8 @@ try = \result, transform ->
## function on the value the `Err` holds. Then returns that new result. If the
## result is `Ok`, this has no effect. Use `try` to transform an `Ok`.
## ```
## Result.onErr (Ok 10) \errorNum -> Str.toNat errorNum
## Result.onErr (Err "42") \errorNum -> Str.toNat errorNum
## Result.onErr (Ok 10) \errorNum -> Str.toU64 errorNum
## Result.onErr (Err "42") \errorNum -> Str.toU64 errorNum
## ```
onErr : Result a err, (err -> Result a otherErr) -> Result a otherErr
onErr = \result, transform ->