Re: Re[2]: Compiler optimizations questions for ghc 6.10...

2009-02-21 Thread Bertram Felgenhauer
Krasimir Angelov wrote: > How mod is affected by the change in quot? Currently mod is defined as: > > a `mod` b > | b == 0 = divZeroError > | a == minBound && b == (-1) = overflowError > | otherwise = a `modInt` b > > and modInt is defined

Re: Re[2]: Compiler optimizations questions for ghc 6.10...

2009-02-21 Thread Krasimir Angelov
How mod is affected by the change in quot? Currently mod is defined as: a `mod` b | b == 0 = divZeroError | a == minBound && b == (-1) = overflowError | otherwise = a `modInt` b and modInt is defined via remInt# which is primitive. Did you

Re: Re[2]: Compiler optimizations questions for ghc 6.10...

2009-02-21 Thread Bertram Felgenhauer
Krasimir Angelov wrote: > Well I actually did, almost. I added this function: > > quotX :: Int -> Int -> Int > a `quotX` b >| b == 0 = error "divZeroError" >| b == (-1) && a == minBound = error "overflowError" >| otherwise = a `quotInt` b > > It d

Re: Re[2]: Compiler optimizations questions for ghc 6.10...

2009-02-20 Thread Krasimir Angelov
Well I actually did, almost. I added this function: quotX :: Int -> Int -> Int a `quotX` b | b == 0 = error "divZeroError" | b == (-1) && a == minBound = error "overflowError" | otherwise = a `quotInt` b It does the right thing. However to be sure th

Re[2]: Compiler optimizations questions for ghc 6.10...

2009-02-20 Thread Bulat Ziganshin
Hello Krasimir, Friday, February 20, 2009, 11:00:30 AM, you wrote: > and this is exactly what we get. I bet that if the original function was: well, you check this yourself! :) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___