diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-06 23:33:00 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-06 23:35:33 +0530 |
| commit | d5d685253568f8c6855dd873ac3623e0af642d54 (patch) | |
| tree | 3274f8eb52e64e60ab86080f20a55339f4ca5e35 /examples/custom-effect.ts | |
| parent | 4d82623f191042c362ddd2ad5e8ded99d5854169 (diff) | |
| download | ts-types-lang-d5d685253568f8c6855dd873ac3623e0af642d54.tar.gz ts-types-lang-d5d685253568f8c6855dd873ac3623e0af642d54.zip | |
feat: adds output for custom effects + adds custom effect example for ffi
Diffstat (limited to 'examples/custom-effect.ts')
| -rw-r--r-- | examples/custom-effect.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/examples/custom-effect.ts b/examples/custom-effect.ts index 948caf4..6a4b8b0 100644 --- a/examples/custom-effect.ts +++ b/examples/custom-effect.ts @@ -1,10 +1,15 @@ -import { DefineEffect, Effect } from '../src/stdlib' +import { Bind, DefineEffect, Effect, Kind1, Print } from '../src/stdlib' -interface Wow<_A, _B> extends Effect { } +interface Mathemagic<_A, _B> extends Effect { } + +interface PrintK extends Kind1 { + return: Print<this['input']> +} export type main = [ - DefineEffect<"Wow", `(a, b) => { - console.log(typeToString(a), '-->', typeToString(b)) + DefineEffect<"Mathemagic", `(a, b) => { + console.log(typeToString(a)) + return { result: 5 * b.getLiteralValue() } }`>, - Wow<"a", 69>, + Bind<Mathemagic<"a", 69>, PrintK>, ] |
