Compare commits

..

2 Commits

Author SHA1 Message Date
radrow 71f77a8e02 Minor note 2021-07-05 15:18:22 +02:00
radrow 1a1541028c Prepare 6.0.2 2021-07-05 14:37:42 +02:00
3 changed files with 4 additions and 21 deletions
-1
View File
@@ -6,7 +6,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- `Option.force_msg`
### Changed
### Removed
+4 -14
View File
@@ -362,7 +362,7 @@ namespace Chain =
#### tx_hash
```
Auth.tx_hash : option(hash)
Auth.tx_hash : option(Chain.tx)
```
Gets the transaction hash during authentication.
@@ -824,7 +824,7 @@ payable contract Auction =
stateful entrypoint sell(amount) =
require(amount >= 0, "negative_amount")
...
main contract Market =
type state = list(Auction)
entrypoint init() = []
@@ -876,7 +876,7 @@ payable contract interface Auction =
entrypoint init : (int, string) => void
stateful payable entrypoint buy : (int) => ()
stateful entrypoint sell : (int) => ()
main contract Market =
type state = list(Auction)
entrypoint init() = []
@@ -1293,17 +1293,7 @@ Escapes `option` wrapping by providing default value for `None`.
Option.force(o : option('a)) : 'a
```
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`.
Forcefully escapes `option` wrapping assuming it is `Some`. Throws error on `None`.
#### contains
-6
View File
@@ -26,12 +26,6 @@ namespace Option =
None => abort("Forced None value")
Some(x) => x
/** Assume it is `Some` with custom error message
*/
function force_msg(o : option('a), err : string) : 'a = switch(o)
None => abort(err)
Some(x) => x
function contains(e : 'a, o : option('a)) = o == Some(e)
function on_elem(o : option('a), f : 'a => unit) : unit = match((), f, o)