     
     public static func preResolved(value: T) -> Future<T> {
         let future = Future<T>()
-        future.value = value
+        future.result = .success(value)
         return future
     }
     
     public static func preRejected(error: Error) -> Future<T> {
         let future = Future<T>()
-        future.error = error
+        future.result = .error(error)
         return future
     }
     

            return
        }
        
        self.value = val
        
        lockQueue.sync {
            self.thenBlock?(val)

    private var errorBlock: ErrorBlock?
    private var finallyBlock: (()->())?
    private var childFuture: Future?
    fileprivate var result: Result<T>?
    
    private let lockQueue = DispatchQueue(label: "com.concurrency.future.\(NSUUID().uuidString)")

    //MARK: - PUBLIC -
    
    //MARK: public properties
    
    var value: T? {
        guard let result = result else {
            return nil
        }
        switch result {
        case .success(let val):
            return val
        default:
            return nil
        }
    }
    
    var error: Error? {
        guard let result = result else {
            return nil
        }
        switch result {
        case .error(let err):
            return err
        default:
            return nil
        }
    }
    
    public var succeeded: Bool {
        return value != nil
