Module lambek::type_app[][src]

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.

Structs

Const

Enums

Borrow
BorrowMut
Identity
VecF

Traits

HasTypeApp
TypeApp
TypeAppCont
TypeAppGeneric
TypeCon

A type F implements TypeCon to mark itself as having the kind Type -> Type.

Functions

wrap_app

Type Definitions

App