citeproc-hs-0.3.2: A Citation Style Language implementation in HaskellSource codeContentsIndex
Text.CSL.Pickle
Portabilityportable
Stabilityunstable
MaintainerAndrea Rossato <andrea.rossato@unitn.it>
Description

This module is mostly copied from Text.XML.HXT.Arrow.Pickle.Xml which is an adaptation of the pickler combinators developed by Andrew Kennedy.

See: http://research.microsoft.com/~akenn/fun/picklercombinators.pdf

Synopsis
data St = St {
attributes :: [Attr]
contents :: [Content]
}
data PU a = PU {
appPickle :: (a, St) -> St
appUnPickle :: St -> (Maybe a, St)
}
pickleXML :: PU a -> a -> String
unpickleXML :: PU a -> [Content] -> Maybe a
emptySt :: St
addAtt :: Attr -> St -> St
addCont :: Content -> St -> St
dropCont :: St -> St
getAtt :: String -> St -> Maybe Attr
getCont :: St -> Maybe Content
class XmlPickler a where
xpickle :: PU a
xpPrim :: (Read a, Show a) => PU a
xpUnit :: PU ()
xpZero :: PU a
xpLift :: a -> PU a
xpCondSeq :: PU b -> (b -> a) -> PU a -> (a -> PU b) -> PU b
xpSeq :: (b -> a) -> PU a -> (a -> PU b) -> PU b
xpChoice :: PU b -> PU a -> (a -> PU b) -> PU b
xpWrap :: (a -> b, b -> a) -> PU a -> PU b
xpDefault :: Eq a => a -> PU a -> PU a
xpOption :: PU a -> PU (Maybe a)
xpAlt :: (a -> Int) -> [PU a] -> PU a
xpList :: PU a -> PU [a]
xpLiftMaybe :: Maybe a -> PU a
xpWrapMaybe :: (a -> Maybe b, b -> a) -> PU a -> PU b
xpPair :: PU a -> PU b -> PU (a, b)
xpTriple :: PU a -> PU b -> PU c -> PU (a, b, c)
xp4Tuple :: PU a -> PU b -> PU c -> PU d -> PU (a, b, c, d)
xp5Tuple :: PU a -> PU b -> PU c -> PU d -> PU e -> PU (a, b, c, d, e)
xp6Tuple :: PU a -> PU b -> PU c -> PU d -> PU e -> PU f -> PU (a, b, c, d, e, f)
getText :: Content -> Maybe String
getChildren :: Content -> [Content]
getElemName :: Content -> Maybe QName
getAttrl :: Content -> [Attr]
mkText :: String -> Content
mkName :: String -> QName
qualifiedName :: QName -> String
xpText :: PU String
xpText0 :: PU String
xpElem :: String -> PU a -> PU a
xpIElem :: String -> PU a -> PU a
xpAttr :: String -> PU a -> PU a
xpElemWithAttrValue :: String -> String -> String -> PU a -> PU a
xpAttrFixed :: String -> String -> PU ()
xpAddFixedAttr :: String -> String -> PU a -> PU a
uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d
uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e
uncurry5 :: (a -> b -> c -> d -> e -> f) -> (a, b, c, d, e) -> f
readXmlString :: Show a => PU a -> String -> a
readXmlFile :: Show a => PU a -> String -> IO a
getStyleVersion :: [Content] -> String
styleErr08 :: String
Documentation
data St Source
Constructors
St
attributes :: [Attr]
contents :: [Content]
data PU a Source
Constructors
PU
appPickle :: (a, St) -> St
appUnPickle :: St -> (Maybe a, St)
pickleXML :: PU a -> a -> StringSource
unpickleXML :: PU a -> [Content] -> Maybe aSource
emptySt :: StSource
addAtt :: Attr -> St -> StSource
addCont :: Content -> St -> StSource
dropCont :: St -> StSource
getAtt :: String -> St -> Maybe AttrSource
getCont :: St -> Maybe ContentSource
class XmlPickler a whereSource
Methods
xpickle :: PU aSource
show/hide Instances
xpPrim :: (Read a, Show a) => PU aSource
xpUnit :: PU ()Source
xpZero :: PU aSource
xpLift :: a -> PU aSource
xpCondSeq :: PU b -> (b -> a) -> PU a -> (a -> PU b) -> PU bSource
xpSeq :: (b -> a) -> PU a -> (a -> PU b) -> PU bSource
xpChoice :: PU b -> PU a -> (a -> PU b) -> PU bSource
xpWrap :: (a -> b, b -> a) -> PU a -> PU bSource
xpDefault :: Eq a => a -> PU a -> PU aSource
xpOption :: PU a -> PU (Maybe a)Source
xpAlt :: (a -> Int) -> [PU a] -> PU aSource
xpList :: PU a -> PU [a]Source
xpLiftMaybe :: Maybe a -> PU aSource
xpWrapMaybe :: (a -> Maybe b, b -> a) -> PU a -> PU bSource
xpPair :: PU a -> PU b -> PU (a, b)Source
xpTriple :: PU a -> PU b -> PU c -> PU (a, b, c)Source
xp4Tuple :: PU a -> PU b -> PU c -> PU d -> PU (a, b, c, d)Source
xp5Tuple :: PU a -> PU b -> PU c -> PU d -> PU e -> PU (a, b, c, d, e)Source
xp6Tuple :: PU a -> PU b -> PU c -> PU d -> PU e -> PU f -> PU (a, b, c, d, e, f)Source
getText :: Content -> Maybe StringSource
getChildren :: Content -> [Content]Source
getElemName :: Content -> Maybe QNameSource
getAttrl :: Content -> [Attr]Source
mkText :: String -> ContentSource
mkName :: String -> QNameSource
qualifiedName :: QName -> StringSource
xpText :: PU StringSource
xpText0 :: PU StringSource
xpElem :: String -> PU a -> PU aSource
xpIElem :: String -> PU a -> PU aSource
A pickler for interleaved elements.
xpAttr :: String -> PU a -> PU aSource
xpElemWithAttrValue :: String -> String -> String -> PU a -> PU aSource
xpAttrFixed :: String -> String -> PU ()Source
xpAddFixedAttr :: String -> String -> PU a -> PU aSource
uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> dSource
uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> eSource
uncurry5 :: (a -> b -> c -> d -> e -> f) -> (a, b, c, d, e) -> fSource
readXmlString :: Show a => PU a -> String -> aSource
readXmlFile :: Show a => PU a -> String -> IO aSource
getStyleVersion :: [Content] -> StringSource
styleErr08 :: StringSource
Produced by Haddock version 2.6.1