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
12
12
, class RowListSet
13
13
, class RowListNub
14
14
, class RowListAppend
15
+ , RowApply
16
+ , type (+)
15
17
) where
16
18
17
19
import Type.Equality (class TypeEquals )
@@ -142,3 +144,16 @@ instance rowListAppendCons
142
144
, TypeEquals (RLProxy (Cons label head out' )) (RLProxy out ) )
143
145
=> RowListAppend (Cons label head tail ) rhs out
144
146
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