Last active
October 14, 2018 16:39
-
-
Save dbrattli/6d0c14139b6876c93843e68bdc8a3235 to your computer and use it in GitHub Desktop.
Query Builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type QueryBuilder() = | |
member this.Zero () = Promise () | |
member this.ReturnFrom (xs: Promise<'a>) = xs | |
member this.Return x = | |
let promise = Promise<'a> () | |
promise.Resolve x | |
promise | |
member this.Bind(source: Promise<'a>, fn: 'a -> Promise<'b>) : Promise<'b> = source.Then fn | |
let promise = new QueryBuilder() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment