 // MARK: Nth Derivative
 
 infix operator ′ { associativity left }
-func ′(var left: (Double -> Double), right: UInt) -> (Double) -> (Double) {
-    return reduce(0..<right, left) { (function, _) in
+func ′(left: (Double -> Double), right: UInt) -> (Double) -> (Double) {
+    return (0 ..< right).reduce(left) { (function, _) in
         return function′
     }
 }


prefix operator ∑ {}
prefix func ∑ (values: [Double]) -> Double {
    return reduce(values, 0.0, +)
}

// MARK: Cartesian Product

prefix operator ∏ {}
prefix func ∏ (values: [Double]) -> Double {
    return reduce(values, 1.0, *)
}

// MARK: - Vectors -

func ⋅ (left: [Double], right: [Double]) -> Double {
    precondition(left.count == right.count, "arguments must have same count")

    let product = zip(left, right).map { (l, r) in l * r }
    return ∑product
}

