diff options
author | partain <unknown> | 1996-01-08 20:28:12 +0000 |
---|---|---|
committer | partain <unknown> | 1996-01-08 20:28:12 +0000 |
commit | e7d21ee4f8ac907665a7e170c71d59e13a01da09 (patch) | |
tree | 93715bf4e6e4bbe8049e4d8d4d3fbd19158a88d6 /ghc/misc/examples/nfib/nfibI.hs | |
parent | e48474bff05e6cfb506660420f025f694c870d38 (diff) | |
download | haskell-e7d21ee4f8ac907665a7e170c71d59e13a01da09.tar.gz |
[project @ 1996-01-08 20:28:12 by partain]
Initial revision
Diffstat (limited to 'ghc/misc/examples/nfib/nfibI.hs')
-rw-r--r-- | ghc/misc/examples/nfib/nfibI.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ghc/misc/examples/nfib/nfibI.hs b/ghc/misc/examples/nfib/nfibI.hs new file mode 100644 index 0000000000..a889a1e948 --- /dev/null +++ b/ghc/misc/examples/nfib/nfibI.hs @@ -0,0 +1,10 @@ +module Main where + +main = print (nfib 30) + +nfib :: Int -> Int + +nfib n | n <= 1 = 1 + | otherwise = (n1 + n2 + 1) + where n1 = nfib (n-1) + n2 = nfib (n-2) |