mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Update some Result docs
This commit is contained in:
parent
e7dde9bffc
commit
a1656381c5
1 changed files with 2 additions and 2 deletions
|
@ -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 ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue