Skip to content

Instantly share code, notes, and snippets.

@dbrattli
Created October 21, 2018 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrattli/96f4aec2d468f204eecca60929dfbfb3 to your computer and use it in GitHub Desktop.
Save dbrattli/96f4aec2d468f204eecca60929dfbfb3 to your computer and use it in GitHub Desktop.
Async Enumerables and Observables
// An Async Enumerator is a getter of Async values. An Async Observer is an Async setter of values
type AsyncEnumerator<'a> = unit -> Async<'a>
type AsyncObserver<'a> = 'a -> Async<unit>
// An Async sequence is a getter of Async Enumerators. An Async Observable is an Async setter of Async Observers
type AsyncSequence<'a> = unit -> AsyncEnumerator<'a>
type AsyncObservable<'a> = AsyncObserver<'a> -> Async<unit>
type AsyncSequence'<'a> = unit -> (unit -> Async<'a>)
type AsyncObservable'<'a> = ('a -> Async<unit>) -> Async<unit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment