Closed chshersh closed 3 years ago
Sometimes it's required to be able to decode a single key-value pair where only one value is allowed. Like in the example below:
scope = "all"
This is useful for decoding sum types. I propose to add necessary utils for this:
_Hardcoded :: (Eq a, Show a) => a -> TomlBiMap () a
And later users can use this TmlBiMap (for the above example) like this:
TmlBiMap
Toml.match (Toml._Hardcoded "all" >>> Toml._Text) "scope"
Sometimes it's required to be able to decode a single key-value pair where only one value is allowed. Like in the example below:
This is useful for decoding sum types. I propose to add necessary utils for this:
And later users can use this
TmlBiMap
(for the above example) like this: