diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-09-25 18:34:13 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-25 22:43:52 -0400 |
commit | 9acbeb5a4f923726a847da4db03ca4f540ea478b (patch) | |
tree | bf75f83548e96a37b7b2c5e280524d17ace90e27 /libraries/integer-gmp | |
parent | d07b8c7ae8bc22a7c36c96cb3fd800aecdde6eac (diff) | |
download | haskell-9acbeb5a4f923726a847da4db03ca4f540ea478b.tar.gz |
integer-gmp: Fix style
Just fix a few inconsistencies that I encountered.
[skip ci]
Reviewers: austin, hvr, goldfire
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D4024
Diffstat (limited to 'libraries/integer-gmp')
-rw-r--r-- | libraries/integer-gmp/src/GHC/Integer/Type.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libraries/integer-gmp/src/GHC/Integer/Type.hs b/libraries/integer-gmp/src/GHC/Integer/Type.hs index cb1ceec271..5815950ece 100644 --- a/libraries/integer-gmp/src/GHC/Integer/Type.hs +++ b/libraries/integer-gmp/src/GHC/Integer/Type.hs @@ -587,15 +587,15 @@ shiftRInteger (Jn# bn) n# -- Even though the shift-amount is expressed as `Int#`, the result is -- undefined for negative shift-amounts. shiftLInteger :: Integer -> Int# -> Integer -shiftLInteger x 0# = x +shiftLInteger x 0# = x shiftLInteger (S# 0#) _ = S# 0# shiftLInteger (S# 1#) n# = bitInteger n# shiftLInteger (S# i#) n# - | isTrue# (i# >=# 0#) = bigNatToInteger (shiftLBigNat - (wordToBigNat (int2Word# i#)) n#) - | True = bigNatToNegInteger (shiftLBigNat - (wordToBigNat (int2Word# - (negateInt# i#))) n#) + | isTrue# (i# >=# 0#) = bigNatToInteger (shiftLBigNat + (wordToBigNat (int2Word# i#)) n#) + | True = bigNatToNegInteger (shiftLBigNat + (wordToBigNat (int2Word# + (negateInt# i#))) n#) shiftLInteger (Jp# bn) n# = Jp# (shiftLBigNat bn n#) shiftLInteger (Jn# bn) n# = Jn# (shiftLBigNat bn n#) {-# CONSTANT_FOLDED shiftLInteger #-} |