soap-0.2.3.6: SOAP client tools

Safe Haskell | None
Language | Haskell98

Network.SOAP.Parsing.Stream

Contents

- Tags
- Content
- Types to use in custom parser sinks

Description

Collection of helpers to use with Text.XML.Stream.Parse parsers.

    let sink = flaxTag "MethodNameResponse"
             $ flaxTag "MethodNameResult" $ do
                 info <- flaxTag "Info" $ do
                             q <- readTag "quantity"
                             b <- readTag "balance"
                             return $ Info q b
                 rc <- readTag "ResponseCode"
                 return (rc, info)

Synopsis

- laxTag :: forall (m :: Type -> Type) a. MonadThrow m => Text -> ConduitM Event Void m a -> ConduitM Event Void m (Maybe a)
- flaxTag :: forall (m :: Type -> Type) a. MonadThrow m => Text -> ConduitM Event Void m a -> ConduitM Event Void m a
- laxContent :: forall (m :: Type -> Type). MonadThrow m => Text -> ConduitM Event Void m (Maybe Text)
- flaxContent :: forall (m :: Type -> Type). MonadThrow m => Text -> ConduitM Event Void m Text
- readContent :: forall a (m :: Type -> Type). (Read a, MonadThrow m) => ConduitM Event Void m a
- readTag :: forall a (m :: Type -> Type). (Read a, MonadThrow m) => Text -> ConduitM Event Void m a
- data Event
- type ConduitM = ConduitT
- data Void
- type Sink i = ConduitT i Void

# Tags

laxTag :: forall (m :: Type -> Type) a. MonadThrow m => Text -> ConduitM Event Void m a -> ConduitM Event Void m (Maybe a) Source #

Namespace- and attribute- ignorant tagNoAttr.

flaxTag :: forall (m :: Type -> Type) a. MonadThrow m => Text -> ConduitM Event Void m a -> ConduitM Event Void m a Source #

Non-maybe version of laxTag/tagNoAttr.

# Content

laxContent :: forall (m :: Type -> Type). MonadThrow m => Text -> ConduitM Event Void m (Maybe Text) Source #

flaxContent :: forall (m :: Type -> Type). MonadThrow m => Text -> ConduitM Event Void m Text Source #

readContent :: forall a (m :: Type -> Type). (Read a, MonadThrow m) => ConduitM Event Void m a Source #

Unpack and read a current tag content.

readTag :: forall a (m :: Type -> Type). (Read a, MonadThrow m) => Text -> ConduitM Event Void m a Source #

Unpack and read tag content by local name.

# Types to use in custom parser sinks

data Event Source #

Some XML processing tools are incremental, and work in terms of events rather than node trees. The `Event` type allows a document to be fully specified as a sequence of events.

Event-based XML libraries include:

- http://hackage.haskell.org/package/xml-enumerator
- http://hackage.haskell.org/package/libxml-enumerator
- http://hackage.haskell.org/package/expat-enumerator

#### Instances

Instances details

NFData Event |
Instance details Defined in Data.XML.Types Methods rnf :: Event -> () Source #
Data Event |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Event -> c Event Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Event Source #

toConstr :: Event -> Constr Source #

dataTypeOf :: Event -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Event) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Event) Source #

gmapT :: (forall b. Data b => b -> b) -> Event -> Event Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Event -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Event -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Event -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Event -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Event -> m Event Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Event -> m Event Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Event -> m Event Source #

Generic Event |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Event |

Instance details

Defined in Data.XML.Types

type Rep Event = D1 ('MetaData "Event" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (((C1 ('MetaCons "EventBeginDocument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventEndDocument" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EventBeginDoctype" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ExternalID))) :+: (C1 ('MetaCons "EventEndDoctype" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction))))) :+: ((C1 ('MetaCons "EventBeginElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Name, [Content])])) :+: C1 ('MetaCons "EventEndElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name))) :+: (C1 ('MetaCons "EventContent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Content)) :+: (C1 ('MetaCons "EventComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "EventCDATA" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))))

Methods

from :: Event -> Rep Event x Source #

to :: Rep Event x -> Event Source #

Show Event |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Event -> ShowS Source # show :: Event -> String Source # showList :: [Event] -> ShowS Source #
Eq Event |
Instance details Defined in Data.XML.Types Methods (==) :: Event -> Event -> Bool Source # (/=) :: Event -> Event -> Bool Source #
Ord Event |
Instance details Defined in Data.XML.Types Methods compare :: Event -> Event -> Ordering Source # (<) :: Event -> Event -> Bool Source # (<=) :: Event -> Event -> Bool Source # (>) :: Event -> Event -> Bool Source # (>=) :: Event -> Event -> Bool Source # max :: Event -> Event -> Event Source # min :: Event -> Event -> Event Source #
type Rep Event |

Instance details

Defined in Data.XML.Types

type Rep Event = D1 ('MetaData "Event" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (((C1 ('MetaCons "EventBeginDocument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventEndDocument" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EventBeginDoctype" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ExternalID))) :+: (C1 ('MetaCons "EventEndDoctype" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction))))) :+: ((C1 ('MetaCons "EventBeginElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Name, [Content])])) :+: C1 ('MetaCons "EventEndElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name))) :+: (C1 ('MetaCons "EventContent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Content)) :+: (C1 ('MetaCons "EventComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "EventCDATA" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))))

type ConduitM = ConduitT Source #

Same as `ConduitT`, for backwards compat

data Void Source #

Uninhabited data type

Since: base-4.8.0.0

#### Instances

Instances details

Semigroup Void | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Base Methods (<>) :: Void -> Void -> Void Source # sconcat :: NonEmpty Void -> Void Source # stimes :: Integral b => b -> Void -> Void Source #
Exception Void | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Exception.Type Methods toException :: Void -> SomeException Source # fromException :: SomeException -> Maybe Void Source # displayException :: Void -> String Source # backtraceDesired :: Void -> Bool Source #
Generic Void |

Instance details

Defined in GHC.Internal.Generics

Associated Types

type Rep Void | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Generics type Rep Void = D1 ('MetaData "Void" "GHC.Internal.Base" "ghc-internal" 'False) (V1 :: Type -> Type)

Methods

from :: Void -> Rep Void x Source #

to :: Rep Void x -> Void Source #

Read Void | Reading a `Void` value is always a parse error, considering `Void` as a data type with no constructors. Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Read Methods readsPrec :: Int -> ReadS Void Source # readList :: ReadS [Void] Source # readPrec :: ReadPrec Void Source # readListPrec :: ReadPrec [Void] Source #
Show Void | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Show Methods showsPrec :: Int -> Void -> ShowS Source # show :: Void -> String Source # showList :: [Void] -> ShowS Source #
Eq Void | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Base Methods (==) :: Void -> Void -> Bool Source # (/=) :: Void -> Void -> Bool Source #
Ord Void | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Base Methods compare :: Void -> Void -> Ordering Source # (<) :: Void -> Void -> Bool Source # (<=) :: Void -> Void -> Bool Source # (>) :: Void -> Void -> Bool Source # (>=) :: Void -> Void -> Bool Source # max :: Void -> Void -> Void Source # min :: Void -> Void -> Void Source #
Hashable Void |
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Void -> Int hash :: Void -> Int
type Rep Void | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Generics type Rep Void = D1 ('MetaData "Void" "GHC.Internal.Base" "ghc-internal" 'False) (V1 :: Type -> Type)

type Sink i = ConduitT i Void Source #

Consumes a stream of input values and produces a final result, without producing any output.

    type Sink i m r = ConduitT i Void m r

Since 0.5.0