File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ module Type.Row
1212 , class RowListSet
1313 , class RowListNub
1414 , class RowListAppend
15+ , RowApply
16+ , type (+)
1517 ) where
1618
1719import Type.Equality (class TypeEquals )
@@ -142,3 +144,16 @@ instance rowListAppendCons
142144 , TypeEquals (RLProxy (Cons label head out' )) (RLProxy out ) )
143145 => RowListAppend (Cons label head tail ) rhs out
144146
147+ -- | Type application for rows.
148+ type RowApply (f :: # Type -> # Type ) (a :: # Type ) = f a
149+
150+ -- | Applies a type alias of open rows to a set of rows. The primary use case
151+ -- | this operator is as convenient sugar for combining open rows without
152+ -- | parentheses.
153+ -- | ```purescript
154+ -- | type Rows1 r = (a :: Int, b :: String | r)
155+ -- | type Rows2 r = (c :: Boolean | r)
156+ -- | type Rows3 r = (Rows1 + Rows2 + r)
157+ -- | type Rows4 r = (d :: String | Rows1 + Rows2 + r)
158+ -- | ```
159+ infixr 0 type RowApply as +
You can’t perform that action at this time.
0 commit comments