[Haskell] Expecting more inlining for bit shifting

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Oct 11 07:43:33 EDT 2006


Hello Simon,

Wednesday, October 11, 2006, 2:23:59 PM, you wrote:

> The constant-folding rules for the primops are all in
>         prelude/PrelRules.lhs
> in function primOpRules.  Please add more rules.  For example, I see
> that 
>         x +# 0 = x
> is not in there!

but GHC.Base contains

{-# RULES
"x# +# 0#" forall x#. x# +# 0# = x#
"0# +# x#" forall x#. 0# +# x# = x#
"x# -# 0#" forall x#. x# -# 0# = x#
"x# -# x#" forall x#. x# -# x# = 0#
"x# *# 0#" forall x#. x# *# 0# = 0#
"0# *# x#" forall x#. 0# *# x# = 0#
"x# *# 1#" forall x#. x# *# 1# = x#
"1# *# x#" forall x#. 1# *# x# = x#
  #-}

is this not enough?


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Glasgow-haskell-users mailing list