Set package:tomland

TOML-specific combinators for converting between TOML and Haskell Set-like data types. There are two way to represent list-like structures with the tomland library.
  • Ordinary array sets of primitives:
    foo = [100, 200, 300]
    
  • Sets via tables:
    foo = [ {x = 100} , {x = 200} , {x = 300} ]
    OR [[foo]] x = 100 [[foo]] x = 200 [[foo]] x = 300 
You can find both types of the codecs in this module for different set-like structures. See the following table for the better understanding: TODO: table
Codec for set of values. Represented in TOML as array of tables. Example: Haskell Set Int can look like this in your TOML file:
foo =
[ {a = 1}
, {a = 2}
]
Decodes to an empty Set in case of the missing field in TOML.
Changes name of table to a new one. Works only for TableName and TableArrayName constructors.
Takes a BiMap of a value and returns a BiMap for a HashSet of values and AnyValue as an array. Usually used as the arrayHashSetOf combinator.
IntSet bimap for AnyValue. Usually used as the arrayIntSet combinator.
Takes a BiMap of a value and returns a BiMap for a Set of values and AnyValue as an array. Usually used as the arraySetOf combinator.
Codec for hash sets. Takes converter for single hashable value and returns a set of hashable values. Example: Haskell HashSet Int can look like this in your TOML file:
foo = [1, 2, 3]
In case of the missing field, the following error will be seen:
tomland decode error:  Key foo is not found
Codec for sets of ints. Takes converter for single value and returns a set of ints. Example: Haskell IntSet can look like this in your TOML file:
foo = [1, 2, 3]
In case of the missing field, the following error will be seen:
tomland decode error:  Key foo is not found
Codec for sets. Takes converter for single value and returns a set of values. Example: Haskell Set Int can look like this in your TOML file:
foo = [1, 2, 3]
In case of the missing field, the following error will be seen:
tomland decode error:  Key foo is not found
Codec for HashSet of values. Represented in TOML as an array of tables. Example: Haskell HashSet Int can look like this in your TOML file:
foo =
[ {a = 1}
, {a = 2}
]
Decodes to an empty HashSet in case of the missing field in TOML.
Codec for IntSet. Represented in TOML as an array of tables. Example: Haskell IntSet can look like this in your TOML file:
foo =
[ {a = 1}
, {a = 2}
]
Decodes to an empty IntSet in case of the missing field in TOML.