module Text.Feed.Export
( Text.Feed.Export.xmlFeed
, Text.Feed.Export.textFeed
) where
import Prelude.Compat
import Text.Feed.Types
import Text.Atom.Feed.Export as Atom
import Text.RSS.Export as RSS
import Text.RSS1.Export as RSS1
import qualified Data.Text.Util as U
import Data.XML.Types as XML
import qualified Data.Text.Lazy as TL
xmlFeed :: Feed -> XML.Element
xmlFeed fe =
case fe of
AtomFeed f -> Atom.xmlFeed f
RSSFeed f -> RSS.xmlRSS f
RSS1Feed f -> RSS1.xmlFeed f
XMLFeed e -> e
textFeed :: Feed -> Maybe TL.Text
textFeed = U.renderFeed Text.Feed.Export.xmlFeed