This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
CIS194/test.lhs
2016-03-25 16:54:43 +01:00

14 lines
245 B
Plaintext

Compute the factorial of a given integer number n.
> fac :: Integer -> Integer
> fac 0 = 1
> fac n = n * fac(n-1)
Compute the sum of of all integer numbers from 1 to n.
> sumTo :: Integer -> Integer
> sumTo 0 = 0
> sumTo n = n + sumTo(n-1)