Skip to content

Instantly share code, notes, and snippets.

View TheGreatCatAdorer's full-sized avatar

Donovan Block TheGreatCatAdorer

View GitHub Profile
@hirrolot
hirrolot / tagless-final.rs
Last active December 2, 2024 20:28
Tagless-final encoding of a simple arithmetic language in Rust
trait Interp {
type Repr<T>;
fn lit(i: i32) -> Self::Repr<i32>;
fn add(a: Self::Repr<i32>, b: Self::Repr<i32>) -> Self::Repr<i32>;
}
struct Eval;
impl Interp for Eval {