aboutsummaryrefslogtreecommitdiff
path: root/examples/custom-effect.ts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/custom-effect.ts')
-rw-r--r--examples/custom-effect.ts15
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>,
]