tomland-1.3.1.0: Bidirectional TOML serialization
Copyright(c) 2018-2020 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Toml.Codec.Combinator

Description

Contains TOML-specific combinators for converting between TOML and user data types.

Synopsis

Basic codecs for primitive values

TOML-specific combinators for converting between TOML and Haskell primitive types, e.g. int <-> Int, byteString <-> ByteString.

See the Toml.Codec.Combinators.Primitive module documentation for the overview table and more examples.

Time types

TOML-specific combinators for converting between TOML and Haskell date and time data types. TOML specification describes date and time primitives you can use in your configuration. tomland provides mapping of those primitives to types from the time library.

See the Toml.Codec.Combinators.Time module documentation for the overview table and more examples.

Combinators for tables

Combinators for the TOML tables.

See the Toml.Codec.Combinators.Table module documentation for more examples.

Codecs for containers of primitives

Lists

TOML-specific combinators for converting between TOML and Haskell list-like data types.

See the Toml.Codec.Combinators.List module documentation for the overview table and more examples.

Sets

TOML-specific combinators for converting between TOML and Haskell set-like data types.

See the Toml.Codec.Combinators.Set module documentation for the overview table and more examples.

Maps

TOML-specific combinators for converting between TOML and Haskell map-like data types.

See the Toml.Codec.Combinators.Map module documentation for the overview table and more examples.

Tuples

TOML-specific combinators for converting between TOML and Haskell tuples. It's recommended to create your custom data types and implement codecs for them, but if you need to have tuples (e.g. for decoding different constructors of sum types), you can find codecs from this module helpful.

See the Toml.Codec.Combinators.Tuple module documentation for the overview table and more examples.

Codecs for Monoids

TOML-specific combinators for converting between TOML and Haskell Monoid wrapper data types. These codecs are especially handy when you are implementing the Partial Options Monoid pattern.

See the Toml.Codec.Combinators.Monoid module documentation for the overview table and more examples.

Additional codecs for custom types

This module provides additional combinators that could help in the situation when some additional manipulations for the standard combinators is required.

For example, validate allows to perform some custom validation on the codec before encoding. And enumBounded is an automatical codec that uses Enum and Bounded instances of the data type only and provides descriptive error messages at the same time.

See the Toml.Codec.Combinators.Custom module documentation for the overview table and more examples.

General construction of codecs

This module implements common utilities for writing custom codecs without diving into internal implementation details. Most of the time you don't need to implement your own codecs and can reuse existing ones. But if you need something that library doesn't provide, you can find functions in this module useful.

See the Toml.Codec.Combinators.Common module documentation for more examples.