packages feed

feed 1.0.1.0 → 1.1.0.0

raw patch · 5 files changed

+13/−13 lines, 5 filesdep ~xml-conduitPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: xml-conduit

API changes (from Hackage documentation)

- Text.Feed.Import: parseFeedFromFile :: FilePath -> IO Feed
+ Text.Feed.Import: parseFeedFromFile :: FilePath -> IO (Maybe Feed)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+## 1.1.0.0++* `parseFeedFromFile` now returns `IO (Maybe Feed)` instead of `IO Feed` to distinguish IO exceptions from parse failures. Thanks to Jake Keuhlen.+ #### 1.0.1.0  * Support for GHC 8.6.x libraries
feed.cabal view
@@ -1,5 +1,5 @@ name:                feed-version:             1.0.1.0+version:             1.1.0.0 license:             BSD3 license-file:        LICENSE category:            Text@@ -29,9 +29,9 @@   , GHC == 7.8.4   , GHC == 7.10.3   , GHC == 8.0.2-  , GHC == 8.2.1-  , GHC == 8.4.1-  , GHC == 8.6.1+  , GHC == 8.2.2+  , GHC == 8.4.4+  , GHC == 8.6.4 data-files:   tests/files/*.xml extra-source-files:@@ -136,4 +136,4 @@     , xml-conduit     , xml-types   build-tool-depends:-    markdown-unlit:markdown-unlit == 0.4.*+    markdown-unlit:markdown-unlit >= 0.4 && < 0.6
src/Text/Feed/Import.hs view
@@ -68,12 +68,8 @@  -- | 'parseFeedFromFile fp' reads in the contents of the file at @fp@; -- the assumed encoding is UTF-8.-parseFeedFromFile :: FilePath -> IO Feed-parseFeedFromFile fp = do-  ls <- utf8readFile fp-  case parseFeedString ls of-    Nothing -> fail ("parseFeedFromFile: not a well-formed XML content in: " ++ fp)-    Just f -> return f+parseFeedFromFile :: FilePath -> IO (Maybe Feed)+parseFeedFromFile fp = parseFeedString <$> utf8readFile fp   -- | 'parseFeedWithParser tries to parse the string @str@ -- as one of the feed formats. First as Atom, then RSS2 before
tests/Text/Atom/Tests.hs view
@@ -31,7 +31,7 @@     testAtom :: Assertion     testAtom = do       contents <- parseFeedFromFile =<< getDataFileName "tests/files/atom.xml"-      let res = fmap (renderText def) . elementToDoc . xmlFeed $ contents+      let res = fmap (renderText def) . (>>= elementToDoc) . fmap xmlFeed $ contents       assertBool "Atom Parsing" $ isJust res  testAtomAlternate :: Test
tests/Text/RSS/Tests.hs view
@@ -30,5 +30,5 @@     testRss20 :: Assertion     testRss20 = do       contents <- parseFeedFromFile =<< getDataFileName "tests/files/rss20.xml"-      let res = fmap (renderText def) . elementToDoc . xmlFeed $ contents+      let res = fmap (renderText def) . (>>= elementToDoc) . fmap xmlFeed $ contents       assertBool "RSS 2.0 Parsing" $ isJust res