packages feed

yaml 0.8.2.4 → 0.8.3

raw patch · 2 files changed

+14/−1 lines, 2 files

Files

Data/Yaml.hs view
@@ -28,6 +28,8 @@     , Object     , Array     , ParseException(..)+    , YamlException (..)+    , YamlMark (..)       -- * Constructors and accessors     , object     , array@@ -49,6 +51,7 @@     , decodeFile       -- ** Better error information     , decodeEither+    , decodeEither'       -- ** More control over decoding     , decodeHelper     ) where@@ -138,6 +141,7 @@                                       , _expected :: Maybe Event                                       }                     | InvalidYaml (Maybe YamlException)+                    | AesonException String     deriving (Show, Typeable) instance Exception ParseException @@ -278,6 +282,15 @@ decodeEither bs = unsafePerformIO                 $ fmap (either (Left . show) id)                 $ decodeHelper (Y.decode bs)++-- | More helpful version of 'decodeEither' which returns the 'YamlException'.+--+-- Since 0.8.3+decodeEither' :: FromJSON a => ByteString -> Either ParseException a+decodeEither' = either Left (either (Left . AesonException) Right)+              . unsafePerformIO+              . decodeHelper+              . Y.decode  decodeHelper :: FromJSON a              => C.Source Parse Y.Event
yaml.cabal view
@@ -1,5 +1,5 @@ name:            yaml-version:         0.8.2.4+version:         0.8.3 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov