HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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

Types

2 declarations

Located types

18 declarations
datadata Located a
#

A value annotated with its text file position

Constructors

Instances5Functor, Foldable, Traversable, Read, Show
  • Functor LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

  • Foldable LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

  • Traversable LocatedDefined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

  • Read a => Read (Located a)Defined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

  • Show a => Show (Located a)Defined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

datadata Position
#

A position in a text file

Constructors

Instances4Eq, Ord, Read, Show
  • Eq PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

  • Ord PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

  • Read PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

  • Show PositionDefined in toml-parser-2.0.0.0 · Toml.Syntax.Position

    Default instance

newtypenewtype Table' a
#

A table with annotated keys and values.

Constructors

Instances9Functor, Foldable, Traversable, FromValue, Eq, Read, …
  • Functor Table'Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Derived

  • Foldable Table'Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Derived

  • Traversable Table'Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Derived

  • FromValue TableDefined in toml-parser-2.0.0.0 · Toml.Schema.FromValue
  • Eq a => Eq (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Default instance

  • Read a => Read (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Default instance

  • Show a => Show (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Default instance

  • ToTable (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Schema.ToValue
  • ToValue (Table' a)Defined in toml-parser-2.0.0.0 · Toml.Schema.ToValue
datadata Value' a
#

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.Types

    Derived

  • Foldable Value'Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Derived

  • Traversable Value'Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Derived

  • FromValue ValueDefined in toml-parser-2.0.0.0 · Toml.Schema.FromValue

    Matches all values, used for pass-through

  • ToValue ValueDefined in toml-parser-2.0.0.0 · Toml.Schema.ToValue

    Identity function

  • Eq a => Eq (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Nearly default instance except ZonedTime doesn't have an Eq instance. ZonedTime values are equal if their times and time-zones are both equal.

  • Read a => Read (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Default instance

  • Show a => Show (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Default instance

  • () ~ a => IsString (Value' a)Defined in toml-parser-2.0.0.0 · Toml.Semantics.Types

    Constructs a TOML string literal.

    fromString = String
    
valuevalueAnn :: Value' a -> a
#

Extract the top-level annotation from a value.

Parsing

5 declarations
datadata DecodeError
#

Sum of errors that can occur during TOML decoding

datadata Result e a
#

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.

Constructors

Instances4Eq, Ord, Read, Show
  • (Eq e, Eq a) => Eq (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance

  • (Ord e, Ord a) => Ord (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance

  • (Read e, Read a) => Read (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance

  • (Show e, Show a) => Show (Result e a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance

Printing

3 declarations
valueprettyToml
  1. :: Table' a

    table to print

  2. -> TomlDoc

    TOML syntax

#

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.

datadata DocClass
#

Annotation used to enable styling pretty-printed TOML

Constructors

Instances4Eq, Ord, Read, Show
  • Eq DocClassDefined in toml-parser-2.0.0.0 · Toml.Pretty
  • Ord DocClassDefined in toml-parser-2.0.0.0 · Toml.Pretty
  • Read DocClassDefined in toml-parser-2.0.0.0 · Toml.Pretty
  • Show DocClassDefined in toml-parser-2.0.0.0 · Toml.Pretty

Error rendering

4 declarations