summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Num.hs
diff options
context:
space:
mode:
authorSeraphime Kirkovski <kirkseraph@gmail.com>2016-06-06 12:29:38 +0200
committerBen Gamari <ben@smart-cactus.org>2016-06-06 15:07:18 +0200
commita90085bd45239fffd65c01c24752a9bbcef346f1 (patch)
tree41a85ba36720d8fba0a3296ea7a844dd9fc0042a /libraries/base/GHC/Num.hs
parent48e9a1f5521fa3185510d144dd28a87e452ce134 (diff)
downloadhaskell-a90085bd45239fffd65c01c24752a9bbcef346f1.tar.gz
Add @since annotations to base instances
Add @since annotations to instances in `base`. Test Plan: * ./validate # some commets shouldn't break the build * review the annotations for absurdities. Reviewers: ekmett, goldfire, RyanGlScott, austin, hvr, bgamari Reviewed By: RyanGlScott, hvr, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2277 GHC Trac Issues: #11767
Diffstat (limited to 'libraries/base/GHC/Num.hs')
-rw-r--r--libraries/base/GHC/Num.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/libraries/base/GHC/Num.hs b/libraries/base/GHC/Num.hs
index 5d46dacedd..fd98c19f20 100644
--- a/libraries/base/GHC/Num.hs
+++ b/libraries/base/GHC/Num.hs
@@ -64,6 +64,7 @@ class Num a where
subtract :: (Num a) => a -> a -> a
subtract x y = y - x
+-- | @since 2.01
instance Num Int where
I# x + I# y = I# (x +# y)
I# x - I# y = I# (x -# y)
@@ -78,6 +79,7 @@ instance Num Int where
{-# INLINE fromInteger #-} -- Just to be sure!
fromInteger i = I# (integerToInt i)
+-- | @since 2.01
instance Num Word where
(W# x#) + (W# y#) = W# (x# `plusWord#` y#)
(W# x#) - (W# y#) = W# (x# `minusWord#` y#)
@@ -88,6 +90,7 @@ instance Num Word where
signum _ = 1
fromInteger i = W# (integerToWord i)
+-- | @since 2.01
instance Num Integer where
(+) = plusInteger
(-) = minusInteger