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