Copyright | (c) Eric Mertens 2023 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This is the high-level interface to the toml-parser library. It enables parsing, printing, and coversion into and out of application-specific representations.
This parser implements TOML 1.0.0 https://toml.io/en/v1.0.0 as carefully as possible.
Types
Semantic TOML value with all table assignments resolved.
Integer Integer | |
Float Double | |
Array [Value] | |
Table Table | |
Bool Bool | |
String String | |
TimeOfDay TimeOfDay | |
ZonedTime ZonedTime | |
LocalTime LocalTime | |
Day Day |
Instances
Parsing
parse :: String -> Either String Table Source #
Parse a TOML formatted Value
or report an error message.
Printing
Render a complete TOML document using top-level table and array of table sections where possible.
Keys are sorted alphabetically. To provide a custom ordering, see
prettyTomlOrdered
.
Annotation used to enable styling pretty-printed TOML
TableClass | top-level |
KeyClass | dotted keys, left-hand side of assignments |
StringClass | string literals |
NumberClass | number literals |
DateClass | date and time literals |
BoolClass | boolean literals |
Serialization
decode :: FromValue a => String -> Result String a Source #
Use the FromValue
instance to decode a value from a TOML string.
encode :: ToTable a => a -> TomlDoc Source #
Use the ToTable
instance to encode a value to a TOML string.
Computation outcome with error and warning messages. Multiple error messages can occur when multiple alternatives all fail. Resolving any one of the error messages could allow the computation to succeed.
Since: 1.3.0.0
Instances
(Read e, Read a) => Read (Result e a) Source # | Default instance |
(Show e, Show a) => Show (Result e a) Source # | Default instance |
(Eq e, Eq a) => Eq (Result e a) Source # | Default instance |
(Ord e, Ord a) => Ord (Result e a) Source # | Default instance |