20 lines
707 B
Diff
20 lines
707 B
Diff
diff --git a/Data/Attoparsec/Binary.hs b/Data/Attoparsec/Binary.hs
|
|
index fab76c6..01d6c8b 100644
|
|
--- a/Data/Attoparsec/Binary.hs
|
|
+++ b/Data/Attoparsec/Binary.hs
|
|
@@ -23,7 +23,7 @@ import Data.Word
|
|
byteSize :: (Bits a) => a -> Int
|
|
byteSize = (`div` 8) . bitSize
|
|
|
|
-pack :: (Bits a) => B.ByteString -> a
|
|
+pack :: (Bits a, Num a) => B.ByteString -> a
|
|
pack = B.foldl' (\n h -> (n `shiftL` 8) .|. fromIntegral h) 0
|
|
|
|
anyWordN :: (Bits a) => (B.ByteString -> a) -> Parser a
|
|
@@ -84,4 +84,4 @@ word64be = wordN unpack
|
|
|
|
-- |Match a specific 64-bit little-endian word.
|
|
word64le :: Word64 -> Parser Word64
|
|
-word64le = wordN $ B.reverse . unpack
|
|
\ No newline at end of file
|
|
+word64le = wordN $ B.reverse . unpack
|