Module

Type.Prelude

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

Re-exports from Type.Data.Boolean

#True

data True :: Boolean

The 'True' boolean type.

#False

data False :: Boolean

The 'False' boolean type.

#BProxy Source

data BProxy (bool :: Boolean)

Value proxy for Boolean types

Constructors

#IsBoolean Source

class IsBoolean (bool :: Boolean)  where

Class for reflecting a type level Boolean at the value level

Members

Instances

#reifyBoolean Source

reifyBoolean :: forall r. Boolean -> (forall o. IsBoolean o => BProxy o -> r) -> r

Use a value level Boolean as a type-level Boolean

Re-exports from Type.Data.Ordering

#OProxy Source

data OProxy (ordering :: Ordering)

Value proxy for Ordering types

Constructors

#LT

data LT :: Ordering

The 'less than' ordering type.

#GT

data GT :: Ordering

The 'greater than' ordering type.

#EQ

data EQ :: Ordering

The 'equal to' ordering type.

#IsOrdering Source

class IsOrdering (ordering :: Ordering)  where

Class for reflecting a type level Ordering at the value level

Members

Instances

#reifyOrdering Source

reifyOrdering :: forall r. Ordering -> (forall o. IsOrdering o => OProxy o -> r) -> r

Use a value level Ordering as a type-level Ordering

Re-exports from Type.Data.Symbol

#SProxy Source

data SProxy (sym :: Symbol)

A value-level proxy for a type-level symbol.

Constructors

#Append

class Append (left :: Symbol) (right :: Symbol) (appended :: Symbol) | left right -> appended, right appended -> left, appended left -> right

Compiler solved type class for appending Symbols together.

#Compare

class Compare (left :: Symbol) (right :: Symbol) (ordering :: Ordering) | left right -> ordering

Compiler solved type class for comparing two Symbols. Produces an Ordering.

#IsSymbol Source

class IsSymbol (sym :: Symbol)  where

A class for known symbols

Members

#reifySymbol Source

reifySymbol :: forall r. String -> (forall sym. IsSymbol sym => SProxy sym -> r) -> r

#compare Source

compare :: forall o r l. Compare l r o => SProxy l -> SProxy r -> OProxy o

#append Source

append :: forall o r l. Append l r o => SProxy l -> SProxy r -> SProxy o

Re-exports from Type.Equality

#TypeEquals Source

class TypeEquals a b | a -> b, b -> a where

This type class asserts that types a and b are equal.

The functional dependencies and the single instance below will force the two type arguments to unify when either one is known.

Note: any instance will necessarily overlap with refl below, so instances of this class should not be defined in libraries.

Members

Instances

Re-exports from Type.Proxy

Re-exports from Type.Row

#RProxy Source

data RProxy (row :: Row Type)

A proxy data type whose type parameter is a type of kind # Type (a row of types).

Commonly used for specialising a function with a quantified type. For example, suppose we have an identity function for records of type:

recordIdentity :: forall row . RProxy row -> Record row -> Record row
recordIdentity _ rec = rec

Then applying this function to an RProxy with a specialised type allows us to specify a concrete type for row:

:t recordIdentity (RProxy :: RProxy ( x :: Int, y :: Int ))
{ x :: Int, y :: Int } -> { x :: Int, y :: Int }

Here row has been specialised to ( x :: Int, y :: Int ).

Constructors

#Lacks

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

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

#Union

class Union (left :: Row Type) (right :: Row Type) (union :: Row 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 Type.RowList

#RLProxy Source

data RLProxy (rowlist :: RowList)

A proxy data type whose type parameter is a type of kind RowList.

Commonly used for specialising a function with a quantified type.

Constructors

#ListToRow Source

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

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

Instances

#RowToList

class RowToList (row :: 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.