HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduletoml-parser-2.0.0.0Haskell2010

Toml.Schema.Matcher

This type helps to build up computations that can validate a TOML value and compute some application-specific representation.

It supports warning messages which can be used to deprecate old configuration options and to detect unused table keys.

It supports tracking multiple error messages when you have more than one decoding option and all of them have failed.

Use Toml.Pretty.prettyMatchMessage for an easy way to make human readable strings from matcher outputs.

  • 4 types
  • 10 values

Types

3 declarations
newtypenewtype Matcher l a
#

Computations that result in a Result and which track a list of nested contexts to assist in generating warnings and error messages.

Use withScope to run a Matcher in a new, nested scope.

Instances6Monad, Functor, MonadFail, Applicative, Alternative, MonadPlus
  • Monad (Matcher a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher
  • Functor (Matcher a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher
  • MonadFail (Matcher a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Fail with an error message without an annotation.

  • Applicative (Matcher a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher
  • Alternative (Matcher a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher
  • MonadPlus (Matcher a)Defined in toml-parser-2.0.0.0 · Toml.Schema.Matcher
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

datadata MatchMessage a
#

A message emitted while matching a TOML value. The message is paired with the path to the value that was in focus when the message was generated. These message get used for both warnings and errors.

For a convenient way to render these to a string, see Toml.Pretty.prettyMatchMessage.

Constructors

Instances7Functor, Foldable, Traversable, Eq, Ord, Read, …

Operations

6 declarations
valuefailAt :: l -> String -> Matcher l a
#

Terminate the match with an error mentioning the given annotation.

Run helpers

2 declarations

Scope helpers

3 declarations
datadata Scope
#

Scopes for TOML message.

Constructors

Instances4Eq, Ord, Read, Show
  • Eq ScopeDefined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance

  • Ord ScopeDefined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance

  • Read ScopeDefined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance

  • Show ScopeDefined in toml-parser-2.0.0.0 · Toml.Schema.Matcher

    Default instance