 ///
 /// @see equal
 public func beCloseTo(_ expectedValue: Double, within delta: Double = DefaultDelta) -> Predicate<Double> {
-    return Predicate.fromBoolResult { actualExpression, failureMessage in
-        return isCloseTo(try actualExpression.evaluate(), expectedValue: expectedValue, delta: delta, failureMessage: failureMessage)
-    }.requireNonNil
+    return Predicate.define { actualExpression -> (Satisfiability, ExpectationMessage) in
+        return isCloseTo(try actualExpression.evaluate(), expectedValue: expectedValue, delta: delta)
+    }
 }
 
 /// A Nimble matcher that succeeds when a value is close to another. This is used for floating

#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)))"
        if let actual = try actualExpression.evaluate() {
            failureMessage.actualValue = "<\(stringify(actual))>"

            if actual.count != expectedValues.count {
                return false
            } else {
                for (index, actualItem) in actual.enumerated() {
                    if fabs(actualItem - expectedValues[index]) > delta {
                        return false
                    }
                }
                return true
            }
        }
        return false
    }.requireNonNil
}

// MARK: - Operators


internal let DefaultDelta = 0.0001

internal func isCloseTo(_ actualValue: NMBDoubleConvertible?,
                        expectedValue: NMBDoubleConvertible,
                        delta: Double)
    -> (Satisfiability, ExpectationMessage) {
        let errorMessage = "be close to <\(stringify(expectedValue))> (within \(stringify(delta)))"
        return (
            Satisfiability(bool: actualValue != nil &&
                abs(actualValue!.doubleValue - expectedValue.doubleValue) < delta),
            .ExpectedValueTo(errorMessage, "<\(stringify(actualValue))>")
        )
}

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