Hoogle Search
Within LTS Haskell 24.52 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
This module provides XML picklers that plug into the XML tree of the xml-types package. This module was "inspired" by hexpat-pickle. The API differences between hexpat-pickle and this module include:
- When unpickling, picklers will consume matching elmements so that they will be ignored by sucessive picklers. To circumvent this behaviour, use xpPeek
- Wrappers like xpWrap are uncurried
- There are no lazy unpicklers
- Most unpicklers will produce an error when their child unpicklers fail to consume all elements. Use xpClean to discard those elements
- The returned list should be a subset of or the initial list itself, that is, no elements should be added or changed
- The relative order of elements should be preserved
- Elements may, however, be removed from anywhere in the list
{-# LANGUAGE OverloadedStrings #-} import Data.Text import Data.XML.Types import Data.XML.Pickle -- Person name, age and description data Person = Person Text Int Text xpPerson :: PU [Node] Person xpPerson = -- How to wrap and unwrap a Person xpWrap (\((name, age), descr) -> Person name age descr) (\(Person name age descr) -> ((name, age), descr)) $ xpElem "person" (xpPair (xpAttr "name" xpId) (xpAttr "age" xpPrim)) (xpContent xpId) people = [ Person "Dave" 27 "A fat thin man with long short hair", Person "Jane" 21 "Lives in a white house with green windows"] main = do print $ pickle (xpRoot $ xpElemNodes "people" $ xpAll xpPerson) peopleProgram output would be an xml-value equivalent to:<people> <person name="Dave" age="27"> A fat thin man with long short hair </person> <person name="Jane" age="21"> Lives in a white house with green windows </person> </people>
Functions marked with compat are included for compatibility with hexpat-pickle. -
xml-picklers Data.XML.Pickle No documentation available.
PU :: (t -> UnpickleResult t a) -> (a -> t) -> PU t axml-picklers Data.XML.Pickle No documentation available.
-
xmonad XMonad No documentation available.
-
xmonad XMonad No documentation available.
-
xmonad XMonad Place of window relative to siblings (used in Circulation requests or events)
-
xmonad XMonad counterpart of an X11 XPoint structure
Point :: Position -> Position -> Pointxmonad XMonad No documentation available.
-
xmonad XMonad No documentation available.
-
xmonad XMonad No documentation available.