reflect-nat
Type-level naturals, booleans, and heterogeneous lists with Reflect
implementations.
Type-Level Naturals
Natural numbers are represented using Peano encoding:
- [
Z] represents zero - [
S<N>] represents the successor ofN
Type-Level Booleans
- [
True] and [False] with boolean operations [Not], [And], [Or]
Heterogeneous Lists
- [
HNil] and [HCons<H, T>] withReflectimplementations
Examples
use ;
use ;
// Type-level natural: 3
type Three = ;
assert_eq!;
// Type-level boolean
assert_eq!;
// Type-level HList: [3, 0]
type MyList = ;
assert_eq!;