Copyright | (c) 2018-2022 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Stability | Stable |
Portability | Portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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 Type | TOML | TomlCodec |
---|---|---|
Bool | a = true | bool "a" |
Integer | a = 100 | integer "a" |
Int | a = -42 | int "a" |
Natural | a = 11 | natural "a" |
Word | a = 1 | word "a" |
Word8 | a = 1 | word8 "a" |
Double | a = 36.6 | double "a" |
Float | a = -100.09 | float "a" |
String | a = "Hello" | string "a" |
Text | a = "Hello" | text "a" |
LazyText | a = "Hey" | lazyText "a" |
ByteString | a = "Hello" | byteString "a" |
LazyByteString | a = "Hey" | lazyByteString "a" |
ByteString as Array | a = [10, 15] | byteStringArray "a" |
LazyByteString as Array | a = [15, 10] | lazyByteStringArray "a" |
Since: 1.3.0.0
Synopsis
- bool :: Key -> TomlCodec Bool
- integer :: Key -> TomlCodec Integer
- int :: Key -> TomlCodec Int
- natural :: Key -> TomlCodec Natural
- word :: Key -> TomlCodec Word
- word8 :: Key -> TomlCodec Word8
- double :: Key -> TomlCodec Double
- float :: Key -> TomlCodec Float
- string :: Key -> TomlCodec String
- text :: Key -> TomlCodec Text
- lazyText :: Key -> TomlCodec Text
- byteString :: Key -> TomlCodec ByteString
- lazyByteString :: Key -> TomlCodec ByteString
- byteStringArray :: Key -> TomlCodec ByteString
- lazyByteStringArray :: Key -> TomlCodec ByteString
Boolean
Integral numbers
Floating point numbers
double :: Key -> TomlCodec Double Source #
Codec for floating point values with double precision.
Since: 0.0.0
Text types
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