sealed interface Expr sealed class MathExpr(): Expr data class Const(val number: Double) : MathExpr() data class Sum(val e1: Expr, val e2: Expr) : MathExpr() object NotANumber : Expr