A Table' with trivial annotations
Moduletoml-parser-2.0.0.0Haskell2010
Toml
This is the high-level interface to the toml-parser library. It enables parsing, printing, and conversion 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.
Use Toml.Schema to implement functions mapping between TOML values and your application types.
Use Toml.Syntax and Toml.Semantics for low-level TOML syntax processing and semantic validation. Most applications will not need to use these modules directly unless the application is about TOML itself.
The types and functions of this package are parameterized over an annotation type in order to allow applications to provide detailed feedback messages tracked back to specific source locations in an original TOML file. While the default annotation is a simple file position, some applications might upgrade this annotation to track multiple file names or synthetically generated sources. Other applications won't need source location and can replace annotations with a simple unit type.
- 9 types
- 13 values
- Packagetoml-parser-2.0.0.0
- Exports32
- LanguageHaskell2010
- LicenceISC
- SourceToml.hs
Types
2 declarationsA Value' with trivial annotations
Located types
18 declarationsA value annotated with its text file position
Constructors
LocatedlocPosition :: !Positionposition
locThing :: !athing at position
Instances5Functor, Foldable, Traversable, Read, Show
Functor LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Foldable LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Traversable LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Read a => Read (Located a)Defined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Show a => Show (Located a)Defined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
A position in a text file
Instances4Eq, Ord, Read, Show
Eq PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Ord PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Read PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Show PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.PositionDefault instance
Instances9Functor, Foldable, Traversable, FromValue, Eq, Read, …
Functor Table'Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDerived
Foldable Table'Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDerived
Traversable Table'Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDerived
FromValue TableDefined in toml-parser-2.0.0.0 · Toml.Schema.FromValueEq a => Eq (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDefault instance
Read a => Read (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDefault instance
Show a => Show (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDefault instance
ToTable (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Schema.ToValueToValue (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Schema.ToValue
Semantic TOML value with all table assignments resolved.
Instances9Functor, Foldable, Traversable, FromValue, ToValue, Eq, …
Functor Value'Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDerived
Foldable Value'Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDerived
Traversable Value'Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDerived
FromValue ValueDefined in toml-parser-2.0.0.0 · Toml.Schema.FromValueMatches all values, used for pass-through
ToValue ValueDefined in toml-parser-2.0.0.0 · Toml.Schema.ToValueIdentity function
Eq a => Eq (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesRead a => Read (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDefault instance
Show a => Show (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesDefault instance
() ~ a => IsString (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.TypesConstructs a TOML string literal.
fromString = String
Extract the top-level annotation from a value.
String representation of the kind of value using TOML vocabulary
Replaces annotations with a unit.
Replaces annotations with a unit.
Parsing
5 declarationsDecode TOML syntax into an application value.
Wrapper rending error and warning messages into human-readable strings.
Parse a TOML formatted String or report a human-readable error message.
Sum of errors that can occur during TOML decoding
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.
Instances4Eq, Ord, Read, Show
(Eq e, Eq a) => Eq (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.MatcherDefault instance
(Ord e, Ord a) => Ord (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.MatcherDefault instance
(Read e, Read a) => Read (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.MatcherDefault instance
(Show e, Show a) => Show (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.MatcherDefault instance
Printing
3 declarationsUse the ToTable instance to encode a value to a TOML string.
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
Constructors
TableClasstop-level
[key]and[[key]]KeyClassdotted keys, left-hand side of assignments
StringClassstring literals
NumberClassnumber literals
DateClassdate and time literals
BoolClassboolean literals
Error rendering
4 declarationsHuman-readable representation of a DecodeError
Pretty-print as line:col: message
Render a TOML decoding error as a human-readable string.
Render a semantic TOML error in a human-readable string.