From b023710ba6f7d5e67e05ca12c5fff9805e732867 Mon Sep 17 00:00:00 2001 From: Micah Kendall Date: Sun, 27 Nov 2022 00:30:44 +1100 Subject: [PATCH] Assert --- book/src/language-tour/assert.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/book/src/language-tour/assert.md b/book/src/language-tour/assert.md index 72e71fc25..ed29ab046 100644 --- a/book/src/language-tour/assert.md +++ b/book/src/language-tour/assert.md @@ -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. \ No newline at end of file +Primarily for validating input datums / redeemers. + +You can unpack (1-match) data in the assertion + +```gleam +assert Some(x) = Option(Int) +``` \ No newline at end of file