fsprojects / FSharp.Control.Reactive

Extensions and wrappers for using Reactive Extensions (Rx) with F#.
http://fsprojects.github.io/FSharp.Control.Reactive
Other
284 stars 60 forks source link

Fix of the choose pull request. #143

Closed mrakgr closed 4 years ago

mrakgr commented 4 years ago

Changed the implementation of choose again so as to allow the call to OnNext to be in tail position.

This is one of the rare cases where due a return being used in the catch branch, it is not actually possible to get the same efficiency in F# as it would be in C#. It is good that choose uses options intrinsically so it should be close to optimal.

mrakgr commented 4 years ago

The right way to implement all of this is subtle. Glad I spotted this.