Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- encodeYamlViaCodec :: HasCodec a => a -> ByteString
- eitherDecodeYamlViaCodec :: HasCodec a => ByteString -> Either ParseException a
- readYamlConfigFile :: HasCodec a => Path r File -> IO (Maybe a)
- readFirstYamlConfigFile :: forall a r. HasCodec a => [Path r File] -> IO (Maybe a)
- renderColouredSchemaViaCodec :: forall a. HasCodec a => Text
- renderColouredSchemaVia :: ValueCodec input output -> Text
- renderPlainSchemaViaCodec :: forall a. HasCodec a => Text
- renderPlainSchemaVia :: ValueCodec input output -> Text
- schemaChunksViaCodec :: forall a. HasCodec a => [Chunk]
- schemaChunksVia :: ValueCodec input output -> [Chunk]
- jsonSchemaChunks :: JSONSchema -> [Chunk]
- toYamlViaCodec :: HasCodec a => a -> YamlBuilder
- toYamlVia :: ValueCodec a void -> a -> YamlBuilder
- module Autodocodec.Yaml.Schema
- module Autodocodec.Yaml.IO
- module Autodocodec.Yaml.Encode
Encoding and decoding Yaml
encodeYamlViaCodec :: HasCodec a => a -> ByteString Source #
Encode a value as a Yaml ByteString
via its type's codec
.
eitherDecodeYamlViaCodec :: HasCodec a => ByteString -> Either ParseException a Source #
Parse a Yaml ByteString
using a 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 #
schemaChunksVia :: ValueCodec input output -> [Chunk] Source #
Produce potentially-coloured Chunk
s for a human-readable schema for a given codec.
jsonSchemaChunks :: JSONSchema -> [Chunk] Source #
Render a JSONSchema
as Chunk
s
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.
module Autodocodec.Yaml.Schema
module Autodocodec.Yaml.IO
module Autodocodec.Yaml.Encode