tomland-1.3.3.3: Bidirectional TOML serialization

Copyright | (c) 2018-2022 Kowainik
License | MPL-2.0
Maintainer | Kowainik <xrom.xkov@gmail.com>
Stability | Stable
Portability | Portable
Safe Haskell | None
Language | Haskell2010

Toml.Codec.Combinator

Contents

- Basic codecs for primitive values
  - Time types
- Combinators for tables
- Codecs for containers of primitives
  - Lists
  - Sets
  - Maps
  - Tuples
- Codecs for `Monoid`s
- Additional codecs for custom types
- General construction of codecs

Description

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

Synopsis

- module Toml.Codec.Combinator.Primitive
- module Toml.Codec.Combinator.Time
- module Toml.Codec.Combinator.Table
- module Toml.Codec.Combinator.List
- module Toml.Codec.Combinator.Set
- module Toml.Codec.Combinator.Map
- module Toml.Codec.Combinator.Tuple
- module Toml.Codec.Combinator.Monoid
- module Toml.Codec.Combinator.Custom
- module Toml.Codec.Combinator.Common

# 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.Combinator.Primitive module documentation for the overview table and more examples.

module Toml.Codec.Combinator.Primitive

## 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.Combinator.Time module documentation for the overview table and more examples.

module Toml.Codec.Combinator.Time

# Combinators for tables

Combinators for the `TOML` tables.

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

module Toml.Codec.Combinator.Table

# Codecs for containers of primitives

## Lists

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

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

module Toml.Codec.Combinator.List

## Sets

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

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

module Toml.Codec.Combinator.Set

## Maps

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

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

module Toml.Codec.Combinator.Map

## 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.Combinator.Tuple module documentation for the overview table and more examples.

module Toml.Codec.Combinator.Tuple

# Codecs for `Monoid`s

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.Combinator.Monoid module documentation for the overview table and more examples.

module Toml.Codec.Combinator.Monoid

# 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.Combinator.Custom module documentation for the overview table and more examples.

module Toml.Codec.Combinator.Custom

# 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.Combinator.Common module documentation for more examples.

module Toml.Codec.Combinator.Common