summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@community.haskell.org>2013-03-09 21:19:53 +0000
committerSergei Trofimovich <slyfox@community.haskell.org>2013-03-09 21:19:53 +0000
commit5b688b635993ca7308221aef852fac84fc102847 (patch)
tree3eae5e1fc5d4fad2746bf195ab567e186fcb7ebd
parent523633a092b045b65f0d4722e72f118a09c991f2 (diff)
ghc-7.6: add missing Num instance for Bits
Fixes the following build failure: src/runtime/haskell/Data/Binary/IEEE754.lhs:256:17: Could not deduce (Num a) arising from a use of `mask' from the context (Bits a) bound by the type signature for clamp :: Bits a => BitCount -> a -> a
-rw-r--r--src/runtime/haskell/Data/Binary/IEEE754.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/haskell/Data/Binary/IEEE754.lhs b/src/runtime/haskell/Data/Binary/IEEE754.lhs
index af11a5946..96cbefc5a 100644
--- a/src/runtime/haskell/Data/Binary/IEEE754.lhs
+++ b/src/runtime/haskell/Data/Binary/IEEE754.lhs
@@ -252,7 +252,7 @@ rawToBytes raw = integerToBytes mashed width where
in positions above the count.
\begin{code}
-clamp :: Bits a => BitCount -> a -> a
+clamp :: (Num a, Bits a) => BitCount -> a -> a
clamp = (.&.) . mask where
mask 1 = 1
mask n | n > 1 = (mask (n - 1) `shiftL` 1) + 1