Copyright | (c) 2018-2022 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Stability | Stable |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
Toml.Type.TOML
Description
Type of TOML AST. This is intermediate representation of TOML parsed from text.
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 [] } ] ) ] }
Since: 0.0.0
Constructors
TOML | |
Instances
insertKeyVal :: forall (a :: TValue). Key -> Value a -> TOML -> TOML #
Inserts given key-value into the TOML
.