erasure

Undocumented in source.

Members

Functions

identityGeneric
A identityGeneric(A x)
Undocumented in source. Be warned that the author may not have intended to support it.
pickLeft
auto pickLeft(A x, B y)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin Erasure!(identityGeneric, "identityPtr", α!("A", (void*).sizeof))
Undocumented in source.
__anonymous
mixin Erasure!(pickLeft, "pickLeftObj", α!("A"), α!("B"))
Undocumented in source.

Mixin templates

Erasure
mixintemplate Erasure(alias symbol, string name, Variables...)

Helper mixin template wrapping functions in a foralls. Given a template symbol, a list a type variables Variables, and a name $(name), this mixin generates two symobls underscore ~ name and name. Where underscore ~ name is a private symbol with free variables and name is the former wrapped in a forall type.

Structs

Π
struct Π(string x, σ)

Forall types (called "∀" is system-f) binds a type variable x in a type σ. Forall's purpose is represent a type that can be specialized to something else.

α
struct α(string x, size_t κ = Object.sizeof)

A Type Variable is a representation of an unknown type. The only known property about a type variable is it's size κ. Two type variables with different names represent two different incompatible types. Functions that use unbounded type variables should always be private and wrap said function with a forall type.

Templates

Substitute
template Substitute(σx, string x, σ)

Substitute σx into σ, replacing all type variables with name x. This function is primarily used by Π's specialize function. Structs and Classes can implement SubstituteImpl(σx, x) to allow specialization.

Λ
template Λ(string x)

A type lambda takes a value with a free type variable x and binds it inside a Forall type.

Λ
template Λ(string x, string y, xs...)

N arity type lambda.

Variables

identity
enum Π!("A", α!("A", (void*).sizeof) function(α!("A", (void*).sizeof))) identity;
Undocumented in source.

Meta