From d5d685253568f8c6855dd873ac3623e0af642d54 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 6 Jan 2023 23:33:00 +0530 Subject: feat: adds output for custom effects + adds custom effect example for ffi --- examples/custom-effect.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'examples/custom-effect.ts') 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 +} 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, PrintK>, ] -- cgit v1.3.1