 #endif
 
 public func beCloseTo(_ expectedValues: [Double], within delta: Double = DefaultDelta) -> Predicate<[Double]> {
-    return Predicate.fromBoolResult { actualExpression, failureMessage in
-        failureMessage.postfixMessage = "be close to <\(stringify(expectedValues))> (each within \(stringify(delta)))"
+    let errorMessage = "be close to <\(stringify(expectedValues))> (each within \(stringify(delta)))"
+    return Predicate.define(errorMessage) { actualExpression -> Satisfiability in
         if let actual = try actualExpression.evaluate() {
-            failureMessage.actualValue = "<\(stringify(actual))>"
-
             if actual.count != expectedValues.count {
-                return false
+                return .DoesNotMatch
             } else {
                 for (index, actualItem) in actual.enumerated() {
                     if fabs(actualItem - expectedValues[index]) > delta {
-                        return false
+                        return .DoesNotMatch
                     }
                 }
-                return true
+                return .Matches
             }
         }
-        return false
-    }.requireNonNil
+        return .DoesNotMatch
+    }
 }
 
 // MARK: - Operators


internal let DefaultDelta = 0.0001

internal func isCloseTo(_ actualValue: NMBDoubleConvertible?, expectedValue: NMBDoubleConvertible, delta: Double, failureMessage: FailureMessage) -> Bool {
    failureMessage.postfixMessage = "be close to <\(stringify(expectedValue))> (within \(stringify(delta)))"
    failureMessage.actualValue = "<\(stringify(actualValue))>"
    return actualValue != nil && abs(actualValue!.doubleValue - expectedValue.doubleValue) < delta
}

/// A Nimble matcher that succeeds when a value is close to another. This is used for floating

///
/// @see equal
public func beCloseTo(_ expectedValue: NMBDoubleConvertible, within delta: Double = DefaultDelta) -> Predicate<NMBDoubleConvertible> {
    return Predicate.define { actualExpression -> (Satisfiability, ExpectationMessage) in
        return isCloseTo(try actualExpression.evaluate(), expectedValue: expectedValue, delta: delta)
    }
}

#if _runtime(_ObjC)
