f7ce562c5946cf2ba1169f81b50fd0274b1bfdee
[cc1516.git] / example.spl
1 /*
2 Three ways to implement the f acto rial function in SPL.
3 First the recursive version .
4 */
5 facR(n) :: Int -> Int {
6 if (n < 2) {
7 return 1;
8 } else {
9 return n * facR(n-1);
10 }
11 }