Skip to content

Instantly share code, notes, and snippets.

@Steelbirdy
Steelbirdy / euclid.rs
Last active September 4, 2022 16:05
The Euclidean Algorithm implemented entirely in the Rust type system.
#![feature(generic_associated_types)]
use std::marker::PhantomData;
macro_rules! num {
() => { Z };
(* $($rest:tt)*) => { S<num!($($rest)*)> };
}
macro_rules! print_gcd {