Configures the pretty printer.
Constructors
PrintOptionsprintOptionsSorting :: !Maybe (Key -> Key -> Ordering)How table keys should be sorted, if at all.
printOptionsIndent :: !IntNumber of spaces by which to indent.
printOptionsLines :: !Lines
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Moduletomland-1.3.3.3Haskell2010
SPDX-License-Identifier : MPL-2.0 Maintainer : Kowainik xrom.xkov@gmail.com Stability : Stable Portability : Portable
Contains functions for pretty printing toml types.
Configures the pretty printer.
PrintOptionsprintOptionsSorting :: !Maybe (Key -> Key -> Ordering)How table keys should be sorted, if at all.
printOptionsIndent :: !IntNumber of spaces by which to indent.
printOptionsLines :: !LinesDefault printing options.
Sorts all keys and tables by name.
Indents with 2 spaces.
Converts TOML type into Text (using defaultOptions).
For example, this
TOML
{ tomlPairs = HashMap.fromList
[("title", AnyValue $ Text "TOML example")]
, tomlTables = PrefixTree.fromList
[( "example" <| "owner"
, mempty
{ tomlPairs = HashMap.fromList
[("name", AnyValue $ Text Kowainik)]
}
)]
, tomlTableArrays = mempty
}
will be translated to this
title = "TOML Example"
[example.owner]
name = "Kowainik"
Converts TOML type into Text using provided PrintOptions
Converts a key to text