3
0
Fork 0
forked from mirrors/nixpkgs

Patch attoparsec-binary to work with GHC 7.6.1

This commit is contained in:
Alexander Foremny 2012-09-21 16:33:24 +02:00
parent 47706bf9f6
commit 882ccb0f52
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,20 @@
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

View file

@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
version = "0.1.0.1";
sha256 = "1d3zjr8bh6d44v1vid0cvrrbyhn7xj4bn96vy36dzk7h7p87bzxa";
buildDepends = [ attoparsec ];
patches = [ ./attoparsec-binary-ghc7.6.1.patch ];
meta = {
description = "Binary processing extensions to Attoparsec";
license = self.stdenv.lib.licenses.bsd3;