         return self.on(next: nextClosure)
     }
     
-    func doNextAs<U>(nextClosure:(U) -> ()) -> SignalProducer<Value, Error> {
-        return self.on(next: { (object) -> () in
-            self.errorLogCastNext(object, withClosure: nextClosure)
-        })
+    func doNextAs<U>(nextClosure:(U) -> ()) -> SignalProducer<U, Error> {
+        return self.mapToType().on(next: nextClosure)
     }
     
     func doCompleted(nextClosure:() -> ()) -> SignalProducer<Value, Error> {

    }
    
    func subscribeNextAs<U>(nextClosure:(U) -> ()) -> Disposable {
        return self.startWithNext({ (object) -> () in
            self.errorLogCastNext(object, withClosure: nextClosure)
        })
    }
    
    func subscribeCompleted(completed: () -> ()) -> Disposable {

import ReactiveCocoa

public extension SignalProducerType where Error == NSError {
    func mapTo<U>(type:U) -> SignalProducer<U, NSError> {
        return flatMap(FlattenStrategy.Latest, transform: { (object) -> SignalProducer<U, NSError> in
            if let castedObject = object as? U {
                return SignalProducer(value: castedObject)
            } else {
                print("ERROR: Could not cast! \(object)")
                return SignalProducer(error: NSError(domain: "ALReactiveCocoaExtension", code: 500, userInfo: nil))
            }
        })
    }
    
    func mapToType<U>() -> SignalProducer<U, NSError> {
        return flatMap(FlattenStrategy.Latest, transform: { (object) -> SignalProducer<U, NSError> in
            if let castedObject = object as? U {
                return SignalProducer(value: castedObject)
            } else {
                print("ERROR: Could not cast! \(object)")
                return SignalProducer(error: NSError(domain: "ALReactiveCocoaExtension", code: 500, userInfo: nil))
            }
        })
    }
}

public extension SignalProducerType where Error == NSError {
    
    func initially(callback:() -> ()) -> SignalProducer<Value, Error> {
        return self.on(started: callback)
