From 9b027f0051763fb5cd444d25d90989acd890aeb4 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 72e71fc2..ed29ab04 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