From 00e00984959fc7bbc5f790fd673a9d967d141b32 Mon Sep 17 00:00:00 2001 From: Flavio Brasil Date: Fri, 22 Sep 2023 16:27:49 -0700 Subject: [PATCH] minor --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c8e9ddfd3..b229e4ed2 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Drawing inspiration from [ZIO](https://zio.dev/)'s [effect rotation](https://deg 1. [The `>` type](#the--type) 2. [Effect widening](#effect-widening) 3. [Using effects](#using-effects) +3. [Direct Syntax](#direct-syntax) 4. [Core Effects](#core-effects) 1. [Aborts: Short Circuiting](#aborts-short-circuiting) 2. [IOs: Side Effects](#ios-side-effects) @@ -247,7 +248,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.