diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-12 17:33:57 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-12 17:33:57 +0530 |
| commit | 7a9520b3879bccb872aaca6245c92071a957deff (patch) | |
| tree | a66f10b31a4ec9290897178cc1bc9627dbe65dc3 /examples | |
| parent | 83b6bcaa81a645e1b3936d856fbb84ea219ee04e (diff) | |
| download | ts-types-lang-7a9520b3879bccb872aaca6245c92071a957deff.tar.gz ts-types-lang-7a9520b3879bccb872aaca6245c92071a957deff.zip | |
feat: adds try/catch effects
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/file.ts | 16 |
1 files changed, 15 insertions, 1 deletions
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<string> { return: PutStringLn<this['input']> } -export type main = Bind<ReadFile<'./default.nix'>, PrintK> +interface ConstK<Val> extends Kind1<unknown, Val> { + return: Val +} + +export type main = [ + Bind<ReadFile<'./default.nix'>, PrintK>, + Bind< + Try< + ReadFile<'./unicorn'>, + ConstK<"hello world"> + >, + PrintK + >, +] |
