forked from GitHub/gf-core
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user