Skip to content

Commit

Permalink
Assert
Browse files Browse the repository at this point in the history
  • Loading branch information
micahkendall committed Nov 26, 2022
1 parent 9d734bb commit b023710
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion book/src/language-tour/assert.md
Expand Up @@ -7,4 +7,10 @@ assert rawdata = SomeType
Causes the script to fail if the rawdata doesn't match the structure of datumtype
Otherwise, returns a value of SomeType

Primarily for validating input datums / redeemers.
Primarily for validating input datums / redeemers.

You can unpack (1-match) data in the assertion

```gleam
assert Some(x) = Option(Int)
```

0 comments on commit b023710

Please sign in to comment.