From 7a9520b3879bccb872aaca6245c92071a957deff Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 12 Jan 2023 17:33:57 +0530 Subject: feat: adds try/catch effects --- examples/file.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/file.ts b/examples/file.ts index d91b68a..fd5728b 100644 --- a/examples/file.ts +++ b/examples/file.ts @@ -1,9 +1,23 @@ import { Bind, Kind1 } from '../stdlib/effect' import { PutStringLn } from '../stdlib/stdio' import { ReadFile } from '../stdlib/fs' +import { Try } from '../stdlib/exception' interface PrintK extends Kind1 { return: PutStringLn } -export type main = Bind, PrintK> +interface ConstK extends Kind1 { + return: Val +} + +export type main = [ + Bind, PrintK>, + Bind< + Try< + ReadFile<'./unicorn'>, + ConstK<"hello world"> + >, + PrintK + >, +] -- cgit v1.3.1