Closed mrakgr closed 4 years ago
Actually I am going to have to do another PR as I realized something that I've missed.
public override void OnNext(TSource value) { TResult result; try { result = _selector(value); } catch (Exception exception) { ForwardOnError(exception); return; } ForwardOnNext(result); }
This is how Select is implemented in C#.
Select
ForwardOnNext(result);
Note how this is on the last line. This will no doubt trigger the tail call, while in my version...
(fun x -> try f x |> Option.iter o.OnNext with ex -> o.OnError ex)
Has the call to o.OnNext inside try. Sorry about that. It did not occur to me while I was working on it. Let me give it a shot again.
o.OnNext
Merged!
Actually I am going to have to do another PR as I realized something that I've missed.
This is how
Select
is implemented in C#.Note how this is on the last line. This will no doubt trigger the tail call, while in my version...
Has the call to
o.OnNext
inside try. Sorry about that. It did not occur to me while I was working on it. Let me give it a shot again.