     A newtype for Result<JSON> that provides additional properties for extracting typed JSON data.
 */
 public struct JSONResult: Equatable {
-    private let r: Result<JSON, NSError>
+    private let result: Result<JSON, NSError>
 
     internal static func success(success: JSON) -> JSONResult {
         return JSONResult(Result.success(success))

// MARK: - Test Equality

public func ==(lhs: JSONResult, rhs: JSONResult) -> Bool {
    return lhs.r == rhs.r
}

    }

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

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

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

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

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

