yaml 0.8.23 → 0.8.23.1
raw patch · 6 files changed
+18/−44 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Data/Yaml.hs +4/−0
- Data/Yaml/Builder.hs +4/−0
- Data/Yaml/Parser.hs +1/−6
- Text/Libyaml.hs +4/−37
- yaml.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.8.23.1++* Update CPP `MIN_VERSION_*` checks [#109](https://github.com/snoyberg/yaml/pull/109)+ ## 0.8.23 * Re-export the with helpers from aeson
Data/Yaml.hs view
@@ -78,7 +78,11 @@ , Object, Array , withObject, withText, withArray, withScientific, withBool )+#if MIN_VERSION_aeson(1,0,0)+import Data.Aeson.Text (encodeToTextBuilder)+#else import Data.Aeson.Encode (encodeToTextBuilder)+#endif import Data.Aeson.Types (Pair, parseMaybe, parseEither, Parser) import Data.ByteString (ByteString) import qualified Data.Conduit as C
Data/Yaml/Builder.hs view
@@ -22,7 +22,11 @@ import Control.Arrow (second) import Control.Monad.Trans.Resource (runResourceT)+#if MIN_VERSION_aeson(1,0,0)+import Data.Aeson.Text (encodeToTextBuilder)+#else import Data.Aeson.Encode (encodeToTextBuilder)+#endif import Data.Aeson.Types (Value(..)) import Data.ByteString (ByteString) import qualified Data.ByteString.Char8 as S8
Data/Yaml/Parser.hs view
@@ -13,12 +13,7 @@ import Control.Monad.Trans.Writer.Strict (tell, WriterT) import Data.ByteString (ByteString) import Data.Conduit-#if MIN_VERSION_conduit(1,1,0) import Data.Conduit.Lift (runWriterC)-#define runWriterSC runWriterC-#else-import Data.Conduit.Lift (runWriterSC)-#endif import qualified Data.Map as Map #if !MIN_VERSION_base(4,8,0) import Data.Monoid (Monoid (..))@@ -193,7 +188,7 @@ Just e -> monadThrow $ UnexpectedEvent e sinkRawDoc :: MonadThrow m => Consumer Event m RawDoc-sinkRawDoc = uncurry RawDoc <$> runWriterSC sinkValue+sinkRawDoc = uncurry RawDoc <$> runWriterC sinkValue readYamlFile :: FromYaml a => FilePath -> IO a readYamlFile fp = runResourceT (decodeFile fp $$ sinkRawDoc) >>= parseRawDoc
Text/Libyaml.hs view
@@ -479,12 +479,7 @@ deriving (Show, Typeable) instance Exception ToEventRawException -decode :: MonadResource m => B.ByteString-#if MIN_VERSION_conduit(1, 0, 0)- -> Producer m Event-#else- -> GSource m Event-#endif+decode :: MonadResource m => B.ByteString -> Producer m Event decode bs | B8.null bs = return () decode bs = bracketP alloc cleanup (runParser . fst)@@ -526,12 +521,7 @@ then withCString openMode $ \openMode' -> c_fdopen fd openMode' else return nullPtr -decodeFile :: MonadResource m => FilePath-#if MIN_VERSION_conduit(1, 0, 0)- -> Producer m Event-#else- -> GSource m Event-#endif+decodeFile :: MonadResource m => FilePath -> Producer m Event decodeFile file = bracketP alloc cleanup (runParser . fst) where@@ -559,12 +549,7 @@ c_yaml_parser_delete ptr free ptr -runParser :: MonadResource m => Parser-#if MIN_VERSION_conduit(1, 0, 0)- -> Producer m Event-#else- -> GSource m Event-#endif+runParser :: MonadResource m => Parser -> Producer m Event runParser parser = do e <- liftIO $ parserParseOne' parser case e of@@ -588,12 +573,7 @@ return $ Left $ YamlParseException problem context problemMark else Right <$> getEvent er -encode :: MonadResource m-#if MIN_VERSION_conduit(1, 0, 0)- => Consumer Event m ByteString-#else- => GSink Event m ByteString-#endif+encode :: MonadResource m => Consumer Event m ByteString encode = runEmitter alloc close where@@ -610,11 +590,7 @@ encodeFile :: MonadResource m => FilePath-#if MIN_VERSION_conduit(1, 0, 0) -> Consumer Event m ()-#else- -> GInfSink Event m-#endif encodeFile filePath = bracketP getFile c_fclose $ \file -> runEmitter (alloc file) (\u _ -> return u) where@@ -628,13 +604,8 @@ runEmitter :: MonadResource m => (Emitter -> IO a) -- ^ alloc-#if MIN_VERSION_conduit(1, 0, 0) -> (() -> a -> IO b) -- ^ close -> Consumer Event m b-#else- -> (u -> a -> IO b) -- ^ close- -> Pipe l Event o u m b-#endif runEmitter allocI closeI = bracketP alloc cleanup go where@@ -654,11 +625,7 @@ go (emitter, a) = loop where-#if MIN_VERSION_conduit(1, 0, 0) loop = await >>= maybe (close ()) push-#else- loop = awaitE >>= either close push-#endif push e = do _ <- liftIO $ toEventRaw e $ c_yaml_emitter_emit emitter
yaml.cabal view
@@ -1,5 +1,5 @@ name: yaml-version: 0.8.23+version: 0.8.23.1 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov