{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes       #-}
-- | Streaming parsers for the RSS 2.0 standard.
--
-- This module re-exports a monomorphic version of the parsers from "Text.RSS.Conduit.Parse" that ignores RSS extensions.
module Text.RSS.Conduit.Parse.Simple
  ( -- * Top-level
    rssDocument
    -- * Elements
  , rssCategory
  , rssCloud
  , rssEnclosure
  , rssGuid
  , rssImage
  , rssItem
  , rssSkipDays
  , rssSkipHours
  , rssSource
  , rssTextInput
  ) where

-- {{{ Imports
import qualified Text.RSS.Conduit.Parse as P
import           Text.RSS.Types

import           Control.Exception.Safe as Exception
import           Data.Conduit
import           Data.Set
import           Data.XML.Types
-- }}}

-- | Parse a @\<skipHours\>@ element.
rssSkipHours :: MonadThrow m => ConduitM Event o m (Maybe (Set Hour))
rssSkipHours :: ConduitM Event o m (Maybe (Set Hour))
rssSkipHours = ConduitM Event o m (Maybe (Set Hour))
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe (Set Hour))
P.rssSkipHours

-- | Parse a @\<skipDays\>@ element.
rssSkipDays :: MonadThrow m => ConduitM Event o m (Maybe (Set Day))
rssSkipDays :: ConduitM Event o m (Maybe (Set Day))
rssSkipDays = ConduitM Event o m (Maybe (Set Day))
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe (Set Day))
P.rssSkipDays

-- | Parse a @\<textInput\>@ element.
rssTextInput :: MonadThrow m => ConduitM Event o m (Maybe RssTextInput)
rssTextInput :: ConduitM Event o m (Maybe RssTextInput)
rssTextInput = ConduitM Event o m (Maybe RssTextInput)
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe RssTextInput)
P.rssTextInput

-- | Parse an @\<image\>@ element.
rssImage :: MonadThrow m => ConduitM Event o m (Maybe RssImage)
rssImage :: ConduitM Event o m (Maybe RssImage)
rssImage = ConduitM Event o m (Maybe RssImage)
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe RssImage)
P.rssImage

-- | Parse a @\<category\>@ element.
rssCategory :: MonadThrow m => ConduitM Event o m (Maybe RssCategory)
rssCategory :: ConduitM Event o m (Maybe RssCategory)
rssCategory = ConduitM Event o m (Maybe RssCategory)
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe RssCategory)
P.rssCategory

-- | Parse a @\<cloud\>@ element.
rssCloud :: MonadThrow m => ConduitM Event o m (Maybe RssCloud)
rssCloud :: ConduitM Event o m (Maybe RssCloud)
rssCloud = ConduitM Event o m (Maybe RssCloud)
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe RssCloud)
P.rssCloud

-- | Parse a @\<guid\>@ element.
rssGuid :: MonadThrow m => ConduitM Event o m (Maybe RssGuid)
rssGuid :: ConduitM Event o m (Maybe RssGuid)
rssGuid = ConduitM Event o m (Maybe RssGuid)
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe RssGuid)
P.rssGuid

-- | Parse an @\<enclosure\>@ element.
rssEnclosure :: MonadThrow m => ConduitM Event o m (Maybe RssEnclosure)
rssEnclosure :: ConduitM Event o m (Maybe RssEnclosure)
rssEnclosure = ConduitM Event o m (Maybe RssEnclosure)
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe RssEnclosure)
P.rssEnclosure

-- | Parse a @\<source\>@ element.
rssSource :: MonadThrow m => ConduitM Event o m (Maybe RssSource)
rssSource :: ConduitM Event o m (Maybe RssSource)
rssSource = ConduitM Event o m (Maybe RssSource)
forall (m :: * -> *) o.
MonadThrow m =>
ConduitM Event o m (Maybe RssSource)
P.rssSource

-- | Parse an @\<item\>@ element.
--
-- RSS extensions are ignored.
rssItem :: MonadThrow m => ConduitM Event o m (Maybe RssItem')
rssItem :: ConduitM Event o m (Maybe RssItem')
rssItem = ConduitM Event o m (Maybe RssItem')
forall e (m :: * -> *) o.
(ParseRssExtension e, MonadThrow m) =>
ConduitM Event o m (Maybe (RssItem e))
P.rssItem

-- | Parse an @\<rss\>@ element.
--
-- RSS extensions are ignored.
rssDocument :: MonadThrow m => ConduitM Event o m (Maybe RssDocument')
rssDocument :: ConduitM Event o m (Maybe RssDocument')
rssDocument = ConduitM Event o m (Maybe RssDocument')
forall e (m :: * -> *) o.
(ParseRssExtension e, MonadThrow m) =>
ConduitM Event o m (Maybe (RssDocument e))
P.rssDocument