Module rust_examples::dependent [−][src]
Expand description
This module includes Rust’s approach to dependent types.
Informally, a dependent type is a type that depends of a value of (or a term from) another type.
This example if from a talk (not only) about dependent types (~ 15:50 min): Proof Theory Impressionism: Blurring the Curry-Howard Line
More generally, according to the article Why dependent types matter:
Dependently typed programs are, by their nature, proof carrying code.
Structs
Negative compilation tests for AddEq relation.
Negative compilation tests for Pred relation.
Type-level definition of a successor of a natural number N, i.e. the number N + 1.
A wrapper for Vec<A> which preserves the information about its size N at the type
level (i.e. compilation time).
Type-level definition of the natural number 0.
