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.Table

Contents

- Tables
- Error Helpers

Description

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

Tables can be represented in `TOML` in one of the following ways:

    foo =
        { x = ...
        , y = ...
        , ...
        }

Or

    [foo]
        x = ...
        y = ...
        ...

Since: 1.3.0.0

Synopsis

- table :: TomlCodec a -> Key -> TomlCodec a
- handleTableErrors :: TomlCodec a -> Key -> TOML -> Validation [TomlDecodeError] a
- mapTableErrors :: Key -> [TomlDecodeError] -> [TomlDecodeError]

# Tables

table :: TomlCodec a -> Key -> TomlCodec a #

Codec for tables. Use it when when you have nested objects.

Since: 0.2.0

# Error Helpers

handleTableErrors :: TomlCodec a -> Key -> TOML -> Validation [TomlDecodeError] a #

Maps errors in tables with `mapTableErrors`

Since: 1.3.0.0

mapTableErrors :: Key -> [TomlDecodeError] -> [TomlDecodeError] #

Prepends given key to all errors that contain key. This function is used to give better error messages. So when error happens we know all pieces of table key, not only the last one.

Since: 0.2.0