 
 public class APlusPromise: Thenable
 {
+    // MARK: - Type
+    
+    public typealias APlusResovler = (value: Any?) -> Void
+    public typealias APlusRejector = (reason: Any?) -> Void
+    
+    enum State {
+        case Pending, Fulfilled, Rejected
+    }
+
+    // MAKR: ivars
+    
     var state: State
     var value: Any?
     var reason: Any?

            self.onFulfilled(value)
        }
    }
    
    // MARK: - Type

    public typealias APlusResovler = (value: Any?) -> Void
    public typealias APlusRejector = (reason: Any?) -> Void

    enum State {
        case Pending, Fulfilled, Rejected
    }
}
        if self.state != .Pending {
            abort()
        }
        
        self.reason = reason
        self.state = .Rejected
        
