 // MARK: - Test Equality
 
 public func ==(lhs: JSONResult, rhs: JSONResult) -> Bool {
-    return lhs.r == rhs.r
+    return lhs.result == rhs.result
 }

    }

    internal init(_ result: Result<JSON, NSError>) {
        self.r = result
    }

    private func flatMap(f: JSON -> JSONResult) -> JSONResult {
        return JSONResult(r.flatMap { value in f(value).r })
    }

    private func flatMap<T>(f: JSON -> Result<T, NSError>) -> Result<T, NSError> {
        return r.flatMap(f)
    }

    /**
        Returns `true` if the target's underlying `Result` is in the `.Success` case.
    */
    public var isSuccess: Bool {
        return r.value != nil
    }

    /**
        Returns `true` if the target's underlying `Result` is in the `.Failure` case.
    */
    public var isFailure: Bool {
        return r.error != nil
    }
}


    A newtype for Result<JSON> that provides additional properties for extracting typed JSON data.
*/
public struct JSONResult: Equatable {
    private let result: Result<JSON, NSError>

    internal static func success(success: JSON) -> JSONResult {
        return JSONResult(Result.success(success))
