From d5c3af89ab8076bcf4107859c1ba6b47a7815142 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 15 Jan 2023 00:13:04 +0530 Subject: chore: some more documentation --- docs/interfaces/effect.BindTo.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'docs/interfaces/effect.BindTo.md') diff --git a/docs/interfaces/effect.BindTo.md b/docs/interfaces/effect.BindTo.md index c333393..0775364 100644 --- a/docs/interfaces/effect.BindTo.md +++ b/docs/interfaces/effect.BindTo.md @@ -4,20 +4,26 @@ [effect](../modules/effect.md).BindTo -Generic interface for declaring effects +Bind result of evaluating an effect to a label (Equivalent to haskell's <- syntax) + +Note: labels are scoped to outermost Do, Bind, Try, etc scopes **`Example`** ```ts -interface MyEffect extends Effect {} +type main = Do<[ + // contents <- readFile "./file.txt" + BindTo<"contents", ReadFile<"./file.txt">>, + Bind, () => Print> +]> ``` ## Type parameters | Name | Type | Description | | :------ | :------ | :------ | -| `_Name` | extends `string` | The output generated by the effect (defaults to `unknown`) | -| `_Eff` | extends [`Effect`](effect.Effect.md) | - | +| `_Name` | extends `string` | The name of label | +| `_Eff` | extends [`Effect`](effect.Effect.md) | Effect to evaluate | ## Hierarchy -- cgit v1.3.1