on master help sign in
Deprecate decode and decodeEither
commitda49011adbb492abd39eaf21cb86be243ab6f313 authorMichael Snoyman <michael@snoyman.com> dateThu 28 Jun 2018, 12:13 (8 years ago) parentf60ce3c
2 files changed+3
ChangeLog.md+1 Data/Yaml.hs+2
ChangeLog.md+1
@@ -2,6 +2,7 @@
22
33* Add `decodeThrow` and `decodeFileThrow` convenience functions.
44* Upgrade libyaml versions
5+* Deprecate `decode` and `decodeEither`
56
67## 0.8.30
78
Data/Yaml.hs+2
@@ -164,6 +164,7 @@ decode :: FromJSON a
164164decode bs = unsafePerformIO
165165 $ either (const Nothing) id
166166 <$> decodeHelper_ (Y.decode bs)
167+{-# DEPRECATED decode "Please use decodeEither or decodeThrow, which provide information on how the decode failed" #-}
167168
168169decodeFile :: FromJSON a
169170 => FilePath
@@ -184,6 +185,7 @@ decodeEither :: FromJSON a => ByteString -> Either String a
184185decodeEither bs = unsafePerformIO
185186 $ either (Left . prettyPrintParseException) id
186187 <$> decodeHelper (Y.decode bs)
188+{-# DEPRECATED decodeEither "Please use decodeEither' or decodeThrow, which provide more useful failures" #-}
187189
188190-- | More helpful version of 'decodeEither' which returns the 'YamlException'.
189191--