attoparsec-conduit 0.2.0.1 → 0.3.0
raw patch · 2 files changed
+7/−8 lines, 2 filesdep ~conduitPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: conduit
API changes (from Hackage documentation)
- Data.Conduit.Attoparsec: sinkParser :: (AttoparsecInput a, ResourceThrow m) => Parser a b -> Sink a m b
+ Data.Conduit.Attoparsec: sinkParser :: (AttoparsecInput a, MonadThrow m) => Parser a b -> Sink a m b
Files
Data/Conduit/Attoparsec.hs view
@@ -23,7 +23,6 @@ import qualified Data.Attoparsec.Text import qualified Data.Attoparsec.Types as A import qualified Data.Conduit as C-import Control.Monad.Trans.Class (lift) -- | The context and message from a 'A.Fail' value. data ParseError = ParseError@@ -59,8 +58,8 @@ -- | Convert an Attoparsec 'A.Parser' into a 'C.Sink'. The parser will -- be streamed bytes until it returns 'A.Done' or 'A.Fail'. ----- If parsing fails, a 'ParseError' will be thrown with 'C.resourceThrow'.-sinkParser :: (AttoparsecInput a, C.ResourceThrow m) => A.Parser a b -> C.Sink a m b+-- If parsing fails, a 'ParseError' will be thrown with 'C.monadThrow'.+sinkParser :: (AttoparsecInput a, C.MonadThrow m) => A.Parser a b -> C.Sink a m b sinkParser p0 = C.sinkState (parseA p0) push@@ -72,10 +71,10 @@ A.Done leftover x -> let lo = if isNull leftover then Nothing else Just leftover in return (C.StateDone lo x)- A.Fail _ contexts msg -> lift $ C.resourceThrow $ ParseError contexts msg+ A.Fail _ contexts msg -> C.monadThrow $ ParseError contexts msg A.Partial p -> return (C.StateProcessing p) close parser = do case feedA (parser empty) empty of A.Done _leftover y -> return y- A.Fail _ contexts msg -> lift $ C.resourceThrow $ ParseError contexts msg- A.Partial _ -> lift $ C.resourceThrow DivergentParser+ A.Fail _ contexts msg -> C.monadThrow $ ParseError contexts msg+ A.Partial _ -> C.monadThrow DivergentParser
attoparsec-conduit.cabal view
@@ -1,5 +1,5 @@ Name: attoparsec-conduit-Version: 0.2.0.1+Version: 0.3.0 Synopsis: Turn attoparsec parsers into sinks. Description: Turn attoparsec parsers into sinks. License: BSD3@@ -19,7 +19,7 @@ , bytestring >= 0.9 , attoparsec >= 0.10 , text >= 0.11- , conduit >= 0.2 && < 0.3+ , conduit >= 0.3 && < 0.4 ghc-options: -Wall test-suite test