summaryrefslogtreecommitdiff
path: root/nfib.icl
blob: cc7ecda1f0fa5c7e0e701cc0abb69af13e0de579 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module nfib

/*
The nfib function.

To obtain maximum performance guards are used instead of
pattern matching.
*/

import StdInt

Nfib::Int -> Int
Nfib n	| n < 2 = 	1
				= 	Nfib (n - 1) + Nfib (n - 2) + 1

Start::Int
Start = Nfib 30