Prep for 0.8.0

- Functions now prefer tasks
- Put retry logic in its own module; both CE and functions use it
- Annotated types where necessary for smooth F# 6 implicit casting
This commit is contained in:
2022-04-18 22:31:48 -04:00
parent 20a9ea461c
commit 2e749e1a27
5 changed files with 267 additions and 224 deletions

View File

@@ -17,24 +17,25 @@ The goal is to provide:
- A composable pipeline for creating ReQL statements:
```fsharp
/// string -> (IConnection -> Async<Post>)
/// string -> (IConnection -> Task<Post>)
let fetchPost (postId : string) =
fromDb "Blog"
|> table "Post"
|> get postId
|> asyncResult<Post>
fromDb "Blog"
|> table "Post"
|> get postId
|> runResult<Post>
|> withRetryDefault
```
- An F# domain-specific language (DSL) using a `rethink` computation expression:
```fsharp
/// string -> (IConnection -> Async<Post>)
/// string -> (IConnection -> Task<Post>)
let fetchPost (postId : string) =
rethink {
fromDb "Blog"
table "Post"
get postId
asyncResult<Post>
rethink<Post> {
withTableInDb "Post" "Blog"
get postId
result
withRetryDefault
}
```