diff options
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts index df2643a..e764623 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import { Program, Print, PutString, Bind, Debug, Kind1, GetEnv, JsExpr, ReadFile, GetArgs, ReadLine, Seq } from './stdlib' +import { Print, PutString, Bind, Debug, Kind1, GetEnv, JsExpr, ReadFile, GetArgs, ReadLine, Seq, Effect, DefineEffect } from './stdlib' interface PrintK<Label extends string = ""> extends Kind1<unknown> { return: Debug<Label, this['input']> @@ -12,7 +12,14 @@ interface StartGuessing extends Kind1<number> { return: Bind<Seq<[PutString<"Your guess? ">, ReadLine]>, AskForGuess<this['input']>> } -export type main = Program<[ +interface Wow<_A, _B> extends Effect { } + +export type main = [ + DefineEffect<"Wow", `(a, b) => { + console.log(typeToString(a), '-->', typeToString(b)) + }`>, + Wow<"a", 69>, + Bind<GetArgs, PrintK>, PutString<"1,2,3? ">, [1, 2, 3] extends infer Res ? Print<Res> : never, @@ -34,5 +41,5 @@ export type main = Program<[ Print<"Wow">, Bind<JsExpr<"200 * 2">, PrintK<"200 * 2 =">>, ]>, -]> +] |
