@@ -39,6 +39,7 @@ import Data.Text.Lazy.Builder (toLazyText)
39import Data.Aeson.Encode (encodeToTextBuilder)
39import Data.Aeson.Encode (encodeToTextBuilder)
41import qualified Data.ByteString.Char8 as S8
41import qualified Data.ByteString.Char8 as S8
42+import Data.Attoparsec.Number
43import Prelude hiding (null)
44import Prelude hiding (null)
@@ -88,8 +89,13 @@ string s =
88 | otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
89 | otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
90-- Use aeson's implementation which gets rid of annoying decimal points
91-- Use aeson's implementation which gets rid of annoying decimal points
92+#if MIN_VERSION_aeson(0,7,0)
91scientific :: Scientific -> YamlBuilder
93scientific :: Scientific -> YamlBuilder
92scientific n = YamlBuilder (EventScalar (TE.encodeUtf8 $ TL.toStrict $ toLazyText $ encodeToTextBuilder (Number n)) IntTag PlainNoTag Nothing :)
94scientific n = YamlBuilder (EventScalar (TE.encodeUtf8 $ TL.toStrict $ toLazyText $ encodeToTextBuilder (Number n)) IntTag PlainNoTag Nothing :)
96+scientific :: Number -> YamlBuilder
97+scientific n = YamlBuilder (EventScalar (S8.pack $ show n) IntTag PlainNoTag Nothing :)
94{-# DEPRECATED number "Use scientific" #-}
100{-# DEPRECATED number "Use scientific" #-}
95#if MIN_VERSION_aeson(0,7,0)
101#if MIN_VERSION_aeson(0,7,0)
@@ -97,7 +103,7 @@ number :: Scientific -> YamlBuilder
97number = scientific
103number = scientific
99number :: Number -> YamlBuilder
105number :: Number -> YamlBuilder
100−number n rest = YamlBuilder (EventScalar (S8.pack $ show n) IntTag PlainNoTag Nothing :)
106+number n = YamlBuilder (EventScalar (S8.pack $ show n) IntTag PlainNoTag Nothing :)
103bool :: Bool -> YamlBuilder
109bool :: Bool -> YamlBuilder