Safe Haskell | None |
---|---|
Language | Haskell2010 |
Type of TOML AST. This is intermediate representation of TOML parsed from text.
Synopsis
- data TOML = TOML {
- tomlPairs :: HashMap Key AnyValue
- tomlTables :: PrefixMap TOML
- tomlTableArrays :: HashMap Key (NonEmpty TOML)
- insertKeyVal :: Key -> Value a -> TOML -> TOML
- insertKeyAnyVal :: Key -> AnyValue -> TOML -> TOML
- insertTable :: Key -> TOML -> TOML -> TOML
- insertTableArrays :: Key -> NonEmpty TOML -> TOML -> TOML
Documentation
Represents TOML configuration value.
For example, if we have the following TOML
file:
server.port = 8080 server.codes = [ 5, 10, 42 ] server.description = "This is production server." [mail] host = "smtp.gmail.com" send-if-inactive = false [[user]] id = 42 [[user]] name = "Foo Bar"
corresponding TOML
looks like:
TOML { tomlPairs = fromList [ ( "server" :| [ "port" ] , Integer 8080) , ( "server" :| [ "codes" ] , Array [ Integer 5 , Integer 10 , Integer 42]) , ( "server" :| [ "description" ] , Text "This is production server.") ] , tomlTables = fromList [ ( "mail" , Leaf ( "mail" :| [] ) ( TOML { tomlPairs = fromList [ ( "host" :| [] , Text "smtp.gmail.com") , ( "send-if-inactive" :| [] , Bool False) ] , tomlTables = fromList [] , tomlTableArrays = fromList [] } ) ) ] , tomlTableArrays = fromList [ ( "user" :| [] , TOML { tomlPairs = fromList [( "id" :| [] , Integer 42)] , tomlTables = fromList [] , tomlTableArrays = fromList [] } :| [ TOML { tomlPairs = fromList [( "name" :| [] , Text "Foo Bar")] , tomlTables = fromList [] , tomlTableArrays = fromList [] } ] ) ] }
TOML | |
|
Instances
Eq TOML Source # | |
Show TOML Source # | |
Generic TOML Source # | |
Semigroup TOML Source # | |
Monoid TOML Source # | |
NFData TOML Source # | |
Defined in Toml.Type.TOML | |
type Rep TOML Source # | |
Defined in Toml.Type.TOML type Rep TOML = D1 (MetaData "TOML" "Toml.Type.TOML" "tomland-1.0.0-inplace" False) (C1 (MetaCons "TOML" PrefixI True) (S1 (MetaSel (Just "tomlPairs") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (HashMap Key AnyValue)) :*: (S1 (MetaSel (Just "tomlTables") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (PrefixMap TOML)) :*: S1 (MetaSel (Just "tomlTableArrays") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (HashMap Key (NonEmpty TOML)))))) |