a63c33478d1ce08b4cd9aaa64734a750d5cca3a4
[ghc-hetmet.git] / ghc / misc / examples / nfib / nfibO.hs
1 module Main where
2
3 main = print (nfib 28)
4
5 nfib :: (Num a, Ord a) => a -> a
6
7 nfib n | n <= 1 = 1
8        | otherwise = (n1 + n2 + 1)
9                      where n1 = nfib (n-1) 
10                            n2 = nfib (n-2)