fadno-xml-1.2.1: XML/XSD combinators/schemas/codegen
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fadno.Xml.XParse

Description

Combinators over XML.

Synopsis

Documentation

newtype XParse a Source #

Parsing monad.

Constructors

XParse 

Fields

Instances

Instances details
Alternative XParse Source # 
Instance details

Defined in Fadno.Xml.XParse

Methods

empty :: XParse a #

(<|>) :: XParse a -> XParse a -> XParse a #

some :: XParse a -> XParse [a] #

many :: XParse a -> XParse [a] #

Applicative XParse Source # 
Instance details

Defined in Fadno.Xml.XParse

Methods

pure :: a -> XParse a #

(<*>) :: XParse (a -> b) -> XParse a -> XParse b #

liftA2 :: (a -> b -> c) -> XParse a -> XParse b -> XParse c #

(*>) :: XParse a -> XParse b -> XParse b #

(<*) :: XParse a -> XParse b -> XParse a #

Functor XParse Source # 
Instance details

Defined in Fadno.Xml.XParse

Methods

fmap :: (a -> b) -> XParse a -> XParse b #

(<$) :: a -> XParse b -> XParse a #

Monad XParse Source # 
Instance details

Defined in Fadno.Xml.XParse

Methods

(>>=) :: XParse a -> (a -> XParse b) -> XParse b #

(>>) :: XParse a -> XParse b -> XParse b #

return :: a -> XParse a #

MonadState Cursor XParse Source # 
Instance details

Defined in Fadno.Xml.XParse

Methods

get :: XParse Cursor #

put :: Cursor -> XParse () #

state :: (Cursor -> (a, Cursor)) -> XParse a #

runXParse :: Element -> XParse a -> Either XErrors a Source #

Run monad.

xfail :: String -> XParse a Source #

Parse failure.

require :: String -> Maybe a -> XParse a Source #

Require Just a thing.

xattr :: QName -> XParse String Source #

Operate on attribute value/

xtext :: XParse String Source #

Operate on text.

xchild :: QName -> XParse a -> XParse a Source #

Consume a child element.

xread :: Read a => String -> String -> XParse a Source #

Parse with read.

xel :: XParse Element Source #

Operate on an element.

QNames

name :: String -> QName Source #

Local name.

xsName :: String -> QName Source #

XSD name.

Utility

readXml :: FilePath -> IO Element Source #

Convenience to read in top element from file.