#2325: Compile-time computations
-----------------------------------------+----------------------------------
    Reporter:  ajd                       |        Owner:         
        Type:  run-time performance bug  |       Status:  new    
    Priority:  normal                    |    Milestone:         
   Component:  Compiler                  |      Version:  6.8.2  
    Severity:  normal                    |   Resolution:         
    Keywords:  constant folding          |     Testcase:         
Architecture:  Unknown                   |           Os:  Unknown
-----------------------------------------+----------------------------------
Changes (by dons):

  * keywords:  => constant folding

Comment:

 I think this is specific to Integer, which is a more complex type.

 If you constrain your values to be machine Int,

 {{{
 module M where

 foo :: Int
 foo = 1 + 2
 }}}

 Then we see the +# rule fire,

 {{{
 1 RuleFired
     1 +#
 4 BetaReduction
 3 KnownBranch
 9 SimplifierDone

 ------------------------------- Core -----------------------------------

 M.foo :: Int
 M.foo = I# 3

 }}}

 So perhaps it is a simple matter of adding these rules to the compiler.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2325#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to