@@ -173,7 +173,7 @@ decodeFile fp = decodeHelper (Y.decodeFile fp) >>= either throwIO (return . eith
174-- | A version of 'decodeFile' which should not throw runtime exceptions.
174-- | A version of 'decodeFile' which should not throw runtime exceptions.
176−-- Since 0.8.4
176+-- @since 0.8.4
177decodeFileEither
177decodeFileEither
178 :: FromJSON a
178 :: FromJSON a
179 => FilePath
179 => FilePath
@@ -187,7 +187,7 @@ decodeEither bs = unsafePerformIO
188-- | More helpful version of 'decodeEither' which returns the 'YamlException'.
188-- | More helpful version of 'decodeEither' which returns the 'YamlException'.
190−-- Since 0.8.3
190+-- @since 0.8.3
191decodeEither' :: FromJSON a => ByteString -> Either ParseException a
191decodeEither' :: FromJSON a => ByteString -> Either ParseException a
192decodeEither' = either Left (either (Left . AesonException) Right)
192decodeEither' = either Left (either (Left . AesonException) Right)
193 . unsafePerformIO
193 . unsafePerformIO
@@ -196,13 +196,13 @@ decodeEither' = either Left (either (Left . AesonException) Right)
197-- | A version of 'decodeEither'' lifted to MonadThrow
197-- | A version of 'decodeEither'' lifted to MonadThrow
199−-- Since 0.8.31
199+-- @since 0.8.31
200decodeThrow :: (MonadThrow m, FromJSON a) => ByteString -> m a
200decodeThrow :: (MonadThrow m, FromJSON a) => ByteString -> m a
201decodeThrow = either throwM return . decodeEither'
201decodeThrow = either throwM return . decodeEither'
203-- | A version of 'decodeFileEither' lifted to MonadIO
203-- | A version of 'decodeFileEither' lifted to MonadIO
205−-- Since 0.8.31
205+-- @since 0.8.31
206decodeFileThrow :: (MonadIO m, FromJSON a) => FilePath -> m a
206decodeFileThrow :: (MonadIO m, FromJSON a) => FilePath -> m a
207decodeFileThrow f = liftIO $ decodeFileEither f >>= either throwIO return
207decodeFileThrow f = liftIO $ decodeFileEither f >>= either throwIO return