memory 0.14.18 → 0.15.0
raw patch · 3 files changed
+14/−7 lines, 3 filesdep ~basedep ~basement
Dependency ranges changed: base, basement
Files
- Data/ByteArray/Pack/Internal.hs +0/−1
- Data/ByteArray/Parse.hs +7/−2
- memory.cabal +7/−4
Data/ByteArray/Pack/Internal.hs view
@@ -14,7 +14,6 @@ , actionPackerWithRemain ) where -import Data.Word import Foreign.Ptr (Ptr) import Data.ByteArray.MemView import Data.Memory.Internal.Imports
Data/ByteArray/Parse.hs view
@@ -12,8 +12,8 @@ -- > > parse ((,,) <$> take 2 <*> byte 0x20 <*> (bytes "abc" *> anyByte)) "xx abctest" -- > ParseOK "est" ("xx", 116) --+{-# LANGUAGE CPP #-} {-# LANGUAGE Rank2Types #-}-{-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} module Data.ByteArray.Parse ( Parser@@ -36,6 +36,7 @@ ) where import Control.Monad+import qualified Control.Monad.Fail as Fail import Foreign.Storable (Storable, peek, sizeOf) import Data.Word @@ -84,10 +85,14 @@ pure = return (<*>) d e = d >>= \b -> e >>= \a -> return (b a) instance Monad (Parser byteArray) where- fail errorMsg = Parser $ \buf err _ -> err buf ("Parser failed: " ++ errorMsg)+#if !(MIN_VERSION_base(4,13,0))+ fail = Fail.fail+#endif return v = Parser $ \buf _ ok -> ok buf v m >>= k = Parser $ \buf err ok -> runParser m buf err (\buf' a -> runParser (k a) buf' err ok)+instance Fail.MonadFail (Parser byteArray) where+ fail errorMsg = Parser $ \buf err _ -> err buf ("Parser failed: " ++ errorMsg) instance MonadPlus (Parser byteArray) where mzero = fail "MonadPlus.mzero" mplus f g = Parser $ \buf err ok ->
memory.cabal view
@@ -1,5 +1,5 @@ Name: memory-version: 0.14.18+version: 0.15.0 Synopsis: memory and related abstraction stuff Description: Chunk of memory, polymorphic byte array management and manipulation@@ -104,7 +104,7 @@ Build-depends: deepseq >= 1.1 if flag(support_foundation) || flag(support_basement) CPP-options: -DWITH_BASEMENT_SUPPORT- Build-depends: basement+ Build-depends: basement >= 0.0.7 exposed-modules: Data.ByteArray.Sized ghc-options: -Wall -fwarn-tabs@@ -117,8 +117,11 @@ Other-modules: Imports SipHash Utils- Build-Depends: base- , bytestring+ if impl(ghc < 8.0)+ buildable: False+ else+ build-depends: base+ Build-Depends: bytestring , memory , basement >= 0.0.7 , foundation