autodocodec-yaml-0.2.0.3: Autodocodec interpreters for yaml
Safe HaskellSafe-Inferred
LanguageHaskell2010

Autodocodec.Yaml

Synopsis

Encoding and decoding Yaml

encodeYamlViaCodec :: HasCodec a => a -> ByteString Source #

Encode a value as a Yaml ByteString via its type's codec.

Reading Yaml Files

readYamlConfigFile :: HasCodec a => Path r File -> IO (Maybe a) Source #

Helper function to read a yaml file for a type in HasCodec

This will output a colourful yaml schema if parsing fails.

readFirstYamlConfigFile :: forall a r. HasCodec a => [Path r File] -> IO (Maybe a) Source #

Helper function to read the first in a list of yaml files for a type is HasCodec

This will output a colourful yaml schema if parsing fails.

Producing a Yaml schema

renderColouredSchemaViaCodec :: forall a. HasCodec a => Text Source #

Render a human-readable schema for a type's codec, in colour.

renderColouredSchemaVia :: ValueCodec input output -> Text Source #

Render a human-readable schema for a given codec, in colour.

renderPlainSchemaViaCodec :: forall a. HasCodec a => Text Source #

Render a human-readable schema for a type's codec, without colour.

renderPlainSchemaVia :: ValueCodec input output -> Text Source #

Render a human-readable schema for a given codec, without colour.

schemaChunksViaCodec :: forall a. HasCodec a => [Chunk] Source #

Produce potentially-coloured Chunks for a human-readable schema for a type's codec.

schemaChunksVia :: ValueCodec input output -> [Chunk] Source #

Produce potentially-coloured Chunks for a human-readable schema for a given codec.

Instantiating ToYaml

toYamlViaCodec :: HasCodec a => a -> YamlBuilder Source #

Implement toYaml using a type's codec

toYamlVia :: ValueCodec a void -> a -> YamlBuilder Source #

Implement toYaml using a given codec

To makes sure we definitely export everything.