on master help sign in
Prep for release
f7b4ce8Michael Snoyman
Data/Yaml/Builder.hs+2
@@ -1,4 +1,6 @@
1{-# LANGUAGE FlexibleInstances #-}
1{-# LANGUAGE FlexibleInstances #-}
2+-- | NOTE: This module is a highly experimental preview release. It may change
3+-- drastically, or be entirely removed, in a future release.
2module Data.Yaml.Builder
4module Data.Yaml.Builder
3 ( YamlBuilder (..)
5 ( YamlBuilder (..)
4 , ToYaml (..)
6 , ToYaml (..)
Data/Yaml/Parser.hs+3
@@ -1,5 +1,7 @@
1{-# LANGUAGE DeriveDataTypeable #-}
1{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE OverloadedStrings #-}
3+-- | NOTE: This module is a highly experimental preview release. It may change
4+-- drastically, or be entirely removed, in a future release.
3module Data.Yaml.Parser where
5module Data.Yaml.Parser where
4
6
5import Text.Libyaml
7import Text.Libyaml
@@ -178,6 +180,7 @@ sinkValue =
178 let k = decodeUtf8 a
180 let k = decodeUtf8 a
179 v <- start
181 v <- start
180 goM (front . ((k, v):))
182 goM (front . ((k, v):))
183+ Just e -> monadThrow $ UnexpectedEvent e
181
184
182sinkRawDoc :: MonadThrow m => Consumer Event m RawDoc
185sinkRawDoc :: MonadThrow m => Consumer Event m RawDoc
183sinkRawDoc = uncurry RawDoc <$> runWriterSC sinkValue
186sinkRawDoc = uncurry RawDoc <$> runWriterSC sinkValue
builder-test.hs+6
@@ -18,4 +18,10 @@ main = do
18 S.putStr $ toByteString
18 S.putStr $ toByteString
19 [ Person "Alice" 57
19 [ Person "Alice" 57
20 , Person "Bob" 23
20 , Person "Bob" 23
21+ , Person "12345" 23
22+ ]
23+ writeYamlFile "/tmp/foo.yaml" $
24+ [ Person "Alice" 57
25+ , Person "Bob" 23
26+ , Person "12345" 23
21 ]
27 ]
yaml.cabal+4−1
@@ -1,5 +1,5 @@
1name: yaml
1name: yaml
2−version: 0.8.6.2
2+version: 0.8.7
3license: BSD3
3license: BSD3
4license-file: LICENSE
4license-file: LICENSE
5author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov
5author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov
@@ -52,6 +52,9 @@ library
52 , scientific
52 , scientific
53 exposed-modules: Text.Libyaml
53 exposed-modules: Text.Libyaml
54 Data.Yaml
54 Data.Yaml
55+ Data.Yaml.Aeson
56+ Data.Yaml.Builder
57+ Data.Yaml.Parser
55 ghc-options: -Wall
58 ghc-options: -Wall
56 c-sources: c/helper.c
59 c-sources: c/helper.c
57 include-dirs: c
60 include-dirs: c