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

Moduletomland-1.3.3.3Haskell2010

Toml.Parser.Validate

SPDX-License-Identifier : MPL-2.0 Maintainer : Kowainik xrom.xkov@gmail.com Stability : Stable Portability : Portable

This module contains functions that aggregate the result of tomlP parser into TOML. This approach allows to keep parser fast and simple and delegate the process of creating tree structure to a separate function.

  • 1 type
  • 4 values
  • Packagetomland-1.3.3.3
  • Exports5
  • LanguageHaskell2010
  • LicenceMPL-2.0
  • SourceValidate.hs

Decoding

2 declarations
datadata ValidationError
#

Error that happens during validating TOML which is already syntactically correct. For the list of all possible validation errors and their explanation, see the following issue on GitHub:

Instances2Eq, Show

Internal helpers

3 declarations

This function takes flat list of TomlItems and groups it into list of Trees by putting all corresponding items inside tables and table arrays. It doesn't perform any validation, just groups items according to prefixes of their keys. So, for example, if you have the following keys as flat list:

aaa              # ordinary key
aaa.bbb          # ordinary key
[foo]            # table nam
foo.bar
foo.baz
[xxx]            # table name
[xxx.yyy]        # table name
zzz

the following tree structure will be created:

aaa
aaa.bbb
[foo]
├──── foo.bar
└──── foo.baz
[xxx]
└──── [yyy]
      └──── zzz
valuegroupWithParent
  1. :: Maybe Key

    Parent name

  2. -> [TomlItem]

    List of items

  3. -> (Forest TomlItem, [TomlItem])

    Forest of times and remaining items

#

This function groups list of TOML items into Forest and returns list of items that are not children of specified parent.

Invariant: When this function is called with Nothing, second element in the result tuple should be empty list.