Common subexpressions are not optimized to single one?

Derek Elkins ddarius at
Tue Dec 2 22:58:38 EST 2003

On Wed, 3 Dec 2003 03:29:14 +0900
Koji Nakahara <yu- at> wrote:

> I want to use some C functions from haskell each of which is not pure
> but the result of their sequential combination is pure.  I'm planning
> to write some functions like g above(but more complex and actually
> pure) and considering the optimization of the code using them.

Then you should write it monadically, then unsafePerformIO the result,
you shouldn't rely on the compiler performing (or not performing) an

More information about the Haskell-Cafe mailing list