Wed Nov 29 13:39:31 PST 2006 [EMAIL PROTECTED]
* Teach SpecConstr how to handle mutually-recursive functions
Roman found cases where it was important to do SpecConstr for
mutually-recursive definitions. Here is one:
foo :: Maybe Int -> Int
foo Nothing = 0
foo (Just 0) = foo Nothing
foo (Just n) = foo (Just (n-1))
By the time SpecConstr gets to it, it looks like this:
lvl = foo Nothing
foo Nothing = 0
foo (Just 0) = lvl
foo (Just n) = foo (Just (n-1))
Happily, it turns out to be rather straightforward to generalise the
transformation to mutually-recursive functions. Look, ma, only 4
extra lines of ocde!
M ./compiler/specialise/SpecConstr.lhs -72 +76
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc