Changes between Version 5 and Version 6 of Commentary/Libraries/Integer
- Timestamp:
- 06/27/12 15:17:44 (11 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Libraries/Integer
v5 v6 26 26 27 27 However, there is a special case for `Integer`s that are within the range of `Int` when the `integer-gmp` implementation is being used; in that case, we use the `S#` constructor (via `integerGmpSDataCon` in [[GhcFile(compiler/prelude/TysWiredIn.lhs)]]) to break the abstraction and directly create the datastructure. 28 29 Most of the functions in the Integer implementation are marked `NOINLINE`. This is because inlining them is generally not beneficial (any constant folding is already handled by the built-in rules), and in fact can be harmful: In the GMP representation, each argument can be one of two constructors (`S#` and `J#`), which leads to 2 branches. When you have a number of `Integer` arithmetic operations, you can get an exponential code explosion if they all get inlined.
