Module

Type.Row

Package
purescript-typelevel-prelude
Repository
purescript/purescript-typelevel-prelude

#RProxy Source

data RProxy (row :: # Type)

Constructors

#RLProxy Source

data RLProxy (rowList :: RowList)

Constructors

#ListToRow Source

class ListToRow (list :: RowList) (row :: # Type) | list -> row

Convert a RowList to a row of types. The inverse of this operation is RowToList.

Instances

#RowListRemove Source

class RowListRemove (label :: Symbol) (input :: RowList) (output :: RowList) | label input -> output

Remove all occurences of a given label from a RowList

Instances

#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

#RowListNub Source

class RowListNub (input :: RowList) (output :: RowList) | input -> output

Remove label duplicates, keeps earlier occurrences.

Instances

#RowListAppend Source

class RowListAppend (lhs :: RowList) (rhs :: RowList) (out :: RowList) | lhs rhs -> out

Instances

#RowApply Source

type RowApply (f :: # Type -> # Type) (a :: # Type) = f a

Type application for rows.

#type (+) Source

Operator alias for Type.Row.RowApply (right-associative / precedence 0)

Applies a type alias of open rows to a set of rows. The primary use case this operator is as convenient sugar for combining open rows without parentheses.

type Rows1 r = (a :: Int, b :: String | r)
type Rows2 r = (c :: Boolean | r)
type Rows3 r = (Rows1 + Rows2 + r)
type Rows4 r = (d :: String | Rows1 + Rows2 + r)

Re-exports from Prim.Row

#Cons

class Cons (label :: Symbol) (a :: Type) (tail :: # Type) (row :: # Type) | label a tail -> row, label row -> a tail

The Cons type class is a 4-way relation which asserts that one row of types can be obtained from another by inserting a new label/type pair on the left.

#Lacks

class Lacks (label :: Symbol) (row :: # Type) 

The Lacks type class asserts that a label does not occur in a given row.

#Nub

class Nub (original :: # Type) (nubbed :: # Type) | original -> nubbed

The Nub type class is used to remove duplicate labels from rows.

#Union

class Union (left :: # Type) (right :: # Type) (union :: # Type) | left right -> union, right union -> left, union left -> right

The Union type class is used to compute the union of two rows of types (left-biased, including duplicates).

The third type argument represents the union of the first two.

Re-exports from Prim.RowList

#Nil

data Nil :: RowList

The empty RowList.

#Cons

data Cons :: Symbol -> Type -> RowList -> RowList

Constructs a new RowList from a label, a type, and an existing tail RowList. E.g: Cons "x" Int (Cons "y" Int Nil).

#RowToList

class RowToList (row :: # Type) (list :: RowList) | row -> list

Compiler solved type class for generating a RowList from a closed row of types. Entries are sorted by label and duplicates are preserved in the order they appeared in the row.

#RowList

kind RowList

A type level list representation of a row of types.