From cbfdf3bd5298992dcc496f0773e464a7fe5da040 Mon Sep 17 00:00:00 2001 From: Tom Sydney Kerckhove Date: Sun, 25 Dec 2022 15:47:52 +0100 Subject: [PATCH] Yaml encoding via Yaml.toByteString instead of Yaml.encode --- autodocodec-yaml/src/Autodocodec/Yaml.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autodocodec-yaml/src/Autodocodec/Yaml.hs b/autodocodec-yaml/src/Autodocodec/Yaml.hs index 6606a3a..91d9945 100644 --- a/autodocodec-yaml/src/Autodocodec/Yaml.hs +++ b/autodocodec-yaml/src/Autodocodec/Yaml.hs @@ -35,10 +35,11 @@ import Autodocodec.Yaml.IO import Autodocodec.Yaml.Schema import Data.ByteString import qualified Data.Yaml as Yaml +import qualified Data.Yaml.Builder as Yaml -- | Encode a value as a Yaml 'ByteString' via its type's 'codec'. encodeYamlViaCodec :: HasCodec a => a -> ByteString -encodeYamlViaCodec = Yaml.encode . Autodocodec +encodeYamlViaCodec = Yaml.toByteString . Autodocodec -- | Parse a Yaml 'ByteString' using a type's 'codec'. eitherDecodeYamlViaCodec :: HasCodec a => ByteString -> Either Yaml.ParseException a