trait Add type Output = Self fn add(other: R) -> Self::Output end intrinsic class Int end intrinsic class Double end impl Add for Int fn add(other: Self) -> Self self + other end end impl Add for Int type Output = Double fn add(other: Double) -> Double self + other end end impl Add for Double fn add(other: Self) -> Self self + other end end impl Add for Double fn add(other: Int) -> Self self + other end end fn add_rough_pi(a: impl Add) -> Double = a + 3.14 fn concat, U>(a: T, b: U) -> T::Output a + b end fn main() let x = add_rough_pi(3) println(x) // 6.14 let y = concat(1, 2) // 3 let z = concat("Hello, ", "World!") // "Hello, World!" end