feed 0.3.9.7 → 0.3.10.0
raw patch · 3 files changed
+18/−12 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Text.Feed.Import: parseFeedSource :: XmlSource s => s -> Maybe Feed
Files
- CHANGELOG.md +4/−0
- feed.cabal +1/−1
- src/Text/Feed/Import.hs +13/−11
CHANGELOG.md view
@@ -1,3 +1,7 @@+### 0.3.10.0++* Add `Text.Feed.Import.parseFeedSource :: XmlSource s => s -> Maybe Feed` (thanks to Dmitry Dzhus)+ #### 0.3.9.7 * Add missing modules in test-suite
feed.cabal view
@@ -1,5 +1,5 @@ name: feed-version: 0.3.9.7+version: 0.3.10.0 license: BSD3 license-file: LICENSE category: Text
src/Text/Feed/Import.hs view
@@ -15,12 +15,13 @@ module Text.Feed.Import ( parseFeedFromFile -- :: FilePath -> IO Feed- , parseFeedString -- :: String -> IO Feed+ , parseFeedString -- :: String -> Maybe Feed+ , parseFeedSource -- :: XmlSource s => s -> Maybe Feed -- if you know your format, use these directly:- , readRSS2 -- :: XML.Element -> Maybe Feed- , readRSS1 -- :: XML.Element -> Maybe Feed- , readAtom -- :: XML.Element -> Maybe Feed+ , readRSS2 -- :: XML.Element -> Maybe Feed+ , readRSS1 -- :: XML.Element -> Maybe Feed+ , readAtom -- :: XML.Element -> Maybe Feed ) where import Text.Atom.Feed.Import as Atom@@ -69,14 +70,16 @@ readRSS1 e `mplus` Just (XMLFeed e) ---- | 'parseFeedString str' tries to parse the string @str@ as--- one of the feed formats. First as Atom, then RSS2 before--- giving RSS1 a try. @Nothing@ is, rather unhelpfully, returned--- as an indication of error. parseFeedString :: String -> Maybe Feed-parseFeedString = parseFeedWithParser parseXMLDoc+parseFeedString = parseFeedSource +-- | 'parseFeedSource s' tries to parse the source @s@ as+-- one of the feed formats. First as Atom, then RSS2 before giving+-- RSS1 a try. @Nothing@ is, rather unhelpfully, returned as an+-- indication of error.+parseFeedSource :: XmlSource s => s -> Maybe Feed+parseFeedSource = parseFeedWithParser parseXMLDoc+ -- | 'readRSS2 elt' tries to derive an RSS2.x, RSS-0.9x feed document -- from the XML element @e@. readRSS2 :: XML.Element -> Maybe Feed@@ -91,4 +94,3 @@ -- from the XML element @e@. readAtom :: XML.Element -> Maybe Feed readAtom e = fmap AtomFeed $ Atom.elementFeed e-