type Vec = []int

fn (v Vec) + (u Vec) !Vec {
	if v.len != u.len {
		return error("Operations require dim(v) == dim(u)")
	}
	return Vec([v[0] + u[0], v[1] + u[1], v[2] + u[2]])
}

fn (v Vec) - (u Vec) ?Vec {
	if v.len != u.len {
		return none
	}
	return Vec([v[0] + u[0], v[1] + u[1], v[2] + u[2]])
}



fn main() {
	vec := Vec([1, 2, 3])
	dump(vec + vec)
}
