jack-pappas / ExtCore

An extended core library for F#.
Apache License 2.0
180 stars 32 forks source link

Add AsyncStatefulChoiceBuilder #13

Closed vasily-kirichenko closed 9 years ago

vasily-kirichenko commented 9 years ago

Analogy as there's non-async pair

type ProtectedStateFunc<'State, 'T, 'Error> =  'State -> Choice<'T * 'State, 'Error>
type StatefulChoiceFunc<'State, 'T, 'Error> =  'State -> Choice<'T, 'Error> * 'State

it would be great to have async one

type AsyncProtectedStateFunc<'State, 'T, 'Error> =  'State -> Async<Choice<'T * 'State, 'Error>>
type AsyncStatefulChoiceFunc<'State, 'T, 'Error> =  'State -> Async<Choice<'T, 'Error> * 'State>> //missing
jack-pappas commented 9 years ago

I've implemented an AsyncStatefulChoiceFunc and AsyncStatefulChoiceBuilder (asyncStatefulChoice) in d5e738f but haven't released a new package for them yet as I haven't had time to test the implementation.

vasily-kirichenko commented 9 years ago

Thanks!

jack-pappas commented 9 years ago

@vasily-kirichenko This feature is in the most recent ExtCore package (0.8.45). I did some basic testing and it seems to work as expected; if you're going to depend on it for production use, please double-check that it does work correctly (and consider contributing some test cases for it, if you have the time).