fun eval(expr: Expr): Int = when (expr) { is Num -> expr.value is Sum -> expr.left + expr.right } interface Expr class Num