{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Text.RSS.Extensions where
import Control.Exception.Safe as Exception
import Data.Conduit
import Data.Maybe
import Data.Proxy
import Data.Text
import Data.XML.Types
import GHC.Generics
import Text.Atom.Conduit.Parse
import Text.Atom.Types
import Text.Read (readMaybe)
import Text.RSS.Types
import Text.XML.Stream.Parse
import URI.ByteString
class a where
:: MonadThrow m => ConduitT Event o m (RssChannelExtension a)
:: MonadThrow m => ConduitT Event o m (RssItemExtension a)
instance ParseRssExtension NoExtensions where
parseRssChannelExtension :: ConduitT Event o m (RssChannelExtension NoExtensions)
parseRssChannelExtension = RssChannelExtension NoExtensions
-> ConduitT Event o m (RssChannelExtension NoExtensions)
forall (f :: * -> *) a. Applicative f => a -> f a
pure RssChannelExtension NoExtensions
NoChannelExtensions
parseRssItemExtension :: ConduitT Event o m (RssItemExtension NoExtensions)
parseRssItemExtension = RssItemExtension NoExtensions
-> ConduitT Event o m (RssItemExtension NoExtensions)
forall (f :: * -> *) a. Applicative f => a -> f a
pure RssItemExtension NoExtensions
NoItemExtensions
class e where
:: Monad m => RssChannelExtension e -> ConduitT () Event m ()
:: Monad m => RssItemExtension e -> ConduitT () Event m ()
instance RenderRssExtension NoExtensions where
renderRssChannelExtension :: RssChannelExtension NoExtensions -> ConduitT () Event m ()
renderRssChannelExtension = ConduitT () Event m ()
-> RssChannelExtension NoExtensions -> ConduitT () Event m ()
forall a b. a -> b -> a
const (ConduitT () Event m ()
-> RssChannelExtension NoExtensions -> ConduitT () Event m ())
-> ConduitT () Event m ()
-> RssChannelExtension NoExtensions
-> ConduitT () Event m ()
forall a b. (a -> b) -> a -> b
$ () -> ConduitT () Event m ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
renderRssItemExtension :: RssItemExtension NoExtensions -> ConduitT () Event m ()
renderRssItemExtension = ConduitT () Event m ()
-> RssItemExtension NoExtensions -> ConduitT () Event m ()
forall a b. a -> b -> a
const (ConduitT () Event m ()
-> RssItemExtension NoExtensions -> ConduitT () Event m ())
-> ConduitT () Event m ()
-> RssItemExtension NoExtensions
-> ConduitT () Event m ()
forall a b. (a -> b) -> a -> b
$ () -> ConduitT () Event m ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()