htoml-0.2.0.0: Parser for TOML files

Safe HaskellNone
LanguageHaskell2010

Text.Toml.Types

Synopsis

Documentation

type Table = HashMap Text Node Source

The Table is a mapping (HashMap) of Text keys to Node values.

emptyTable :: Table Source

Contruct an empty Table.

data Node Source

A Node may contain any type of value that can put in a VArray.

Instances

Eq Node Source 
Show Node Source 
ToJSON Node Source

ToJSON instances for the Node type that produce Aeson (JSON) in line with the TOML specification.

ToBsJSON Node Source

ToBsJSON instances for the TValue type that produce Aeson (JSON) in line with BurntSushi's language agnostic TOML test suite.

As seen in this function, BurntSushi's JSON encoding explicitly specifies the types of the values.

data Explicitness Source

To mark whether or not a Table has been explicitly defined. See: https://github.com/toml-lang/toml/issues/376

Constructors

Explicit 
Implicit 

isExplicit :: Explicitness -> Bool Source

Convenience function to get a boolean value.

insert :: Explicitness -> ([Text], Node) -> Table -> Parsec Text (Set [Text]) Table Source

Inserts a table, Table, with the namespaced name, '[Text]', (which may be part of a table array) into a Table. It may result in an error in the ParsecT monad for redefinitions.

class ToBsJSON a where Source

Type class for conversion to BurntSushi-style JSON.

BurntSushi has made a language agnostic test suite available that this library uses. This test suit expects that values are encoded as JSON objects with a 'type' and a value member.

Methods

toBsJSON :: a -> Value Source

Instances

ToBsJSON Node Source

ToBsJSON instances for the TValue type that produce Aeson (JSON) in line with BurntSushi's language agnostic TOML test suite.

As seen in this function, BurntSushi's JSON encoding explicitly specifies the types of the values.

ToBsJSON a => ToBsJSON [a] Source

Provide a toBsJSON instance to the NTArray.

ToBsJSON v => ToBsJSON (HashMap Text v) Source

Provide a toBsJSON instance to the NTable.