Adding constant folding for Integer div and mod

Bryan O'Sullivan bos at
Fri Jul 19 19:25:13 CEST 2013

On Fri, Jul 19, 2013 at 9:58 AM, Jan Stolarek <jan.stolarek at>wrote:

> It seems that currently there are no built-in constant folding rules for
> Integer div and mod. I plan on adding those rules, but before I do that I
> wanted to ask whether there is a good reason that these rules don't exist?

I would guess that Integer arithmetic doesn't affect people's performance
much, because a lot of people steer away from Integer. I'd be focusing my
attention on fixed-width numeric types and floating point, as likely to
have a much larger real-world impact.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list