                         // inner producers of `flatMap(strategy)` in `successSignal` don't get interrupted by mapping failure.
                         //
                         let successSignal = mappingSignal
-                            .filterMap { input, fromState, effect in
-                                return effect.map { (input, fromState, $0) }
+                            .filterMap { input, fromState, mapped in
+                                return mapped.map { (input, fromState, $0) }
                             }
-                            .flatMap(strategy) { input, fromState, effect -> SignalProducer<(State, Input), NoError> in
+                            .flatMap(strategy) { input, fromState, mapped -> SignalProducer<Reply<State, Input>, NoError> in
+                                let (toState, effect) = mapped
                                 return recurInputProducer(effect, strategy: strategy)
-                                    .prefix(value: (fromState, input))
+                                    .prefix(value: .success(input, fromState, toState))
                             }
 
                         let failureSignal = mappingSignal
-                            .filterMap { input, fromState, effect -> (State, Input)? in
-                                return effect == nil ? (fromState, input) : nil
+                            .filterMap { input, fromState, effect -> Reply<State, Input>? in
+                                return effect == nil ? .failure(input, fromState) : nil
                             }
 
                         let mergedProducer = SignalProducer(values: failureSignal, successSignal).flatten(.merge)


        /// Recursive input-producer that sends inputs from `inputSignal`
        /// and also from additional effect generated by `EffectMapping`.
        func recurInputProducer(_ inputProducer: SignalProducer<Input, NoError>, strategy: FlattenStrategy) -> SignalProducer<(State, Input), NoError>
        {
            return SignalProducer<(State, Input), NoError> { observer, disposable in
                inputProducer
                    .withLatest(from: stateProperty.producer)
                    .map { input, fromState in
                        return (input, fromState, mapping(fromState, input)?.1)
                    }
                    .startWithSignal { mappingSignal, mappingSignalDisposable in
                        //

        }

        recurInputProducer(SignalProducer(inputSignal), strategy: strategy)

            .startWithSignal { replySignal, disposable in
                self._disposable = disposable

