aboutsummaryrefslogtreecommitdiff
path: root/examples/file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/file.ts')
-rw-r--r--examples/file.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/file.ts b/examples/file.ts
index 2cc2b7a..5af04da 100644
--- a/examples/file.ts
+++ b/examples/file.ts
@@ -7,11 +7,12 @@ interface PrintK extends Kind1<string> {
return: PutStringLn<this['input']>
}
-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>
+ Bind<ReadFile<'./default.nix'>, <contents extends string>() =>
+ PutStringLn<contents>>,
+
+ Try<
+ Bind<ReadFile<'./unicorn'>, PrintK>,
+ <M extends string>() => PutStringLn<`ERROR: ${M}`>
+ >
]