Note that this is specific to the upcoming 0.14 release (if you are reading documentation in master
).
The Record
type constructor does not take multiple Row Types. Record
takes a single type-argument with the kind Row Type
. (foo :: Bar, ...)
is type-level-literal syntax for constructing a type with the kind Row Type
, similar to how [ 1, 2, ... ]
syntax at the value-level-literal syntax for constructing a value of type Array Int
.
In 0.14, the Row
constructor is polymorphic, in the same way that Array
can be polymorphic. At the value level, you can do ["foo"] :: Array String
or [true] :: Array Boolean
, and at the type level you can do (foo :: "Foo") :: Row Symbol
or (foo :: Array) :: Row (Type -> Type)
to construct a row where the members have a different kind than Type
.
Value-level things always have kind Type
. This does not necessarily mean they have a run-time representation. That is, anything that exists at runtime is of kind Type
, but not everything that has kind Type
necessarily exists at runtime. Since Record
takes a type argument with the kind Row Type
, that means it is indexed by a row of labels to types that are potentially inhabited at runtime.