Safe Haskell | None |
---|---|
Language | Haskell2010 |
Imm.Feed
Description
Helpers to manipulate feeds
Synopsis
- data FeedLocation
- data FeedQuery
- = ByDatabaseID Int
- | ByURI URI
- | AllFeeds
- data Feed
- data FeedElement
- data FeedURI = FeedURI (URIRef a)
- sameURIType :: URIRef a1 -> URIRef a2 -> Maybe (URIRef a1 :~: URIRef a2)
- withFeedURI :: (forall a. URIRef a -> b) -> FeedURI -> b
- renderFeed :: Feed -> Text
- renderFeedElement :: FeedElement -> Text
- parseFeed :: MonadCatch m => Text -> m Feed
- parseFeedElement :: MonadCatch m => Text -> m FeedElement
- removeElements :: Feed -> Feed
- getFeedTitle :: Feed -> Text
- getElements :: Feed -> [FeedElement]
- getDate :: FeedElement -> Maybe UTCTime
- getTitle :: FeedElement -> Text
- getContent :: FeedElement -> Text
- getLink :: FeedElement -> Maybe FeedURI
- getId :: FeedElement -> Text
- prettyElement :: FeedElement -> Doc a
Types
data FeedLocation Source #
Feed location identifies a feed. It is either: - the feed URI - a webpage URI that refers to the feed through an alternate link, in which case an optional feed title can be provided to disambiguate multiple such links
Constructors
FeedDirectURI URI | |
FeedAlternateLink URI Text |
Instances
Eq FeedLocation Source # | |
Defined in Imm.Feed | |
Ord FeedLocation Source # | |
Defined in Imm.Feed Methods compare :: FeedLocation -> FeedLocation -> Ordering # (<) :: FeedLocation -> FeedLocation -> Bool # (<=) :: FeedLocation -> FeedLocation -> Bool # (>) :: FeedLocation -> FeedLocation -> Bool # (>=) :: FeedLocation -> FeedLocation -> Bool # max :: FeedLocation -> FeedLocation -> FeedLocation # min :: FeedLocation -> FeedLocation -> FeedLocation # | |
Show FeedLocation Source # | |
Defined in Imm.Feed Methods showsPrec :: Int -> FeedLocation -> ShowS # show :: FeedLocation -> String # showList :: [FeedLocation] -> ShowS # | |
ToJSON FeedLocation Source # | |
Defined in Imm.Feed Methods toJSON :: FeedLocation -> Value # toEncoding :: FeedLocation -> Encoding # toJSONList :: [FeedLocation] -> Value # toEncodingList :: [FeedLocation] -> Encoding # | |
FromJSON FeedLocation Source # | |
Defined in Imm.Feed | |
Pretty FeedLocation Source # | |
Defined in Imm.Feed |
A query describes a set of feeds through some criteria.
Constructors
ByDatabaseID Int | |
ByURI URI | |
AllFeeds |
Instances
Eq FeedQuery Source # | |
Ord FeedQuery Source # | |
Show FeedQuery Source # | |
Pretty FeedQuery Source # | |
Constructors
Rss (RssDocument (ContentModule (DublinCoreModule NoExtensions))) | |
Atom AtomFeed |
data FeedElement Source #
Constructors
RssElement (RssItem (ContentModule (DublinCoreModule NoExtensions))) | |
AtomElement AtomEntry |
Instances
Eq FeedElement Source # | |
Defined in Imm.Feed | |
Ord FeedElement Source # | |
Defined in Imm.Feed Methods compare :: FeedElement -> FeedElement -> Ordering # (<) :: FeedElement -> FeedElement -> Bool # (<=) :: FeedElement -> FeedElement -> Bool # (>) :: FeedElement -> FeedElement -> Bool # (>=) :: FeedElement -> FeedElement -> Bool # max :: FeedElement -> FeedElement -> FeedElement # min :: FeedElement -> FeedElement -> FeedElement # | |
Show FeedElement Source # | |
Defined in Imm.Feed Methods showsPrec :: Int -> FeedElement -> ShowS # show :: FeedElement -> String # showList :: [FeedElement] -> ShowS # | |
Pretty (PrettyKey FeedElement) Source # | |
Defined in Imm.Feed Methods pretty :: PrettyKey FeedElement -> Doc ann # prettyList :: [PrettyKey FeedElement] -> Doc ann # |
withFeedURI :: (forall a. URIRef a -> b) -> FeedURI -> b Source #
Generic parsers/renderers
renderFeed :: Feed -> Text Source #
renderFeedElement :: FeedElement -> Text Source #
parseFeedElement :: MonadCatch m => Text -> m FeedElement Source #
Generic mutators
removeElements :: Feed -> Feed Source #
Generic getters
getFeedTitle :: Feed -> Text Source #
getElements :: Feed -> [FeedElement] Source #
getTitle :: FeedElement -> Text Source #
getContent :: FeedElement -> Text Source #
getId :: FeedElement -> Text Source #
Misc
prettyElement :: FeedElement -> Doc a Source #