RosettaCodeData/Task/Conditional-structures/Unison/conditional-structures.u

6 lines
90 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
factorial : Nat -> Nat
factorial x =
if x == 0 then 1
else
x * fac (Nat.drop x 1)