Module
Type.Row
- Package
- typelevel-prelude
- Repository
- purescript/purescript-typelevel-prelude
#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
#Lacks
#Nub
#Union
Re-exports from Type.Data.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 )
.