Moduletomland-1.3.3.3Haskell2010
Toml
SPDX-License-Identifier : MPL-2.0 Maintainer : Kowainik xrom.xkov@gmail.com Stability : Stable Portability : Portable
This module reexports all functionality of the tomland package. It's
recommended to import this module qualified, like this:
import Toml (TomlCodec, (.=))
import qualified Toml
Simple TomlCodec for a Haskell value, that can be decoded from
TOML or encoded as TOML, could be written in the following way:
data User = User
{ userName :: Text
, userAge :: Int
}
userCodec :: TomlCodec User
userCodec = User
<$> Toml.text "name" .= userName
<*> Toml.int "age" .= userAge
A value of such type will look in TOML like this:
name = Alice
age = 27
For more detailed examples see README.md in the repository:
For the details of the library implementation see blog post:
- Packagetomland-1.3.3.3
- Exports0
- LanguageHaskell2010
- LicenceMPL-2.0
- SourceToml.hs
Main types and functions to implement TOML codecs. This module
provides high-level API of tomland library.
module Toml.Codec
Low-level implementation details of types that power tomland. The
Toml.Type module contains types to represent TOML AST and basic
functions to work with it. This module also contains pretty-printing
API for TOML AST and eDSL for type-safe definition of the TOML
values.
module Toml.Type
Parser for types, defined in Toml.Type. This modules contains low-level functions to parse TOML from text. If you want to convert between Haskell types and TOML representation, use functions from Toml.Codec.
module Toml.Parser