     case Relationalexpr
 }
 
-enum NumericExpression {
+indirect enum NumericExpression {
     case NumberLiteral(Int)
-    case Paren(Box<NumericExpression>)
-    case Exp(Box<NumericExpression>, Box<NumericExpression>)
-    case Negate(Box<NumericExpression>)
-}
-func NumericExprParen(numExpr:NumericExpression) -> NumericExpression {
-    return NumericExpression.Paren(Box(numExpr))
-}
-func NumericExprExp(numExpr:NumericExpression)(_ numExpr2:NumericExpression) -> NumericExpression {
-    return NumericExpression.Exp(Box(numExpr), Box(numExpr2))
-}
-func NumericExprNegate(numExpr:NumericExpression) -> NumericExpression {
-    return NumericExpression.Negate !< Box(numExpr)
+    case Paren(NumericExpression)
+    case Exp(NumericExpression, NumericExpression)
+    case Negate(NumericExpression)
+    case Multiply(NumericExpression, NumericExpression)
+    case Divide(NumericExpression, NumericExpression)
+    case Add(NumericExpression, NumericExpression)
+    case Subtract(NumericExpression, NumericExpression)
+}
+func curry<A,B,C>(f:(A,B)->C)(_ a:A)(_ b:B) -> C {
+    return f(a,b)
 }
 
 let left_paren = char("(")
 let right_paren = char(")")
 let exponent_op = char("^")
+let mult_op = char("*")
+let divide_op = char("/")
 let plus_op = char("+")
 let subtract_op = char("-")
 let number = nat
 
-let numeric_expression:Tokenizer<NumericExpression> = prefix_expression
-
-
-let number_literal_expr:Tokenizer<NumericExpression> = NumericExpression.NumberLiteral <~> number
-let paren_expression:Tokenizer<NumericExpression> = NumericExprParen <~> (left_paren *> numeric_expression <* right_paren)
-  <|> number_literal_expr
-let exponent_expresion:Tokenizer<NumericExpression> = NumericExprExp <~> numeric_expression <* exponent_op <*> numeric_expression
-  <|> paren_expression
-let prefix_expression = plus_op *> numeric_expression
-  <|> NumericExprNegate <~> (subtract_op *> numeric_expression)
-  <|> exponent_expresion
+let numeric_expression:Tokenizer<NumericExpression> = add_expression
+
+let number_literal_expr = NumericExpression.NumberLiteral <~> number
+
+let paren_expression = number_literal_expr
+  <|> NumericExpression.Paren <~> (left_paren *> numeric_expression <* right_paren)
+
+let exponent_expresion = paren_expression
+  <|> curry(NumericExpression.Exp) <~> (numeric_expression <* exponent_op) <*> numeric_expression
+
+let prefix_expression = exponent_expresion
+  <|> plus_op *> numeric_expression
+  <|> NumericExpression.Negate <~> (subtract_op *> numeric_expression)
+
+let multiply_expression = prefix_expression
+  <|> curry(NumericExpression.Multiply) <~> (numeric_expression <* mult_op) <*> numeric_expression
+  <|> curry(NumericExpression.Divide) <~> (numeric_expression <* divide_op) <*> numeric_expression
+
+let add_expression = multiply_expression
+  <|> curry(NumericExpression.Add) <~> (numeric_expression <* plus_op) <*> numeric_expression
+  <|> curry(NumericExpression.Subtract) <~> (numeric_expression <* subtract_op) <*> numeric_expression

    }
}

class Box<T> {
    private(set) var value:T
    init(_ value:T) {
        self.value = value
    }
    class func B(value:T) -> Box<T> {
        return Box(value)
    }
}

enum List<T> {
    case Nil
    case Cons(h:T, t:Box<List<T>>)
}

class ListGenerator<T> : AnyGenerator<T> {

    override func next() -> Element? {
        switch list {
        case .Nil: return nil
        case .Cons(let h, let t):
            list = t
            return h
        }
    }
