----- Original Message -----
From: "Albert Lai" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 7:35 AM
Subject: Re: Optimisation and unsafePerformIO
> "David Sabel" <[EMAIL PROTECTED]> writes:
>
> > {-# NOINLINE b #-}
> >
> > b x = if even x then unsafePerformIO getChar else bot
> >
> > bot = bot
> >
> > main = do
> > putChar (b 4)
> > putChar (b 6)
>
> I am not a compiler implementer (or lawyer, for that matter :)
> But I propose this guess. First, both even 4 and even 6 get
> constant-folded to True; so b 4 and b 6 both become unsafePerformIO
> getChar. Then there is a common subexpression elimination.
No! I used the option -fno-cse, what means that common supexpression
elimination is turned off.
> _______________________________________________
> Glasgow-haskell-users mailing list
> [EMAIL PROTECTED]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users