Traits for the kind of unary type application, Type -> Type
.
Higher kinded types (HKT) such as Type -> Type
are not natively
supported in Rust. As such, we cannot use type constructors
such as Vec
without applying a specific type as an argument,
e.g. Vec<u8>
. Although the upcoming generic associated types (GAT)
feature will partially solve this issue, the feature is not yet
stable and may subject to changes.
An alternative approach is to use defunctionalization to encode
regular Rust types to have kinds other than Type
. TypeApp
is one such trait for encoding types of kind Type -> Type
.
For a practical example, refer to VecF.