    module Yesod.FeedTypes
        ( Feed (..)
        , FeedEntry (..)
        , EntryEnclosure (..)
        , EntryCategory (..)
        ) where

    import Text.Hamlet      (Html)
    import Data.Time.Clock  (UTCTime)
    import Data.Text        (Text)

    -- | The overall feed
    data Feed url = Feed
        { forall url. Feed url -> Text
    feedTitle       :: Text
        , forall url. Feed url -> url
    feedLinkSelf    :: url
        , forall url. Feed url -> url
    feedLinkHome    :: url
        , forall url. Feed url -> Text
    feedAuthor      :: Text

        -- | note: currently only used for Rss
        , forall url. Feed url -> Html
    feedDescription :: Html

        -- | note: currently only used for Rss, possible values:
        --   <http://www.rssboard.org/rss-language-codes>
        , forall url. Feed url -> Text
    feedLanguage    :: Text

        , forall url. Feed url -> UTCTime
    feedUpdated     :: UTCTime
        , forall url. Feed url -> Maybe (url, Text)
    feedLogo        :: Maybe (url, Text)
        , forall url. Feed url -> [FeedEntry url]
    feedEntries     :: [FeedEntry url]
        }

    -- | RSS and Atom allow for linked content to be enclosed in a feed entry.
    -- This represents the enclosed content.
    --
    -- Atom feeds ignore 'enclosedSize' and 'enclosedMimeType'.
    --
    -- @since 1.6
    data EntryEnclosure url = EntryEnclosure
        { forall url. EntryEnclosure url -> url
    enclosedUrl :: url
        , forall url. EntryEnclosure url -> Int
    enclosedSize :: Int -- ^ Specified in bytes
        , forall url. EntryEnclosure url -> Text
    enclosedMimeType :: Text
        }

    -- | RSS 2.0 and Atom allow category in a feed entry.
    --
    -- * [RSS category](http://www.rssboard.org/rss-specification#ltcategorygtSubelementOfLtitemgt)
    -- * [Atom category](https://tools.ietf.org/html/rfc4287#section-4.2.2)
    --
    -- RSS feeds ignore 'categoryLabel'
    --
    -- @since 1.7
    data EntryCategory = EntryCategory
      { EntryCategory -> Maybe Text
    categoryDomain :: Maybe Text -- ^ category identifier
      , EntryCategory -> Maybe Text
    categoryLabel :: Maybe Text -- ^ Human-readable label Atom only
      , EntryCategory -> Text
    categoryValue :: Text -- ^ identified categorization scheme via URI
      }

    -- | Each feed entry
    data FeedEntry url = FeedEntry
        { forall url. FeedEntry url -> url
    feedEntryLink    :: url
        , forall url. FeedEntry url -> UTCTime
    feedEntryUpdated :: UTCTime
        , forall url. FeedEntry url -> Text
    feedEntryTitle   :: Text
        , forall url. FeedEntry url -> Html
    feedEntryContent :: Html
        , forall url. FeedEntry url -> Maybe (EntryEnclosure url)
    feedEntryEnclosure :: Maybe (EntryEnclosure url)
          -- ^ Allows enclosed data: RSS \<enclosure> or Atom \<link
          -- rel=enclosure>
          --
          -- @since 1.5
        , forall url. FeedEntry url -> [EntryCategory]
    feedEntryCategories :: [EntryCategory]
          -- ^ Allows categories data: RSS \<category>
          -- or Atom \<link term=category>
          --
          -- @since 1.7
        }