Safe Haskell | None |
---|---|
Language | GHC2021 |
Provides types for the legend.
Documentation
Holds a map key/val pair. The maintained invariants are:
key
is non-empty.val
is non-empty.- all
v_i
inval
are non-empty.
Instances
Show KeyVal Source # | |
Eq KeyVal Source # | |
DecodeTOML KeyVal Source # | |
Defined in Shrun.Configuration.Toml.Legend | |
(k ~ A_Getter, a ~ Text, b ~ Text) => LabelOptic "key" k KeyVal KeyVal a b Source # | |
Defined in Shrun.Configuration.Toml.Legend | |
(k ~ A_Getter, a ~ NESeq Text, b ~ NESeq Text) => LabelOptic "val" k KeyVal KeyVal a b Source # | |
Defined in Shrun.Configuration.Toml.Legend |
mkKeyVal :: Text -> List Text -> Maybe KeyVal Source #
Smart constructor for KeyVal
. Given UnsafeKeyVal key vals
, all
conditions must be satisfied for success:
key
is non-empty.vals
is non-empty.- all
v_i
invals
are non-empty.
unsafeKeyVal :: HasCallStack => Text -> List Text -> KeyVal Source #
Variant of UnsafeKeyVal
that throws an error on failures.