tomland-0.2.1: TOML parser

Safe HaskellNone
LanguageHaskell2010

Toml.Bi.Code

Contents

Synopsis

Types

type BiToml a = Bi Env St a Source #

Specialied Bi type alias for Toml monad. Keeps TOML object either as environment or state.

type Env = ExceptT DecodeException (Reader TOML) Source #

Immutable environment for Toml conversion. This is r type variable in Bijection data type.

type St = State TOML Source #

Mutable context for Toml conversion. This is w type variable in Bijection data type.

Exceptions

data DecodeException Source #

Type of exception for converting from Toml to user custom data type.

Constructors

KeyNotFound Key

No such key

TableNotFound Key

No such table

TypeMismatch Key Text ValueType

Expected type vs actual type

ParseError ParseException

Exception during parsing

prettyException :: DecodeException -> Text Source #

Converts DecodeException into pretty human-readable text.

Encode/Decode

decode :: BiToml a -> Text -> Either DecodeException a Source #

Convert textual representation of toml into user data type.

encode :: BiToml a -> a -> Text Source #

Convert object to textual representation.