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.Type.Edsl

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

This module introduces EDSL for manually specifying TOML data types.

Consider the following raw TOML:

key1 = 1
key2 = true

[meme-quotes]
  quote1 = [ "Oh", "Hi", "Mark" ]

[[arrayName]]
  elem1 = "yes"

[[arrayName]]
  [arrayName.elem2]
    deep = 7

[[arrayName]]

using functions from this module you can specify the above TOML in safer way:

exampleToml :: TOML
exampleToml = mkToml $ do
    "key1" =: 1
    "key2" =: Bool True
    table "meme-quotes" $
        "quote1" =: Array ["Oh", "Hi", "Mark"]
    tableArray "arrayName" $
        "elem1" =: "yes" :|
        [ table "elem2" $ "deep" =: Integer 7
        , empty
        ]
  • 1 type
  • 5 values
  • Packagetomland-1.3.3.3
  • Exports6
  • LanguageHaskell2010
  • LicenceMPL-2.0
  • SourceEdsl.hs