From 1f772b756ff493bcc250a9894a930b6b6cc1308a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=20Nagy?= <20251272+BNAndras@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:57:26 -0700 Subject: [PATCH] Update snippet --- docs/SNIPPET.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/SNIPPET.txt b/docs/SNIPPET.txt index 991fe89..12a5637 100644 --- a/docs/SNIPPET.txt +++ b/docs/SNIPPET.txt @@ -1,3 +1,9 @@ -fun hello(name): - "Hello, " + name + "!" +fun sum(lst): + cases (List) lst: + | empty => 0 + | link(first, rest) => first + sum(rest) + end +where: + sum([list: ]) is 0 + sum([list: 1, 2, 3]) is 6 end