From 8d008197902103fd262130ba7a08f759c2b899bd Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 9 Mar 2013 21:19:53 +0000 Subject: [PATCH] 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 --- src/runtime/haskell/Data/Binary/IEEE754.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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