Add Option.force_msg (#328)

* Add Option.force_msg

* CHANGELOG update
This commit is contained in:
Radosław Rowicki
2021-08-03 11:39:53 +02:00
committed by GitHub
parent b20b9c5df5
commit 4896ad3b36
3 changed files with 18 additions and 1 deletions
+11 -1
View File
@@ -1293,7 +1293,17 @@ Escapes `option` wrapping by providing default value for `None`.
Option.force(o : option('a)) : 'a
```
Forcefully escapes `option` wrapping assuming it is `Some`. Throws error on `None`.
Forcefully escapes the `option` wrapping assuming it is `Some`.
Aborts on `None`.
#### force_msg
```
Option.force_msg(o : option('a), err : string) : 'a
```
Forcefully escapes the `option` wrapping assuming it is `Some`.
Aborts with `err` error message on `None`.
#### contains