Module
Type.Row
- Package
- purescript-typelevel-prelude
- Repository
- purescript/purescript-typelevel-prelude
#RowLacking Source
class RowLacking (entry :: Type) (key :: Symbol) (typ :: Type) (row :: Row Type) | entry typ -> key row
If you get "No type class instance was found" for this class, then your
row
shouldn't contain the label key
.
Instances
RowLacking entry key entry row
#Nil Source
data Nil :: RowList
Instances
ListToRow Nil ()
RowListRemove label Nil Nil
RowListNub Nil Nil
(TypeEquals (RLProxy rhs) (RLProxy out)) => RowListAppend Nil rhs out
#Cons Source
data Cons :: Symbol -> Type -> RowList -> RowList
Instances
(ListToRow tail tailRow, RowCons label ty tailRow row) => ListToRow (Cons label ty tail) row
(RowListRemove label tail tailOutput, Equals label key eq, If eq (RLProxy tailOutput) (RLProxy (Cons key head tailOutput)) (RLProxy output)) => RowListRemove label (Cons key head tail) output
(TypeEquals (SProxy label) (SProxy label'), TypeEquals typ typ', RowListRemove label input lacking) => RowListSet label typ input (Cons label' typ' lacking)
(TypeEquals (SProxy label) (SProxy label'), TypeEquals head head', TypeEquals (RLProxy nubbed) (RLProxy nubbed'), RowListRemove label tail removed, RowListNub removed nubbed) => RowListNub (Cons label head tail) (Cons label' head' nubbed')
(RowListAppend tail rhs out', TypeEquals (RLProxy (Cons label head out')) (RLProxy out)) => RowListAppend (Cons label head tail) rhs out
#RowListRemove Source
class RowListRemove (label :: Symbol) (input :: RowList) (output :: RowList) | label input -> output
Remove all occurences of a given label from a RowList
Instances
RowListRemove label Nil Nil
(RowListRemove label tail tailOutput, Equals label key eq, If eq (RLProxy tailOutput) (RLProxy (Cons key head tailOutput)) (RLProxy output)) => RowListRemove label (Cons key head tail) output
#RowListSet Source
class RowListSet (label :: Symbol) (typ :: Type) (input :: RowList) (output :: RowList) | label typ input -> output
Add a label to a RowList after removing other occurences.
Instances
(TypeEquals (SProxy label) (SProxy label'), TypeEquals typ typ', RowListRemove label input lacking) => RowListSet label typ input (Cons label' typ' lacking)
#RowListNub Source
class RowListNub (input :: RowList) (output :: RowList) | input -> output
Remove label duplicates, keeps earlier occurrences.
Instances
RowListNub Nil Nil
(TypeEquals (SProxy label) (SProxy label'), TypeEquals head head', TypeEquals (RLProxy nubbed) (RLProxy nubbed'), RowListRemove label tail removed, RowListNub removed nubbed) => RowListNub (Cons label head tail) (Cons label' head' nubbed')
#RowListAppend Source
class RowListAppend (lhs :: RowList) (rhs :: RowList) (out :: RowList) | lhs rhs -> out
Instances
(TypeEquals (RLProxy rhs) (RLProxy out)) => RowListAppend Nil rhs out
(RowListAppend tail rhs out', TypeEquals (RLProxy (Cons label head out')) (RLProxy out)) => RowListAppend (Cons label head tail) rhs out