#5767: Integer inefficiencies --------------------------------------+------------------------------------- Reporter: rl | Owner: igloo Type: bug | Status: new Priority: highest | Milestone: 7.4.1 Component: Compiler | Version: 7.5 Resolution: | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Runtime performance bug | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: --------------------------------------+-------------------------------------
Comment(by simonpj): Note: the call to `smallInteger` arises from the `fromIntegral` method of `Integral Int` (in `base:GHC.Real`): {{{ instance Integral Int where toInteger (I# i) = smallInteger i }}} So, yes we need a `integerToInt (smallInteger n)` RULE. Ditto `int64ToInteger` and `wordToInteger`. Also we'd like a RULE for `(smallInteger (I# n)`, which should generate an `Integer` literal. This isn't easy right now for tiresome reasons. !ToDo for 7.6. The most plausible route for doing it is to take `mkIntegerLit` out of `Integer` literals, and keep it somewhere global instead. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5767#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs