diff --git a/programs/factorial.lily b/programs/factorial.lily new file mode 100644 index 0000000..9947a6a --- /dev/null +++ b/programs/factorial.lily @@ -0,0 +1,12 @@ +defn if c t e = { + case c of { + True -> { t } + False -> { e } + } +} + +defn fact n = { + if (eq n 0) 1 (n * fact (n - 1)) +} + +defn main = { fact 6 }