[project @ 1996-07-25 21:02:03 by partain]
[nofib.git] / GHC_ONLY / io012 / Main.hs
1 import IO -- 1.3
2
3 import CPUTime
4
5 main =
6 openFile "/dev/null" WriteMode >>= \ h ->
7 hPrint h (nfib 30) >>
8 getCPUTime >>= \ t ->
9 print t
10
11 nfib :: Integer -> Integer
12 nfib n
13 | n <= 1 = 1
14 | otherwise = (n1 + n2 + 1)
15 where
16 n1 = nfib (n-1)
17 n2 = nfib (n-2)