Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil committed Sep 22, 2023
1 parent 47ed2b7 commit 820dc9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ val b: String > (Tries with Options) =

> Note: In the above example, the await method is used to extract values from computations. Specifically, `await(Options.get(Some("hello")))` takes a computation of type `String > Options` and returns a `String`, while `await(Tries.get(Try("world")))` takes a computation of type `String > Tries` and also returns a `String`.
The use of `await` within the defer `block` provides a syntax sugar that simplifies the expression of effectful computations. Under the hood, the direct macro rewrites the computation in terms of map, allowing developers to work with effectful computations as if they were pure values, seamlessly integrating them into the flow of the program.
The use of `await` within the defer `block` provides a syntax sugar that simplifies the expression of effectful computations. Under the hood, the direct macro rewrites the computation in terms of `map`, allowing developers to work with effectful computations as if they were pure values, seamlessly integrating them into the flow of the program.

The direct syntax emphasizes "effectful hygiene" to ensure that computations are properly sequenced and managed. Within a `defer` block, any computation of the `>` type must be encapsulated by an `await` block. This mechanism guarantees that all effectful computations are explicitly awaited, eliminating the risks of inadvertently overlooking effects or misordering operations.

Expand Down

0 comments on commit 820dc9f

Please sign in to comment.