on master help sign in
Merge pull request #751 from turboMaCk/chore/refactor-file-parser

Dry eitherDecodeFileStrict impementation

commit18a434f924bec656f24d1aec348a7bd1d5334553 authorAdam Bergmark <adam@bergmark.nl> dateWed 19 Feb 2020, 15:43 (7 years ago) parent817ad94f22c94a
1 file changed+2−2
Data/Aeson.hs+2−2
Data/Aeson.hs+2−2
@@ -257,7 +257,7 @@ eitherDecodeStrict =
257257-- | Like 'decodeFileStrict' but returns an error message when decoding fails.
258258eitherDecodeFileStrict :: (FromJSON a) => FilePath -> IO (Either String a)
259259eitherDecodeFileStrict =
260− fmap (eitherFormatError . eitherDecodeStrictWith jsonEOF ifromJSON) . B.readFile
260+ fmap eitherDecodeStrict . B.readFile
261261{-# INLINE eitherDecodeFileStrict #-}
262262
263263-- | Like 'decode'' but returns an error message when decoding fails.
@@ -274,7 +274,7 @@ eitherDecodeStrict' =
274274-- | Like 'decodeFileStrict'' but returns an error message when decoding fails.
275275eitherDecodeFileStrict' :: (FromJSON a) => FilePath -> IO (Either String a)
276276eitherDecodeFileStrict' =
277− fmap (eitherFormatError . eitherDecodeStrictWith jsonEOF' ifromJSON) . B.readFile
277+ fmap eitherDecodeStrict' . B.readFile
278278{-# INLINE eitherDecodeFileStrict' #-}
279279
280280-- $use