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

Toml.Codec.Combinator.Primitive

Description

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

For the overall picture you can see how different types are represented by codecs in the following table:

Haskell TypeTOMLTomlCodec
Boola = truebool "a"
Integera = 100integer "a"
Inta = -42int "a"
Naturala = 11natural "a"
Worda = 1word "a"
Word8a = 1word8 "a"
Doublea = 36.6double "a"
Floata = -100.09float "a"
Stringa = "Hello"string "a"
Texta = "Hello"text "a"
LazyTexta = "Hey"lazyText "a"
ByteStringa = "Hello"byteString "a"
LazyByteStringa = "Hey"lazyByteString "a"
ByteString as Arraya = [10, 15]byteStringArray "a"
LazyByteString as Arraya = [15, 10]lazyByteStringArray "a"

Since: 1.3.0.0

Synopsis

Boolean

bool :: Key -> TomlCodec Bool Source #

Codec for boolean values.

Since: 0.0.0

Integral numbers

integer :: Key -> TomlCodec Integer Source #

Codec for integer values.

Since: 0.1.0

int :: Key -> TomlCodec Int Source #

Codec for integer values.

Since: 0.0.0

natural :: Key -> TomlCodec Natural Source #

Codec for natural values.

Since: 0.5.0

word :: Key -> TomlCodec Word Source #

Codec for word values.

Since: 0.5.0

word8 :: Key -> TomlCodec Word8 Source #

Codec for word8 values.

Since: 1.2.0.0

Floating point numbers

double :: Key -> TomlCodec Double Source #

Codec for floating point values with double precision.

Since: 0.0.0

float :: Key -> TomlCodec Float Source #

Codec for floating point values.

Since: 0.5.0

Text types

string :: Key -> TomlCodec String Source #

Codec for string values.

Since: 0.4.0

text :: Key -> TomlCodec Text Source #

Codec for text values.

Since: 0.3.0

lazyText :: Key -> TomlCodec Text Source #

Codec for lazy text values.

Since: 1.0.0

byteString :: Key -> TomlCodec ByteString Source #

Codec for text values as ByteString.

Since: 0.5.0

lazyByteString :: Key -> TomlCodec ByteString Source #

Codec for text values as ByteString.

Since: 0.5.0

byteStringArray :: Key -> TomlCodec ByteString Source #

Codec for positive integer array values as ByteString.

Since: 1.2.0.0

lazyByteStringArray :: Key -> TomlCodec ByteString Source #

Codec for positive integer array values as lazy ByteString.

Since: 1.2.0.0