[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / misc / examples / nfib / nfibD.hs
diff --git a/ghc/misc/examples/nfib/nfibD.hs b/ghc/misc/examples/nfib/nfibD.hs
new file mode 100644 (file)
index 0000000..373bef3
--- /dev/null
@@ -0,0 +1,10 @@
+module Main where
+
+main = print (nfib 28)
+
+nfib :: Double -> Double
+
+nfib n | n <= 1 = 1
+       | otherwise = (n1 + n2 + 1)
+                     where n1 = nfib (n-1) 
+                           n2 = nfib (n-2)