[Haskell-cafe] Re: evaluation semantics of bind

Andrew Wagner wagner.andrew at gmail.com
Thu Feb 5 12:12:44 EST 2009

Are you saying that using equations to add a level of indirection
> prevents optimization?  I still don't see it - discarding x doesn't
> change the semantics, so a good compiler /should/ do this.  How is
> this different from optimizing out application of a constant function?

No, no compiler should change "getChar >>= \x -> getChar" to just getChar,
because it's just wrong. The first will try to read in two values of type
Char, the second will only try to read one. Side effects aren't THAT hated!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090205/bfb5972d/attachment.htm

More information about the Haskell-Cafe mailing list