summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Real.hs
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-03-14 13:27:23 +0100
committerBen Gamari <ben@smart-cactus.org>2016-03-20 16:05:43 +0100
commit2841ccab595ce38fb86b789574f057c3abe3d630 (patch)
tree3f91a8d611de9cafc6db6eb86af991d1c1806063 /libraries/base/GHC/Real.hs
parent3ddfcc95cd41dac19c8f4d55e8fc03128b77b738 (diff)
downloadhaskell-2841ccab595ce38fb86b789574f057c3abe3d630.tar.gz
Mark GHC.Real.even and odd as INLINEABLE
Previously they were merely specialised at Int and Integer. It seems to me that these are cheap enough to be worth inlining. See #11701 for motivation. Test Plan: Validate Reviewers: austin, hvr, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1997 GHC Trac Issues: #11701
Diffstat (limited to 'libraries/base/GHC/Real.hs')
-rw-r--r--libraries/base/GHC/Real.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/libraries/base/GHC/Real.hs b/libraries/base/GHC/Real.hs
index 186be27cdf..3a97f1f18c 100644
--- a/libraries/base/GHC/Real.hs
+++ b/libraries/base/GHC/Real.hs
@@ -463,10 +463,8 @@ 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 #-}
+{-# INLINEABLE even #-}
+{-# INLINEABLE odd #-}
-------------------------------------------------------
-- | raise a number to a non-negative integral power