{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__
{-# LANGUAGE DeriveDataTypeable #-}
#if MIN_VERSION_base(4,4,0)
{-# LANGUAGE DeriveGeneric #-}
#endif
#endif
module Data.XML.Types
(
Document (..)
, Prologue (..)
, Instruction (..)
, Miscellaneous (..)
, Node (..)
, Element (..)
, Content (..)
, Name (..)
, Doctype (..)
, ExternalID (..)
, Event (..)
, isElement
, isInstruction
, isContent
, isComment
, isNamed
, elementChildren
, elementContent
, elementText
, nodeChildren
, nodeContent
, nodeText
, hasAttribute
, hasAttributeText
, attributeContent
, attributeText
) where
import Control.Monad ((>=>))
import Data.Function (on)
import Data.Maybe (isJust)
import Data.String (IsString, fromString)
import Data.Text (Text)
import qualified Data.Text as T
import Control.DeepSeq (NFData(rnf))
#if __GLASGOW_HASKELL__
import Data.Typeable (Typeable)
import Data.Data (Data)
#if MIN_VERSION_base(4,4,0)
import GHC.Generics (Generic)
#endif
#endif
data Document = Document
{ Document -> Prologue
documentPrologue :: Prologue
, Document -> Element
documentRoot :: Element
, Document -> [Miscellaneous]
documentEpilogue :: [Miscellaneous]
}
deriving (Document -> Document -> Bool
(Document -> Document -> Bool)
-> (Document -> Document -> Bool) -> Eq Document
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Document -> Document -> Bool
$c/= :: Document -> Document -> Bool
== :: Document -> Document -> Bool
$c== :: Document -> Document -> Bool
Eq, Eq Document
Eq Document
-> (Document -> Document -> Ordering)
-> (Document -> Document -> Bool)
-> (Document -> Document -> Bool)
-> (Document -> Document -> Bool)
-> (Document -> Document -> Bool)
-> (Document -> Document -> Document)
-> (Document -> Document -> Document)
-> Ord Document
Document -> Document -> Bool
Document -> Document -> Ordering
Document -> Document -> Document
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Document -> Document -> Document
$cmin :: Document -> Document -> Document
max :: Document -> Document -> Document
$cmax :: Document -> Document -> Document
>= :: Document -> Document -> Bool
$c>= :: Document -> Document -> Bool
> :: Document -> Document -> Bool
$c> :: Document -> Document -> Bool
<= :: Document -> Document -> Bool
$c<= :: Document -> Document -> Bool
< :: Document -> Document -> Bool
$c< :: Document -> Document -> Bool
compare :: Document -> Document -> Ordering
$ccompare :: Document -> Document -> Ordering
$cp1Ord :: Eq Document
Ord, Int -> Document -> ShowS
[Document] -> ShowS
Document -> String
(Int -> Document -> ShowS)
-> (Document -> String) -> ([Document] -> ShowS) -> Show Document
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Document] -> ShowS
$cshowList :: [Document] -> ShowS
show :: Document -> String
$cshow :: Document -> String
showsPrec :: Int -> Document -> ShowS
$cshowsPrec :: Int -> Document -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable Document
DataType
Constr
Typeable Document
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Document -> c Document)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Document)
-> (Document -> Constr)
-> (Document -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Document))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Document))
-> ((forall b. Data b => b -> b) -> Document -> Document)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r)
-> (forall u. (forall d. Data d => d -> u) -> Document -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Document -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Document -> m Document)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Document -> m Document)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Document -> m Document)
-> Data Document
Document -> DataType
Document -> Constr
(forall b. Data b => b -> b) -> Document -> Document
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Document -> c Document
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Document
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Document -> u
forall u. (forall d. Data d => d -> u) -> Document -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Document -> m Document
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Document -> m Document
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Document
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Document -> c Document
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Document)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Document)
$cDocument :: Constr
$tDocument :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Document -> m Document
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Document -> m Document
gmapMp :: (forall d. Data d => d -> m d) -> Document -> m Document
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Document -> m Document
gmapM :: (forall d. Data d => d -> m d) -> Document -> m Document
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Document -> m Document
gmapQi :: Int -> (forall d. Data d => d -> u) -> Document -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Document -> u
gmapQ :: (forall d. Data d => d -> u) -> Document -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Document -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Document -> r
gmapT :: (forall b. Data b => b -> b) -> Document -> Document
$cgmapT :: (forall b. Data b => b -> b) -> Document -> Document
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Document)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Document)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Document)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Document)
dataTypeOf :: Document -> DataType
$cdataTypeOf :: Document -> DataType
toConstr :: Document -> Constr
$ctoConstr :: Document -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Document
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Document
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Document -> c Document
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Document -> c Document
$cp1Data :: Typeable Document
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Document -> Rep Document x)
-> (forall x. Rep Document x -> Document) -> Generic Document
forall x. Rep Document x -> Document
forall x. Document -> Rep Document x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Document x -> Document
$cfrom :: forall x. Document -> Rep Document x
Generic
#endif
#endif
)
instance NFData Document where
rnf :: Document -> ()
rnf (Document Prologue
a Element
b [Miscellaneous]
c) = Prologue -> ()
forall a. NFData a => a -> ()
rnf Prologue
a () -> () -> ()
`seq` Element -> ()
forall a. NFData a => a -> ()
rnf Element
b () -> () -> ()
`seq` [Miscellaneous] -> ()
forall a. NFData a => a -> ()
rnf [Miscellaneous]
c () -> () -> ()
`seq` ()
data Prologue = Prologue
{ Prologue -> [Miscellaneous]
prologueBefore :: [Miscellaneous]
, Prologue -> Maybe Doctype
prologueDoctype :: Maybe Doctype
, Prologue -> [Miscellaneous]
prologueAfter :: [Miscellaneous]
}
deriving (Prologue -> Prologue -> Bool
(Prologue -> Prologue -> Bool)
-> (Prologue -> Prologue -> Bool) -> Eq Prologue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Prologue -> Prologue -> Bool
$c/= :: Prologue -> Prologue -> Bool
== :: Prologue -> Prologue -> Bool
$c== :: Prologue -> Prologue -> Bool
Eq, Eq Prologue
Eq Prologue
-> (Prologue -> Prologue -> Ordering)
-> (Prologue -> Prologue -> Bool)
-> (Prologue -> Prologue -> Bool)
-> (Prologue -> Prologue -> Bool)
-> (Prologue -> Prologue -> Bool)
-> (Prologue -> Prologue -> Prologue)
-> (Prologue -> Prologue -> Prologue)
-> Ord Prologue
Prologue -> Prologue -> Bool
Prologue -> Prologue -> Ordering
Prologue -> Prologue -> Prologue
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Prologue -> Prologue -> Prologue
$cmin :: Prologue -> Prologue -> Prologue
max :: Prologue -> Prologue -> Prologue
$cmax :: Prologue -> Prologue -> Prologue
>= :: Prologue -> Prologue -> Bool
$c>= :: Prologue -> Prologue -> Bool
> :: Prologue -> Prologue -> Bool
$c> :: Prologue -> Prologue -> Bool
<= :: Prologue -> Prologue -> Bool
$c<= :: Prologue -> Prologue -> Bool
< :: Prologue -> Prologue -> Bool
$c< :: Prologue -> Prologue -> Bool
compare :: Prologue -> Prologue -> Ordering
$ccompare :: Prologue -> Prologue -> Ordering
$cp1Ord :: Eq Prologue
Ord, Int -> Prologue -> ShowS
[Prologue] -> ShowS
Prologue -> String
(Int -> Prologue -> ShowS)
-> (Prologue -> String) -> ([Prologue] -> ShowS) -> Show Prologue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Prologue] -> ShowS
$cshowList :: [Prologue] -> ShowS
show :: Prologue -> String
$cshow :: Prologue -> String
showsPrec :: Int -> Prologue -> ShowS
$cshowsPrec :: Int -> Prologue -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable Prologue
DataType
Constr
Typeable Prologue
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Prologue -> c Prologue)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Prologue)
-> (Prologue -> Constr)
-> (Prologue -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Prologue))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Prologue))
-> ((forall b. Data b => b -> b) -> Prologue -> Prologue)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r)
-> (forall u. (forall d. Data d => d -> u) -> Prologue -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Prologue -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue)
-> Data Prologue
Prologue -> DataType
Prologue -> Constr
(forall b. Data b => b -> b) -> Prologue -> Prologue
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Prologue -> c Prologue
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Prologue
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Prologue -> u
forall u. (forall d. Data d => d -> u) -> Prologue -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Prologue
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Prologue -> c Prologue
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Prologue)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Prologue)
$cPrologue :: Constr
$tPrologue :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Prologue -> m Prologue
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue
gmapMp :: (forall d. Data d => d -> m d) -> Prologue -> m Prologue
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue
gmapM :: (forall d. Data d => d -> m d) -> Prologue -> m Prologue
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Prologue -> m Prologue
gmapQi :: Int -> (forall d. Data d => d -> u) -> Prologue -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Prologue -> u
gmapQ :: (forall d. Data d => d -> u) -> Prologue -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Prologue -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Prologue -> r
gmapT :: (forall b. Data b => b -> b) -> Prologue -> Prologue
$cgmapT :: (forall b. Data b => b -> b) -> Prologue -> Prologue
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Prologue)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Prologue)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Prologue)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Prologue)
dataTypeOf :: Prologue -> DataType
$cdataTypeOf :: Prologue -> DataType
toConstr :: Prologue -> Constr
$ctoConstr :: Prologue -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Prologue
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Prologue
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Prologue -> c Prologue
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Prologue -> c Prologue
$cp1Data :: Typeable Prologue
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Prologue -> Rep Prologue x)
-> (forall x. Rep Prologue x -> Prologue) -> Generic Prologue
forall x. Rep Prologue x -> Prologue
forall x. Prologue -> Rep Prologue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Prologue x -> Prologue
$cfrom :: forall x. Prologue -> Rep Prologue x
Generic
#endif
#endif
)
instance NFData Prologue where
rnf :: Prologue -> ()
rnf (Prologue [Miscellaneous]
a Maybe Doctype
b [Miscellaneous]
c) = [Miscellaneous] -> ()
forall a. NFData a => a -> ()
rnf [Miscellaneous]
a () -> () -> ()
`seq` Maybe Doctype -> ()
forall a. NFData a => a -> ()
rnf Maybe Doctype
b () -> () -> ()
`seq` [Miscellaneous] -> ()
forall a. NFData a => a -> ()
rnf [Miscellaneous]
c () -> () -> ()
`seq` ()
data Instruction = Instruction
{ Instruction -> Text
instructionTarget :: Text
, Instruction -> Text
instructionData :: Text
}
deriving (Instruction -> Instruction -> Bool
(Instruction -> Instruction -> Bool)
-> (Instruction -> Instruction -> Bool) -> Eq Instruction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Instruction -> Instruction -> Bool
$c/= :: Instruction -> Instruction -> Bool
== :: Instruction -> Instruction -> Bool
$c== :: Instruction -> Instruction -> Bool
Eq, Eq Instruction
Eq Instruction
-> (Instruction -> Instruction -> Ordering)
-> (Instruction -> Instruction -> Bool)
-> (Instruction -> Instruction -> Bool)
-> (Instruction -> Instruction -> Bool)
-> (Instruction -> Instruction -> Bool)
-> (Instruction -> Instruction -> Instruction)
-> (Instruction -> Instruction -> Instruction)
-> Ord Instruction
Instruction -> Instruction -> Bool
Instruction -> Instruction -> Ordering
Instruction -> Instruction -> Instruction
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Instruction -> Instruction -> Instruction
$cmin :: Instruction -> Instruction -> Instruction
max :: Instruction -> Instruction -> Instruction
$cmax :: Instruction -> Instruction -> Instruction
>= :: Instruction -> Instruction -> Bool
$c>= :: Instruction -> Instruction -> Bool
> :: Instruction -> Instruction -> Bool
$c> :: Instruction -> Instruction -> Bool
<= :: Instruction -> Instruction -> Bool
$c<= :: Instruction -> Instruction -> Bool
< :: Instruction -> Instruction -> Bool
$c< :: Instruction -> Instruction -> Bool
compare :: Instruction -> Instruction -> Ordering
$ccompare :: Instruction -> Instruction -> Ordering
$cp1Ord :: Eq Instruction
Ord, Int -> Instruction -> ShowS
[Instruction] -> ShowS
Instruction -> String
(Int -> Instruction -> ShowS)
-> (Instruction -> String)
-> ([Instruction] -> ShowS)
-> Show Instruction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Instruction] -> ShowS
$cshowList :: [Instruction] -> ShowS
show :: Instruction -> String
$cshow :: Instruction -> String
showsPrec :: Int -> Instruction -> ShowS
$cshowsPrec :: Int -> Instruction -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable Instruction
DataType
Constr
Typeable Instruction
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Instruction -> c Instruction)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Instruction)
-> (Instruction -> Constr)
-> (Instruction -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Instruction))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Instruction))
-> ((forall b. Data b => b -> b) -> Instruction -> Instruction)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r)
-> (forall u. (forall d. Data d => d -> u) -> Instruction -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> Instruction -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction)
-> Data Instruction
Instruction -> DataType
Instruction -> Constr
(forall b. Data b => b -> b) -> Instruction -> Instruction
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Instruction -> c Instruction
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Instruction
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Instruction -> u
forall u. (forall d. Data d => d -> u) -> Instruction -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Instruction
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Instruction -> c Instruction
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Instruction)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Instruction)
$cInstruction :: Constr
$tInstruction :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Instruction -> m Instruction
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction
gmapMp :: (forall d. Data d => d -> m d) -> Instruction -> m Instruction
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction
gmapM :: (forall d. Data d => d -> m d) -> Instruction -> m Instruction
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Instruction -> m Instruction
gmapQi :: Int -> (forall d. Data d => d -> u) -> Instruction -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Instruction -> u
gmapQ :: (forall d. Data d => d -> u) -> Instruction -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Instruction -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Instruction -> r
gmapT :: (forall b. Data b => b -> b) -> Instruction -> Instruction
$cgmapT :: (forall b. Data b => b -> b) -> Instruction -> Instruction
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Instruction)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Instruction)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Instruction)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Instruction)
dataTypeOf :: Instruction -> DataType
$cdataTypeOf :: Instruction -> DataType
toConstr :: Instruction -> Constr
$ctoConstr :: Instruction -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Instruction
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Instruction
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Instruction -> c Instruction
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Instruction -> c Instruction
$cp1Data :: Typeable Instruction
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Instruction -> Rep Instruction x)
-> (forall x. Rep Instruction x -> Instruction)
-> Generic Instruction
forall x. Rep Instruction x -> Instruction
forall x. Instruction -> Rep Instruction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Instruction x -> Instruction
$cfrom :: forall x. Instruction -> Rep Instruction x
Generic
#endif
#endif
)
instance NFData Instruction where
rnf :: Instruction -> ()
rnf (Instruction Text
a Text
b) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` Text -> ()
forall a. NFData a => a -> ()
rnf Text
b () -> () -> ()
`seq` ()
data Miscellaneous
= MiscInstruction Instruction
| Text
deriving (Miscellaneous -> Miscellaneous -> Bool
(Miscellaneous -> Miscellaneous -> Bool)
-> (Miscellaneous -> Miscellaneous -> Bool) -> Eq Miscellaneous
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Miscellaneous -> Miscellaneous -> Bool
$c/= :: Miscellaneous -> Miscellaneous -> Bool
== :: Miscellaneous -> Miscellaneous -> Bool
$c== :: Miscellaneous -> Miscellaneous -> Bool
Eq, Eq Miscellaneous
Eq Miscellaneous
-> (Miscellaneous -> Miscellaneous -> Ordering)
-> (Miscellaneous -> Miscellaneous -> Bool)
-> (Miscellaneous -> Miscellaneous -> Bool)
-> (Miscellaneous -> Miscellaneous -> Bool)
-> (Miscellaneous -> Miscellaneous -> Bool)
-> (Miscellaneous -> Miscellaneous -> Miscellaneous)
-> (Miscellaneous -> Miscellaneous -> Miscellaneous)
-> Ord Miscellaneous
Miscellaneous -> Miscellaneous -> Bool
Miscellaneous -> Miscellaneous -> Ordering
Miscellaneous -> Miscellaneous -> Miscellaneous
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Miscellaneous -> Miscellaneous -> Miscellaneous
$cmin :: Miscellaneous -> Miscellaneous -> Miscellaneous
max :: Miscellaneous -> Miscellaneous -> Miscellaneous
$cmax :: Miscellaneous -> Miscellaneous -> Miscellaneous
>= :: Miscellaneous -> Miscellaneous -> Bool
$c>= :: Miscellaneous -> Miscellaneous -> Bool
> :: Miscellaneous -> Miscellaneous -> Bool
$c> :: Miscellaneous -> Miscellaneous -> Bool
<= :: Miscellaneous -> Miscellaneous -> Bool
$c<= :: Miscellaneous -> Miscellaneous -> Bool
< :: Miscellaneous -> Miscellaneous -> Bool
$c< :: Miscellaneous -> Miscellaneous -> Bool
compare :: Miscellaneous -> Miscellaneous -> Ordering
$ccompare :: Miscellaneous -> Miscellaneous -> Ordering
$cp1Ord :: Eq Miscellaneous
Ord, Int -> Miscellaneous -> ShowS
[Miscellaneous] -> ShowS
Miscellaneous -> String
(Int -> Miscellaneous -> ShowS)
-> (Miscellaneous -> String)
-> ([Miscellaneous] -> ShowS)
-> Show Miscellaneous
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Miscellaneous] -> ShowS
$cshowList :: [Miscellaneous] -> ShowS
show :: Miscellaneous -> String
$cshow :: Miscellaneous -> String
showsPrec :: Int -> Miscellaneous -> ShowS
$cshowsPrec :: Int -> Miscellaneous -> ShowS
Show
#if __GLASGOW_HASKELL__
, , Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Miscellaneous -> Rep Miscellaneous x)
-> (forall x. Rep Miscellaneous x -> Miscellaneous)
-> Generic Miscellaneous
forall x. Rep Miscellaneous x -> Miscellaneous
forall x. Miscellaneous -> Rep Miscellaneous x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Miscellaneous x -> Miscellaneous
$cfrom :: forall x. Miscellaneous -> Rep Miscellaneous x
Generic
#endif
#endif
)
instance NFData Miscellaneous where
rnf :: Miscellaneous -> ()
rnf (MiscInstruction Instruction
a) = Instruction -> ()
forall a. NFData a => a -> ()
rnf Instruction
a () -> () -> ()
`seq` ()
rnf (MiscComment Text
a) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` ()
data Node
= NodeElement Element
| NodeInstruction Instruction
| NodeContent Content
| Text
deriving (Node -> Node -> Bool
(Node -> Node -> Bool) -> (Node -> Node -> Bool) -> Eq Node
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Node -> Node -> Bool
$c/= :: Node -> Node -> Bool
== :: Node -> Node -> Bool
$c== :: Node -> Node -> Bool
Eq, Eq Node
Eq Node
-> (Node -> Node -> Ordering)
-> (Node -> Node -> Bool)
-> (Node -> Node -> Bool)
-> (Node -> Node -> Bool)
-> (Node -> Node -> Bool)
-> (Node -> Node -> Node)
-> (Node -> Node -> Node)
-> Ord Node
Node -> Node -> Bool
Node -> Node -> Ordering
Node -> Node -> Node
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Node -> Node -> Node
$cmin :: Node -> Node -> Node
max :: Node -> Node -> Node
$cmax :: Node -> Node -> Node
>= :: Node -> Node -> Bool
$c>= :: Node -> Node -> Bool
> :: Node -> Node -> Bool
$c> :: Node -> Node -> Bool
<= :: Node -> Node -> Bool
$c<= :: Node -> Node -> Bool
< :: Node -> Node -> Bool
$c< :: Node -> Node -> Bool
compare :: Node -> Node -> Ordering
$ccompare :: Node -> Node -> Ordering
$cp1Ord :: Eq Node
Ord, Int -> Node -> ShowS
[Node] -> ShowS
Node -> String
(Int -> Node -> ShowS)
-> (Node -> String) -> ([Node] -> ShowS) -> Show Node
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Node] -> ShowS
$cshowList :: [Node] -> ShowS
show :: Node -> String
$cshow :: Node -> String
showsPrec :: Int -> Node -> ShowS
$cshowsPrec :: Int -> Node -> ShowS
Show
#if __GLASGOW_HASKELL__
, , Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Node -> Rep Node x)
-> (forall x. Rep Node x -> Node) -> Generic Node
forall x. Rep Node x -> Node
forall x. Node -> Rep Node x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Node x -> Node
$cfrom :: forall x. Node -> Rep Node x
Generic
#endif
#endif
)
instance NFData Node where
rnf :: Node -> ()
rnf (NodeElement Element
a) = Element -> ()
forall a. NFData a => a -> ()
rnf Element
a () -> () -> ()
`seq` ()
rnf (NodeInstruction Instruction
a) = Instruction -> ()
forall a. NFData a => a -> ()
rnf Instruction
a () -> () -> ()
`seq` ()
rnf (NodeContent Content
a) = Content -> ()
forall a. NFData a => a -> ()
rnf Content
a () -> () -> ()
`seq` ()
rnf (NodeComment Text
a) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` ()
instance IsString Node where
fromString :: String -> Node
fromString = Content -> Node
NodeContent (Content -> Node) -> (String -> Content) -> String -> Node
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Content
forall a. IsString a => String -> a
fromString
data Element = Element
{ Element -> Name
elementName :: Name
, Element -> [(Name, [Content])]
elementAttributes :: [(Name, [Content])]
, Element -> [Node]
elementNodes :: [Node]
}
deriving (Element -> Element -> Bool
(Element -> Element -> Bool)
-> (Element -> Element -> Bool) -> Eq Element
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Element -> Element -> Bool
$c/= :: Element -> Element -> Bool
== :: Element -> Element -> Bool
$c== :: Element -> Element -> Bool
Eq, Eq Element
Eq Element
-> (Element -> Element -> Ordering)
-> (Element -> Element -> Bool)
-> (Element -> Element -> Bool)
-> (Element -> Element -> Bool)
-> (Element -> Element -> Bool)
-> (Element -> Element -> Element)
-> (Element -> Element -> Element)
-> Ord Element
Element -> Element -> Bool
Element -> Element -> Ordering
Element -> Element -> Element
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Element -> Element -> Element
$cmin :: Element -> Element -> Element
max :: Element -> Element -> Element
$cmax :: Element -> Element -> Element
>= :: Element -> Element -> Bool
$c>= :: Element -> Element -> Bool
> :: Element -> Element -> Bool
$c> :: Element -> Element -> Bool
<= :: Element -> Element -> Bool
$c<= :: Element -> Element -> Bool
< :: Element -> Element -> Bool
$c< :: Element -> Element -> Bool
compare :: Element -> Element -> Ordering
$ccompare :: Element -> Element -> Ordering
$cp1Ord :: Eq Element
Ord, Int -> Element -> ShowS
[Element] -> ShowS
Element -> String
(Int -> Element -> ShowS)
-> (Element -> String) -> ([Element] -> ShowS) -> Show Element
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Element] -> ShowS
$cshowList :: [Element] -> ShowS
show :: Element -> String
$cshow :: Element -> String
showsPrec :: Int -> Element -> ShowS
$cshowsPrec :: Int -> Element -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable Element
DataType
Constr
Typeable Element
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Element -> c Element)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Element)
-> (Element -> Constr)
-> (Element -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Element))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Element))
-> ((forall b. Data b => b -> b) -> Element -> Element)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r)
-> (forall u. (forall d. Data d => d -> u) -> Element -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Element -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Element -> m Element)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Element -> m Element)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Element -> m Element)
-> Data Element
Element -> DataType
Element -> Constr
(forall b. Data b => b -> b) -> Element -> Element
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Element -> c Element
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Element
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Element -> u
forall u. (forall d. Data d => d -> u) -> Element -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Element -> m Element
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Element -> m Element
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Element
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Element -> c Element
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Element)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Element)
$cElement :: Constr
$tElement :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Element -> m Element
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Element -> m Element
gmapMp :: (forall d. Data d => d -> m d) -> Element -> m Element
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Element -> m Element
gmapM :: (forall d. Data d => d -> m d) -> Element -> m Element
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Element -> m Element
gmapQi :: Int -> (forall d. Data d => d -> u) -> Element -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Element -> u
gmapQ :: (forall d. Data d => d -> u) -> Element -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Element -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Element -> r
gmapT :: (forall b. Data b => b -> b) -> Element -> Element
$cgmapT :: (forall b. Data b => b -> b) -> Element -> Element
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Element)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Element)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Element)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Element)
dataTypeOf :: Element -> DataType
$cdataTypeOf :: Element -> DataType
toConstr :: Element -> Constr
$ctoConstr :: Element -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Element
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Element
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Element -> c Element
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Element -> c Element
$cp1Data :: Typeable Element
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Element -> Rep Element x)
-> (forall x. Rep Element x -> Element) -> Generic Element
forall x. Rep Element x -> Element
forall x. Element -> Rep Element x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Element x -> Element
$cfrom :: forall x. Element -> Rep Element x
Generic
#endif
#endif
)
instance NFData Element where
rnf :: Element -> ()
rnf (Element Name
a [(Name, [Content])]
b [Node]
c) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [(Name, [Content])] -> ()
forall a. NFData a => a -> ()
rnf [(Name, [Content])]
b () -> () -> ()
`seq` [Node] -> ()
forall a. NFData a => a -> ()
rnf [Node]
c () -> () -> ()
`seq` ()
data Content
= ContentText Text
| ContentEntity Text
deriving (Content -> Content -> Bool
(Content -> Content -> Bool)
-> (Content -> Content -> Bool) -> Eq Content
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Content -> Content -> Bool
$c/= :: Content -> Content -> Bool
== :: Content -> Content -> Bool
$c== :: Content -> Content -> Bool
Eq, Eq Content
Eq Content
-> (Content -> Content -> Ordering)
-> (Content -> Content -> Bool)
-> (Content -> Content -> Bool)
-> (Content -> Content -> Bool)
-> (Content -> Content -> Bool)
-> (Content -> Content -> Content)
-> (Content -> Content -> Content)
-> Ord Content
Content -> Content -> Bool
Content -> Content -> Ordering
Content -> Content -> Content
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Content -> Content -> Content
$cmin :: Content -> Content -> Content
max :: Content -> Content -> Content
$cmax :: Content -> Content -> Content
>= :: Content -> Content -> Bool
$c>= :: Content -> Content -> Bool
> :: Content -> Content -> Bool
$c> :: Content -> Content -> Bool
<= :: Content -> Content -> Bool
$c<= :: Content -> Content -> Bool
< :: Content -> Content -> Bool
$c< :: Content -> Content -> Bool
compare :: Content -> Content -> Ordering
$ccompare :: Content -> Content -> Ordering
$cp1Ord :: Eq Content
Ord, Int -> Content -> ShowS
[Content] -> ShowS
Content -> String
(Int -> Content -> ShowS)
-> (Content -> String) -> ([Content] -> ShowS) -> Show Content
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Content] -> ShowS
$cshowList :: [Content] -> ShowS
show :: Content -> String
$cshow :: Content -> String
showsPrec :: Int -> Content -> ShowS
$cshowsPrec :: Int -> Content -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable Content
DataType
Constr
Typeable Content
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Content -> c Content)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Content)
-> (Content -> Constr)
-> (Content -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Content))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Content))
-> ((forall b. Data b => b -> b) -> Content -> Content)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r)
-> (forall u. (forall d. Data d => d -> u) -> Content -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Content -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Content -> m Content)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Content -> m Content)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Content -> m Content)
-> Data Content
Content -> DataType
Content -> Constr
(forall b. Data b => b -> b) -> Content -> Content
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Content -> c Content
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Content
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Content -> u
forall u. (forall d. Data d => d -> u) -> Content -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Content -> m Content
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Content -> m Content
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Content
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Content -> c Content
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Content)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Content)
$cContentEntity :: Constr
$cContentText :: Constr
$tContent :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Content -> m Content
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Content -> m Content
gmapMp :: (forall d. Data d => d -> m d) -> Content -> m Content
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Content -> m Content
gmapM :: (forall d. Data d => d -> m d) -> Content -> m Content
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Content -> m Content
gmapQi :: Int -> (forall d. Data d => d -> u) -> Content -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Content -> u
gmapQ :: (forall d. Data d => d -> u) -> Content -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Content -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Content -> r
gmapT :: (forall b. Data b => b -> b) -> Content -> Content
$cgmapT :: (forall b. Data b => b -> b) -> Content -> Content
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Content)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Content)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Content)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Content)
dataTypeOf :: Content -> DataType
$cdataTypeOf :: Content -> DataType
toConstr :: Content -> Constr
$ctoConstr :: Content -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Content
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Content
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Content -> c Content
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Content -> c Content
$cp1Data :: Typeable Content
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Content -> Rep Content x)
-> (forall x. Rep Content x -> Content) -> Generic Content
forall x. Rep Content x -> Content
forall x. Content -> Rep Content x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Content x -> Content
$cfrom :: forall x. Content -> Rep Content x
Generic
#endif
#endif
)
instance NFData Content where
rnf :: Content -> ()
rnf (ContentText Text
a) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` ()
rnf (ContentEntity Text
a) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` ()
instance IsString Content where
fromString :: String -> Content
fromString = Text -> Content
ContentText (Text -> Content) -> (String -> Text) -> String -> Content
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
forall a. IsString a => String -> a
fromString
data Name = Name
{ Name -> Text
nameLocalName :: Text
, Name -> Maybe Text
nameNamespace :: Maybe Text
, Name -> Maybe Text
namePrefix :: Maybe Text
}
deriving (Int -> Name -> ShowS
[Name] -> ShowS
Name -> String
(Int -> Name -> ShowS)
-> (Name -> String) -> ([Name] -> ShowS) -> Show Name
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Name] -> ShowS
$cshowList :: [Name] -> ShowS
show :: Name -> String
$cshow :: Name -> String
showsPrec :: Int -> Name -> ShowS
$cshowsPrec :: Int -> Name -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable Name
DataType
Constr
Typeable Name
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name)
-> (Name -> Constr)
-> (Name -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Name))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name))
-> ((forall b. Data b => b -> b) -> Name -> Name)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r)
-> (forall u. (forall d. Data d => d -> u) -> Name -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Name -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Name -> m Name)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name)
-> Data Name
Name -> DataType
Name -> Constr
(forall b. Data b => b -> b) -> Name -> Name
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Name -> u
forall u. (forall d. Data d => d -> u) -> Name -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Name -> m Name
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Name)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name)
$cName :: Constr
$tName :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Name -> m Name
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
gmapMp :: (forall d. Data d => d -> m d) -> Name -> m Name
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
gmapM :: (forall d. Data d => d -> m d) -> Name -> m Name
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Name -> m Name
gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Name -> u
gmapQ :: (forall d. Data d => d -> u) -> Name -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Name -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
gmapT :: (forall b. Data b => b -> b) -> Name -> Name
$cgmapT :: (forall b. Data b => b -> b) -> Name -> Name
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Name)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Name)
dataTypeOf :: Name -> DataType
$cdataTypeOf :: Name -> DataType
toConstr :: Name -> Constr
$ctoConstr :: Name -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name
$cp1Data :: Typeable Name
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Name -> Rep Name x)
-> (forall x. Rep Name x -> Name) -> Generic Name
forall x. Rep Name x -> Name
forall x. Name -> Rep Name x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Name x -> Name
$cfrom :: forall x. Name -> Rep Name x
Generic
#endif
#endif
)
instance Eq Name where
== :: Name -> Name -> Bool
(==) = (Maybe Text, Text) -> (Maybe Text, Text) -> Bool
forall a. Eq a => a -> a -> Bool
(==) ((Maybe Text, Text) -> (Maybe Text, Text) -> Bool)
-> (Name -> (Maybe Text, Text)) -> Name -> Name -> Bool
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` (\Name
x -> (Name -> Maybe Text
nameNamespace Name
x, Name -> Text
nameLocalName Name
x))
instance Ord Name where
compare :: Name -> Name -> Ordering
compare = (Maybe Text, Text) -> (Maybe Text, Text) -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ((Maybe Text, Text) -> (Maybe Text, Text) -> Ordering)
-> (Name -> (Maybe Text, Text)) -> Name -> Name -> Ordering
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` (\Name
x -> (Name -> Maybe Text
nameNamespace Name
x, Name -> Text
nameLocalName Name
x))
instance IsString Name where
fromString :: String -> Name
fromString String
"" = Text -> Maybe Text -> Maybe Text -> Name
Name Text
T.empty Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing
fromString full :: String
full@(Char
'{':String
rest) = case (Char -> Bool) -> String -> (String, String)
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'}') String
rest of
(String
_, String
"") -> String -> Name
forall a. HasCallStack => String -> a
error (String
"Invalid Clark notation: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ ShowS
forall a. Show a => a -> String
show String
full)
(String
ns, String
local) -> Text -> Maybe Text -> Maybe Text -> Name
Name (String -> Text
T.pack (Int -> ShowS
forall a. Int -> [a] -> [a]
drop Int
1 String
local)) (Text -> Maybe Text
forall a. a -> Maybe a
Just (String -> Text
T.pack String
ns)) Maybe Text
forall a. Maybe a
Nothing
fromString String
local = Text -> Maybe Text -> Maybe Text -> Name
Name (String -> Text
T.pack String
local) Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing
instance NFData Name where
rnf :: Name -> ()
rnf (Name Text
a Maybe Text
b Maybe Text
c) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` Maybe Text -> ()
forall a. NFData a => a -> ()
rnf Maybe Text
b () -> () -> ()
`seq` Maybe Text -> ()
forall a. NFData a => a -> ()
rnf Maybe Text
c () -> () -> ()
`seq` ()
data Doctype = Doctype
{ Doctype -> Text
doctypeName :: Text
, Doctype -> Maybe ExternalID
doctypeID :: Maybe ExternalID
}
deriving (Doctype -> Doctype -> Bool
(Doctype -> Doctype -> Bool)
-> (Doctype -> Doctype -> Bool) -> Eq Doctype
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Doctype -> Doctype -> Bool
$c/= :: Doctype -> Doctype -> Bool
== :: Doctype -> Doctype -> Bool
$c== :: Doctype -> Doctype -> Bool
Eq, Eq Doctype
Eq Doctype
-> (Doctype -> Doctype -> Ordering)
-> (Doctype -> Doctype -> Bool)
-> (Doctype -> Doctype -> Bool)
-> (Doctype -> Doctype -> Bool)
-> (Doctype -> Doctype -> Bool)
-> (Doctype -> Doctype -> Doctype)
-> (Doctype -> Doctype -> Doctype)
-> Ord Doctype
Doctype -> Doctype -> Bool
Doctype -> Doctype -> Ordering
Doctype -> Doctype -> Doctype
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Doctype -> Doctype -> Doctype
$cmin :: Doctype -> Doctype -> Doctype
max :: Doctype -> Doctype -> Doctype
$cmax :: Doctype -> Doctype -> Doctype
>= :: Doctype -> Doctype -> Bool
$c>= :: Doctype -> Doctype -> Bool
> :: Doctype -> Doctype -> Bool
$c> :: Doctype -> Doctype -> Bool
<= :: Doctype -> Doctype -> Bool
$c<= :: Doctype -> Doctype -> Bool
< :: Doctype -> Doctype -> Bool
$c< :: Doctype -> Doctype -> Bool
compare :: Doctype -> Doctype -> Ordering
$ccompare :: Doctype -> Doctype -> Ordering
$cp1Ord :: Eq Doctype
Ord, Int -> Doctype -> ShowS
[Doctype] -> ShowS
Doctype -> String
(Int -> Doctype -> ShowS)
-> (Doctype -> String) -> ([Doctype] -> ShowS) -> Show Doctype
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Doctype] -> ShowS
$cshowList :: [Doctype] -> ShowS
show :: Doctype -> String
$cshow :: Doctype -> String
showsPrec :: Int -> Doctype -> ShowS
$cshowsPrec :: Int -> Doctype -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable Doctype
DataType
Constr
Typeable Doctype
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Doctype -> c Doctype)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Doctype)
-> (Doctype -> Constr)
-> (Doctype -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Doctype))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Doctype))
-> ((forall b. Data b => b -> b) -> Doctype -> Doctype)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r)
-> (forall u. (forall d. Data d => d -> u) -> Doctype -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Doctype -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype)
-> Data Doctype
Doctype -> DataType
Doctype -> Constr
(forall b. Data b => b -> b) -> Doctype -> Doctype
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Doctype -> c Doctype
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Doctype
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Doctype -> u
forall u. (forall d. Data d => d -> u) -> Doctype -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Doctype
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Doctype -> c Doctype
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Doctype)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Doctype)
$cDoctype :: Constr
$tDoctype :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Doctype -> m Doctype
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype
gmapMp :: (forall d. Data d => d -> m d) -> Doctype -> m Doctype
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype
gmapM :: (forall d. Data d => d -> m d) -> Doctype -> m Doctype
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Doctype -> m Doctype
gmapQi :: Int -> (forall d. Data d => d -> u) -> Doctype -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Doctype -> u
gmapQ :: (forall d. Data d => d -> u) -> Doctype -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Doctype -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Doctype -> r
gmapT :: (forall b. Data b => b -> b) -> Doctype -> Doctype
$cgmapT :: (forall b. Data b => b -> b) -> Doctype -> Doctype
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Doctype)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Doctype)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Doctype)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Doctype)
dataTypeOf :: Doctype -> DataType
$cdataTypeOf :: Doctype -> DataType
toConstr :: Doctype -> Constr
$ctoConstr :: Doctype -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Doctype
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Doctype
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Doctype -> c Doctype
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Doctype -> c Doctype
$cp1Data :: Typeable Doctype
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Doctype -> Rep Doctype x)
-> (forall x. Rep Doctype x -> Doctype) -> Generic Doctype
forall x. Rep Doctype x -> Doctype
forall x. Doctype -> Rep Doctype x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Doctype x -> Doctype
$cfrom :: forall x. Doctype -> Rep Doctype x
Generic
#endif
#endif
)
instance NFData Doctype where
rnf :: Doctype -> ()
rnf (Doctype Text
a Maybe ExternalID
b) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` Maybe ExternalID -> ()
forall a. NFData a => a -> ()
rnf Maybe ExternalID
b () -> () -> ()
`seq` ()
data ExternalID
= SystemID Text
| PublicID Text Text
deriving (ExternalID -> ExternalID -> Bool
(ExternalID -> ExternalID -> Bool)
-> (ExternalID -> ExternalID -> Bool) -> Eq ExternalID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalID -> ExternalID -> Bool
$c/= :: ExternalID -> ExternalID -> Bool
== :: ExternalID -> ExternalID -> Bool
$c== :: ExternalID -> ExternalID -> Bool
Eq, Eq ExternalID
Eq ExternalID
-> (ExternalID -> ExternalID -> Ordering)
-> (ExternalID -> ExternalID -> Bool)
-> (ExternalID -> ExternalID -> Bool)
-> (ExternalID -> ExternalID -> Bool)
-> (ExternalID -> ExternalID -> Bool)
-> (ExternalID -> ExternalID -> ExternalID)
-> (ExternalID -> ExternalID -> ExternalID)
-> Ord ExternalID
ExternalID -> ExternalID -> Bool
ExternalID -> ExternalID -> Ordering
ExternalID -> ExternalID -> ExternalID
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ExternalID -> ExternalID -> ExternalID
$cmin :: ExternalID -> ExternalID -> ExternalID
max :: ExternalID -> ExternalID -> ExternalID
$cmax :: ExternalID -> ExternalID -> ExternalID
>= :: ExternalID -> ExternalID -> Bool
$c>= :: ExternalID -> ExternalID -> Bool
> :: ExternalID -> ExternalID -> Bool
$c> :: ExternalID -> ExternalID -> Bool
<= :: ExternalID -> ExternalID -> Bool
$c<= :: ExternalID -> ExternalID -> Bool
< :: ExternalID -> ExternalID -> Bool
$c< :: ExternalID -> ExternalID -> Bool
compare :: ExternalID -> ExternalID -> Ordering
$ccompare :: ExternalID -> ExternalID -> Ordering
$cp1Ord :: Eq ExternalID
Ord, Int -> ExternalID -> ShowS
[ExternalID] -> ShowS
ExternalID -> String
(Int -> ExternalID -> ShowS)
-> (ExternalID -> String)
-> ([ExternalID] -> ShowS)
-> Show ExternalID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExternalID] -> ShowS
$cshowList :: [ExternalID] -> ShowS
show :: ExternalID -> String
$cshow :: ExternalID -> String
showsPrec :: Int -> ExternalID -> ShowS
$cshowsPrec :: Int -> ExternalID -> ShowS
Show
#if __GLASGOW_HASKELL__
, Typeable ExternalID
DataType
Constr
Typeable ExternalID
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExternalID -> c ExternalID)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExternalID)
-> (ExternalID -> Constr)
-> (ExternalID -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ExternalID))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ExternalID))
-> ((forall b. Data b => b -> b) -> ExternalID -> ExternalID)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r)
-> (forall u. (forall d. Data d => d -> u) -> ExternalID -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> ExternalID -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID)
-> Data ExternalID
ExternalID -> DataType
ExternalID -> Constr
(forall b. Data b => b -> b) -> ExternalID -> ExternalID
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExternalID -> c ExternalID
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExternalID
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ExternalID -> u
forall u. (forall d. Data d => d -> u) -> ExternalID -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExternalID
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExternalID -> c ExternalID
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ExternalID)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExternalID)
$cPublicID :: Constr
$cSystemID :: Constr
$tExternalID :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
gmapMp :: (forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
gmapM :: (forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ExternalID -> m ExternalID
gmapQi :: Int -> (forall d. Data d => d -> u) -> ExternalID -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ExternalID -> u
gmapQ :: (forall d. Data d => d -> u) -> ExternalID -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ExternalID -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ExternalID -> r
gmapT :: (forall b. Data b => b -> b) -> ExternalID -> ExternalID
$cgmapT :: (forall b. Data b => b -> b) -> ExternalID -> ExternalID
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExternalID)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExternalID)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ExternalID)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ExternalID)
dataTypeOf :: ExternalID -> DataType
$cdataTypeOf :: ExternalID -> DataType
toConstr :: ExternalID -> Constr
$ctoConstr :: ExternalID -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExternalID
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ExternalID
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExternalID -> c ExternalID
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ExternalID -> c ExternalID
$cp1Data :: Typeable ExternalID
Data, Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. ExternalID -> Rep ExternalID x)
-> (forall x. Rep ExternalID x -> ExternalID) -> Generic ExternalID
forall x. Rep ExternalID x -> ExternalID
forall x. ExternalID -> Rep ExternalID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExternalID x -> ExternalID
$cfrom :: forall x. ExternalID -> Rep ExternalID x
Generic
#endif
#endif
)
instance NFData ExternalID where
rnf :: ExternalID -> ()
rnf (SystemID Text
a) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` ()
rnf (PublicID Text
a Text
b) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` Text -> ()
forall a. NFData a => a -> ()
rnf Text
b () -> () -> ()
`seq` ()
data Event
= EventBeginDocument
| EventEndDocument
| EventBeginDoctype Text (Maybe ExternalID)
| EventEndDoctype
| EventInstruction Instruction
| EventBeginElement Name [(Name, [Content])]
| EventEndElement Name
| EventContent Content
| Text
| EventCDATA Text
deriving (Event -> Event -> Bool
(Event -> Event -> Bool) -> (Event -> Event -> Bool) -> Eq Event
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Event -> Event -> Bool
$c/= :: Event -> Event -> Bool
== :: Event -> Event -> Bool
$c== :: Event -> Event -> Bool
Eq, Eq Event
Eq Event
-> (Event -> Event -> Ordering)
-> (Event -> Event -> Bool)
-> (Event -> Event -> Bool)
-> (Event -> Event -> Bool)
-> (Event -> Event -> Bool)
-> (Event -> Event -> Event)
-> (Event -> Event -> Event)
-> Ord Event
Event -> Event -> Bool
Event -> Event -> Ordering
Event -> Event -> Event
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Event -> Event -> Event
$cmin :: Event -> Event -> Event
max :: Event -> Event -> Event
$cmax :: Event -> Event -> Event
>= :: Event -> Event -> Bool
$c>= :: Event -> Event -> Bool
> :: Event -> Event -> Bool
$c> :: Event -> Event -> Bool
<= :: Event -> Event -> Bool
$c<= :: Event -> Event -> Bool
< :: Event -> Event -> Bool
$c< :: Event -> Event -> Bool
compare :: Event -> Event -> Ordering
$ccompare :: Event -> Event -> Ordering
$cp1Ord :: Eq Event
Ord, Int -> Event -> ShowS
[Event] -> ShowS
Event -> String
(Int -> Event -> ShowS)
-> (Event -> String) -> ([Event] -> ShowS) -> Show Event
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Event] -> ShowS
$cshowList :: [Event] -> ShowS
show :: Event -> String
$cshow :: Event -> String
showsPrec :: Int -> Event -> ShowS
$cshowsPrec :: Int -> Event -> ShowS
Show
#if __GLASGOW_HASKELL__
, , Typeable
#if MIN_VERSION_base(4,4,0)
, (forall x. Event -> Rep Event x)
-> (forall x. Rep Event x -> Event) -> Generic Event
forall x. Rep Event x -> Event
forall x. Event -> Rep Event x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Event x -> Event
$cfrom :: forall x. Event -> Rep Event x
Generic
#endif
#endif
)
instance NFData Event where
rnf :: Event -> ()
rnf (EventBeginDoctype Text
a Maybe ExternalID
b) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` Maybe ExternalID -> ()
forall a. NFData a => a -> ()
rnf Maybe ExternalID
b () -> () -> ()
`seq` ()
rnf (EventInstruction Instruction
a) = Instruction -> ()
forall a. NFData a => a -> ()
rnf Instruction
a () -> () -> ()
`seq` ()
rnf (EventBeginElement Name
a [(Name, [Content])]
b) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` [(Name, [Content])] -> ()
forall a. NFData a => a -> ()
rnf [(Name, [Content])]
b () -> () -> ()
`seq` ()
rnf (EventEndElement Name
a) = Name -> ()
forall a. NFData a => a -> ()
rnf Name
a () -> () -> ()
`seq` ()
rnf (EventContent Content
a) = Content -> ()
forall a. NFData a => a -> ()
rnf Content
a () -> () -> ()
`seq` ()
rnf (EventComment Text
a) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` ()
rnf (EventCDATA Text
a) = Text -> ()
forall a. NFData a => a -> ()
rnf Text
a () -> () -> ()
`seq` ()
rnf Event
_ = ()
isElement :: Node -> [Element]
isElement :: Node -> [Element]
isElement (NodeElement Element
e) = [Element
e]
isElement Node
_ = []
isInstruction :: Node -> [Instruction]
isInstruction :: Node -> [Instruction]
isInstruction (NodeInstruction Instruction
i) = [Instruction
i]
isInstruction Node
_ = []
isContent :: Node -> [Content]
isContent :: Node -> [Content]
isContent (NodeContent Content
c) = [Content
c]
isContent Node
_ = []
isComment :: Node -> [Text]
(NodeComment Text
t) = [Text
t]
isComment Node
_ = []
isNamed :: Name -> Element -> [Element]
isNamed :: Name -> Element -> [Element]
isNamed Name
n Element
e = [Element
e | Element -> Name
elementName Element
e Name -> Name -> Bool
forall a. Eq a => a -> a -> Bool
== Name
n]
elementChildren :: Element -> [Element]
elementChildren :: Element -> [Element]
elementChildren = Element -> [Node]
elementNodes (Element -> [Node]) -> (Node -> [Element]) -> Element -> [Element]
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Node -> [Element]
isElement
elementContent :: Element -> [Content]
elementContent :: Element -> [Content]
elementContent = Element -> [Node]
elementNodes (Element -> [Node]) -> (Node -> [Content]) -> Element -> [Content]
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Node -> [Content]
isContent
elementText :: Element -> [Text]
elementText :: Element -> [Text]
elementText = Element -> [Content]
elementContent (Element -> [Content]) -> (Content -> [Text]) -> Element -> [Text]
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Content -> [Text]
contentText
nodeChildren :: Node -> [Node]
nodeChildren :: Node -> [Node]
nodeChildren = Node -> [Element]
isElement (Node -> [Element]) -> (Element -> [Node]) -> Node -> [Node]
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Element -> [Node]
elementNodes
nodeContent :: Node -> [Content]
nodeContent :: Node -> [Content]
nodeContent = Node -> [Node]
nodeChildren (Node -> [Node]) -> (Node -> [Content]) -> Node -> [Content]
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Node -> [Content]
isContent
nodeText :: Node -> [Text]
nodeText :: Node -> [Text]
nodeText = Node -> [Content]
nodeContent (Node -> [Content]) -> (Content -> [Text]) -> Node -> [Text]
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> Content -> [Text]
contentText
hasAttribute :: Name -> Element -> [Element]
hasAttribute :: Name -> Element -> [Element]
hasAttribute Name
name Element
e = [Element
e | Maybe [Content] -> Bool
forall a. Maybe a -> Bool
isJust (Name -> Element -> Maybe [Content]
attributeContent Name
name Element
e)]
hasAttributeText :: Name -> (Text -> Bool) -> Element -> [Element]
hasAttributeText :: Name -> (Text -> Bool) -> Element -> [Element]
hasAttributeText Name
name Text -> Bool
p Element
e = [Element
e | Bool -> (Text -> Bool) -> Maybe Text -> Bool
forall b a. b -> (a -> b) -> Maybe a -> b
maybe Bool
False Text -> Bool
p (Name -> Element -> Maybe Text
attributeText Name
name Element
e)]
attributeContent :: Name -> Element -> Maybe [Content]
attributeContent :: Name -> Element -> Maybe [Content]
attributeContent Name
name Element
e = Name -> [(Name, [Content])] -> Maybe [Content]
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup Name
name (Element -> [(Name, [Content])]
elementAttributes Element
e)
attributeText :: Name -> Element -> Maybe Text
attributeText :: Name -> Element -> Maybe Text
attributeText Name
name Element
e = ([Content] -> Text) -> Maybe [Content] -> Maybe Text
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [Content] -> Text
contentFlat (Name -> Element -> Maybe [Content]
attributeContent Name
name Element
e)
contentText :: Content -> [Text]
contentText :: Content -> [Text]
contentText (ContentText Text
t) = [Text
t]
contentText (ContentEntity Text
entity) = [String -> Text
T.pack String
"&", Text
entity, String -> Text
T.pack String
";"]
contentFlat :: [Content] -> Text
contentFlat :: [Content] -> Text
contentFlat [Content]
cs = [Text] -> Text
T.concat ([Content]
cs [Content] -> (Content -> [Text]) -> [Text]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Content -> [Text]
contentText)