Type.Prelude
- Package
- typelevel-prelude
- Repository
- purescript/purescript-typelevel-prelude
Re-exports from Type.Data.Boolean
#IsBoolean Source
class IsBoolean :: Boolean -> Constraint
class IsBoolean bool where
Class for reflecting a type level Boolean
at the value level
Members
reflectBoolean :: forall proxy. proxy bool -> Boolean
Instances
#reifyBoolean Source
reifyBoolean :: forall r. Boolean -> (forall proxy o. IsBoolean o => proxy o -> r) -> r
Use a value level Boolean
as a type-level Boolean
Re-exports from Type.Data.Ordering
#Ordering
#IsOrdering Source
class IsOrdering :: Ordering -> Constraint
class IsOrdering ordering where
Class for reflecting a type level Ordering
at the value level
Members
reflectOrdering :: forall proxy. proxy ordering -> Ordering
Instances
#reifyOrdering Source
reifyOrdering :: forall r. Ordering -> (forall proxy o. IsOrdering o => proxy 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 :: Symbol -> Constraint
class IsSymbol (sym :: Symbol) where
A class for known symbols
Members
reflectSymbol :: forall proxy. proxy sym -> String
#reifySymbol Source
reifySymbol :: forall proxy r. String -> (forall sym. IsSymbol sym => proxy sym -> r) -> r
Re-exports from Type.Equality
#TypeEquals Source
class TypeEquals :: forall k. k -> k -> Constraint
class (Coercible a b) <= TypeEquals a b | a -> b, b -> a
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.
Instances
TypeEquals a a
#to Source
to :: forall a b. TypeEquals a b => a -> b
#from Source
from :: forall a b. TypeEquals a b => b -> a
Re-exports from Type.Proxy
Re-exports from Type.Row
#RProxy Source
data RProxy :: Row Type -> Type
data RProxy row
A proxy data type whose type parameter is a type of kind Row Type
(a row
of types).
Deprecated as of v0.14.0 PureScript release: use Type.Proxy
instead.
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 (Proxy :: Proxy ( x :: Int, y :: Int ))
{ x :: Int, y :: Int } -> { x :: Int, y :: Int }
Here row
has been specialised to ( x :: Int, y :: Int )
.