shrun-0.9: A utility program for running shell commands concurrently.
Safe HaskellNone
LanguageGHC2021

Shrun.Configuration.Toml.Legend

Description

Provides types for the legend.

Synopsis

Documentation

type LegendMap = HashMap Text (NESeq Text) Source #

Alias for our legend map.

data KeyVal where Source #

Holds a map key/val pair. The maintained invariants are:

  • key is non-empty.
  • val is non-empty.
  • all v_i in val are non-empty.

Bundled Patterns

pattern MkKeyVal :: Text -> NESeq Text -> KeyVal

Unidirectional pattern synonym for KeyVal.

Instances

Instances details
Show KeyVal Source # 
Instance details

Defined in Shrun.Configuration.Toml.Legend

Eq KeyVal Source # 
Instance details

Defined in Shrun.Configuration.Toml.Legend

Methods

(==) :: KeyVal -> KeyVal -> Bool #

(/=) :: KeyVal -> KeyVal -> Bool #

DecodeTOML KeyVal Source # 
Instance details

Defined in Shrun.Configuration.Toml.Legend

(k ~ A_Getter, a ~ Text, b ~ Text) => LabelOptic "key" k KeyVal KeyVal a b Source # 
Instance details

Defined in Shrun.Configuration.Toml.Legend

(k ~ A_Getter, a ~ NESeq Text, b ~ NESeq Text) => LabelOptic "val" k KeyVal KeyVal a b Source # 
Instance details

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 in vals are non-empty.

unsafeKeyVal :: HasCallStack => Text -> List Text -> KeyVal Source #

Variant of UnsafeKeyVal that throws an error on failures.