| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Atom
- atomText :: Name -> Prism' Element AtomText
- atomPerson :: Name -> Prism' Element AtomPerson
- atomCategory :: Prism' Element AtomCategory
- atomLink :: Prism' Element AtomLink
- atomGenerator :: Prism' Element AtomGenerator
- atomSource :: Prism' Element AtomSource
- atomContent :: Prism' Element AtomContent
- atomEntry :: Prism' Element AtomEntry
- atomFeed :: Prism' Element AtomFeed
Documentation
atomText :: Name -> Prism' Element AtomText
Example:
>>>let (Right doc) = parseText def "<foo>bar</foo>">>>doc ^? root . atomText "foo"Just (AtomPlainText {atomPlainTextType_ = TypeText, atomPlainTextText_ = "bar"}])
atomPerson :: Name -> Prism' Element AtomPerson
Example:
>>>let (Right doc) = parseText def "<author><name>John Doe</name><email>john.doe@nobody.org</email><uri>https://jd.io</uri></author>">>>doc ^? root . atomPerson "author"Just (AtomPerson "John Doe" (Just "john.doe@nobody.org") (Just https://jd.io))
atomCategory :: Prism' Element AtomCategory
Example:
>>>let (Right doc) = parseText def "<category term=\"foo\" scheme=\"bar\" label=\"baz\"/>">>>doc ^? root . atomCategoryJust (AtomCategory "foo" (Just "bar") (Just "baz"))
atomLink :: Prism' Element AtomLink
Example:
>>>let (Right doc) = parseText def "<link href=\"http://foo.io\" rel=\"alternate\" type=\"text/html\" hreflang=\"en\" title=\"foo\" length=\"1\"/>">>>doc ^? root . atomLinkJust (AtomLink http://foo.io (Just "alternate") (Just "text/html") (Just "en") (Just "foo") (Just "1"))