Exponentiation needs PrelRules
When a user writes a ^ lb
, where lb
is an integer literal, the type of lb
defaults to Integer
unless it's annotated. If lb
is very small, then RULES
will expand the whole expression into a few multiplications. If not, the computation will pay the price of Integer
arithmetic. If we want, we should be able to improve this with a special compilation rule. When lb :: Integer
, and 0 <= lb <= maxBound :: Word
, we should be able to replace lb
by the equivalent Word
. The same problem appears with ^^
and stimes
. Perhaps those can be fixed up as well, somehow.
Trac metadata
Trac field | Value |
---|---|
Version | 8.6.1 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |