import std.typecons : Tuple; import std.variant : Algebraic; enum t1 = type!int; enum t2 = type!double; enum t3 = t1 + t2; static assert (t3 == type!(Algebraic!(int, double))); enum t4 = t1 * t2; static assert (t4 == type!(Tuple!(int, double))); enum t5 = (t1 + t2) * t1 + t4; static assert (t5 == type!( Algebraic!( Tuple!( Algebraic!(int, double), int ), Tuple!(int, double) ) ) );