Commit db5868cf authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

In GHC.Real, specialise 'even' and 'odd' to Int and Integer

This was previously happening by a fluke -- they were called with those types
in GHC.Real itself -- but my recent changes to specialisation mean that auto
specialisations like these are not necessarily exported.

Losing those specialisations made a huge difference to two performance tests
   perf/should_run/MethSharing
   perf/should_run/T9339
parent 8df3159a
......@@ -517,6 +517,10 @@ showSigned showPos p x
even, odd :: (Integral a) => a -> Bool
even n = n `rem` 2 == 0
odd = not . even
{-# SPECIALISE even :: Int -> Bool #-}
{-# SPECIALISE odd :: Int -> Bool #-}
{-# SPECIALISE even :: Integer -> Bool #-}
{-# SPECIALISE odd :: Integer -> Bool #-}
-------------------------------------------------------
-- | raise a number to a non-negative integral power
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment