Type.Prelude
- Package
- purescript-typelevel-prelude
- Repository
- purescript/purescript-typelevel-prelude
Re-exports from Type.Data.Boolean
#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
#IsOrdering Source
class IsOrdering (ordering :: Ordering) where
Class for reflecting a type level Ordering
at the value level
Members
reflectOrdering :: OProxy ordering -> Ordering
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
#Append
#Compare
#IsSymbol Source
class IsSymbol (sym :: Symbol) where
A class for known symbols
Members
reflectSymbol :: SProxy sym -> String
#reifySymbol Source
reifySymbol :: forall r. String -> (forall sym. IsSymbol sym => SProxy sym -> r) -> r
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
TypeEquals a a
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
#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.