hexpat-streamparser 0.1.1 → 0.1.2
raw patch · 2 files changed
+5/−43 lines, 2 filesdep +cps-exceptdep ~hexpat-streamparserPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: cps-except
Dependency ranges changed: hexpat-streamparser
API changes (from Hackage documentation)
- Text.XML.Expat.StreamParser: instance Control.Monad.State.Class.MonadState s m => Control.Monad.State.Class.MonadState s (Text.XML.Expat.StreamParser.CPSExceptT e m)
- Text.XML.Expat.StreamParser: instance Control.Monad.Trans.Class.MonadTrans (Text.XML.Expat.StreamParser.CPSExceptT e)
- Text.XML.Expat.StreamParser: instance GHC.Base.Functor (Text.XML.Expat.StreamParser.CPSExceptT e m)
- Text.XML.Expat.StreamParser: instance GHC.Base.Monad m => Control.Monad.Error.Class.MonadError e (Text.XML.Expat.StreamParser.CPSExceptT e m)
- Text.XML.Expat.StreamParser: instance GHC.Base.Monad m => GHC.Base.Applicative (Text.XML.Expat.StreamParser.CPSExceptT e m)
- Text.XML.Expat.StreamParser: instance GHC.Base.Monad m => GHC.Base.Monad (Text.XML.Expat.StreamParser.CPSExceptT e m)
Files
hexpat-streamparser.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12 name: hexpat-streamparser description: streaming xml parser combinators using hexpat-version: 0.1.1+version: 0.1.2 maintainer: kristof@resonata.be copyright: Kristof Bastiaensen 2020 license: BSD3@@ -27,7 +27,8 @@ text >= 1.2 && < 1.3 , parser-combinators >= 1.2 && < 1.3, transformers >= 0.5 && < 0.6,- bytestring >= 0.10 && < 0.11+ bytestring >= 0.10 && < 0.11,+ cps-except >= 0.0.1.0 default-extensions: OverloadedStrings test-suite test@@ -39,7 +40,7 @@ test.hs build-depends: hexpat >= 0.20 && < 0.21, - hexpat-streamparser == 0.1.1,+ hexpat-streamparser == 0.1.2, base >= 4 && < 5, hspec default-extensions: OverloadedStrings
src/Text/XML/Expat/StreamParser.hs view
@@ -89,6 +89,7 @@ import Control.Applicative hiding (many) import Control.Monad.Combinators as C import Control.Monad.Error.Class+import Control.Monad.CPSExcept import Control.Monad.Fail import Control.Monad.State hiding (fail, lift) import Control.Monad.Trans (lift)@@ -103,46 +104,6 @@ import Data.Text (Text) import Text.XML.Expat.SAX as Expat import Data.List (nub)--newtype CPSExceptT e m a =- CPSExceptT { getCPSExceptT :: forall r. ((e -> m r) -> (a -> m r) -> m r) }--runCPSExceptT :: Applicative m => CPSExceptT e m a -> m (Either e a)-runCPSExceptT (CPSExceptT f) = f (pure . Left) (pure . Right)-{-# INLINE runCPSExceptT #-}--instance Functor (CPSExceptT e m) where- fmap f (CPSExceptT g) = CPSExceptT $ \failC successC ->- g failC (successC . f)- {-# INLINE fmap #-}--instance Monad m => Applicative (CPSExceptT e m) where- pure x = CPSExceptT $ \_failC successC -> successC x- {-# INLINE pure #-}- (<*>) = ap- {-# INLINE (<*>) #-}--instance Monad m => Monad (CPSExceptT e m) where- CPSExceptT f >>= g = CPSExceptT $ \failC successC ->- f failC (\a -> getCPSExceptT (g a) failC successC)- {-# INLINE (>>=) #-}--instance Monad m => MonadError e (CPSExceptT e m) where- throwError e = CPSExceptT $ \failC _successC -> failC e- {-# INLINE throwError #-}- catchError (CPSExceptT f) handler =- CPSExceptT $ \failC successC ->- f (\e -> getCPSExceptT (handler e) failC successC)- successC- {-# INLINE catchError #-}--instance MonadTrans (CPSExceptT e) where- lift m = CPSExceptT $ \_failC successC -> m >>= successC- {-# INLINE lift #-}--instance MonadState s m => MonadState s (CPSExceptT e m) where- state f = lift $ state f- {-# INLINE state #-} type EventLoc = (SAXEvent Text Text, XMLParseLocation)