Commits

Alessandro Vermeulen committed 0237983

Example for seeing memo in action in compiled programs. See Main.hs.

  • Participants
  • Parent commits d974aa1

Comments (0)

Files changed (1)

File code/Main.hs

 
 import Debug.Trace ( trace )
 
-main = print "Hello :) "
+import System.Vacuum.Ubigraph ( view )
 
+main = do putStrLn "--"
+          print (mfib' 30000)
+          putStrLn "--"
+          print (mfib' 30003)
+          
 memoTrace = C.untrie . (trace "Building trie" C.trie)
 
-sfib :: Integer -> Integer
-sfib = C.untrie fibtrie
-
-sfib' :: Integer -> Integer
-sfib' 0 = 0
-sfib' 1 = 1
-sfib' n = sfib (n-2) + sfib (n-1)
-
-
 mfib :: Integer -> Integer
 mfib = memoTrace mfib'