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

A few System.Funcs not wrapped #51

Closed glchapman closed 9 years ago

glchapman commented 9 years ago

In a few cases, the functions in the Observable module end up taking System.Func parameters (rather than a corresponding F# function). I assume these are inadvertent, since in all other cases the Observable functions take F# functions as parameters (where appropriate). The cases I found are:

longCountSatisfy (predicate: Func<'a,bool>)

generateTimeSpan (condition: Func<'state,bool>) (iterate: Func<'state,'state>)

Also, the Observable.create function has type: (IObserver<'T> -> Action) -> IObservable<'T>

It might be worth rewriting it to wrap the Action, for example:

    let create : (IObserver<'T> -> (unit -> unit)) -> IObservable<'T> =
        fun subscribe ->
            Observable.Create(fun observer -> Action(subscribe observer))
panesofglass commented 9 years ago

Ah! Thanks! Would you care to submit a PR?

bordoley commented 9 years ago

https://github.com/fsprojects/FSharp.Control.Reactive/pull/56 fixes the above function. Other functions that appear to need fixing include:

generateTimeSpan longCountSatisfy

panesofglass commented 9 years ago

I made those fixes and will release as 3.1.0.