Re: [Haskell-cafe] Why doesn't GHC optimize recursive functions by converting them into `let`?

2012-11-09 Thread Petr P
Hi Carter, 2012/11/8 Carter Schonwald > I imagine that one issue that would make it not a default activity by GHC > is that this sort of strategy has the following implications: > > 1) ghc in general doesn't always want to inline in general, inlining > increases the size of code! and depend

Re: [Haskell-cafe] Why doesn't GHC optimize recursive functions by converting them into `let`?

2012-11-08 Thread Carter Schonwald
Hey Petr, interesting post! (and links) I imagine that one issue that would make it not a default activity by GHC is that this sort of strategy has the following implications: 1) ghc in general doesn't always want to inline in general, inlining increases the size of code! and depending on how

[Haskell-cafe] Why doesn't GHC optimize recursive functions by converting them into `let`?

2012-11-08 Thread Petr P
Hi, recently I found out that some recursive functions can be greatly optimized just by rewriting them using `let` so that they're not recursive themselves any more (only the inner let is). To give an example: > fix :: (a -> a) -> a > fix f = f (fix f) isn't optimized, because it's a recursive