    --------------------------------------------------------------------
    -- |
    -- Module    : Text.Feed.Types
    -- Copyright : (c) Galois, Inc. 2008,
    --             (c) Sigbjorn Finne 2009-
    -- License   : BSD3
    --
    -- Maintainer: Sigbjorn Finne <sof@forkIO.com>
    -- Stability : provisional
    -- Portability: portable
    --
    --------------------------------------------------------------------
    module Text.Feed.Types
      ( Feed(..)
      , Item(..)
      , FeedKind(..)
      ) where

    import Prelude.Compat

    import Data.Text

    import qualified Data.XML.Types as XML
    import qualified Text.Atom.Feed as Atom
    import qualified Text.RSS.Syntax as RSS
    import qualified Text.RSS1.Syntax as RSS1

    -- | The abstract type of feed documents. The internal representation
    -- is as whatever feed variant type the document was either imported or
    -- has now been translated to.
    data Feed
      = AtomFeed Atom.Feed
      | RSSFeed RSS.RSS
      | RSS1Feed RSS1.Feed
        -- if we're unable to correctly the well-formed XML as a feed,
        -- keep it as an untyped document.
      | XMLFeed XML.Element
      deriving (Int -> Feed -> ShowS
    [Feed] -> ShowS
    Feed -> String
    (Int -> Feed -> ShowS)
    -> (Feed -> String) -> ([Feed] -> ShowS) -> Show Feed
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Feed -> ShowS
    showsPrec :: Int -> Feed -> ShowS
    $cshow :: Feed -> String
    show :: Feed -> String
    $cshowList :: [Feed] -> ShowS
    showList :: [Feed] -> ShowS
    Show)

    -- | The abstract type of feed items. Like the 'Text.Feed.Types.Feed' type, the
    -- representation of a value is as one of the different RSS item\/entry
    -- variants.
    data Item
      = AtomItem Atom.Entry
      | RSSItem RSS.RSSItem
      | RSS1Item RSS1.Item
      | XMLItem XML.Element
      deriving (Int -> Item -> ShowS
    [Item] -> ShowS
    Item -> String
    (Int -> Item -> ShowS)
    -> (Item -> String) -> ([Item] -> ShowS) -> Show Item
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Item -> ShowS
    showsPrec :: Int -> Item -> ShowS
    $cshow :: Item -> String
    show :: Item -> String
    $cshowList :: [Item] -> ShowS
    showList :: [Item] -> ShowS
    Show)

    -- | The kinds of feed documents supported.
    data FeedKind
      = AtomKind
      | RSSKind (Maybe Text) -- Nothing => default version (2.0)
      | RDFKind (Maybe Text) -- Nothing => default version (1.0)
      deriving (FeedKind -> FeedKind -> Bool
    (FeedKind -> FeedKind -> Bool)
    -> (FeedKind -> FeedKind -> Bool) -> Eq FeedKind
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: FeedKind -> FeedKind -> Bool
    == :: FeedKind -> FeedKind -> Bool
    $c/= :: FeedKind -> FeedKind -> Bool
    /= :: FeedKind -> FeedKind -> Bool
    Eq, Int -> FeedKind -> ShowS
    [FeedKind] -> ShowS
    FeedKind -> String
    (Int -> FeedKind -> ShowS)
    -> (FeedKind -> String) -> ([FeedKind] -> ShowS) -> Show FeedKind
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> FeedKind -> ShowS
    showsPrec :: Int -> FeedKind -> ShowS
    $cshow :: FeedKind -> String
    show :: FeedKind -> String
    $cshowList :: [FeedKind] -> ShowS
    showList :: [FeedKind] -> ShowS
    Show)