 
         /// 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>
+        func recurInputProducer(_ inputProducer: SignalProducer<Input, NoError>, strategy: FlattenStrategy) -> SignalProducer<Reply<State, Input>, NoError>
         {
-            return SignalProducer<(State, Input), NoError> { observer, disposable in
+            return SignalProducer { observer, disposable in
                 inputProducer
                     .withLatest(from: stateProperty.producer)
                     .map { input, fromState in
-                        return (input, fromState, mapping(fromState, input)?.1)
+                        return (input, fromState, mapping(fromState, input))
                     }
                     .startWithSignal { mappingSignal, mappingSignalDisposable in
                         //

                        // 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) }
                            }
                            .flatMap(strategy) { input, fromState, effect -> SignalProducer<(State, Input), NoError> in
                                return recurInputProducer(effect, strategy: strategy)
                                    .prefix(value: (fromState, input))
                            }

                        let failureSignal = mappingSignal
                            .filterMap { input, fromState, effect -> (State, Input)? in
                                return effect == nil ? (fromState, input) : nil
                            }

                        let mergedProducer = SignalProducer(values: failureSignal, successSignal).flatten(.merge)

        }

        recurInputProducer(SignalProducer(inputSignal), strategy: strategy)

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

