diff --git a/example/factorial.hz b/example/factorial.hz new file mode 100644 index 0000000..e8f98e5 --- /dev/null +++ b/example/factorial.hz @@ -0,0 +1,10 @@ +fun factorial (n: int): int = do + case n of + | 0 -> return 1; + \ return n * factorial(n - 1); + end; +end; + +fun main: void = do + factorial(5) |> @write(_); +end; \ No newline at end of file