add factorial
This commit is contained in:
parent
6e73e737cc
commit
44aec1f56c
@ -75,6 +75,10 @@ singletons [d|
|
||||
max Z n = n
|
||||
max n Z = n
|
||||
max (S n) (S m) = S (max n m)
|
||||
|
||||
fact ∷ ℕ → ℕ
|
||||
fact Z = S Z
|
||||
fact (S n) = (S n) × (fact n)
|
||||
|]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user