aboutsummaryrefslogtreecommitdiff
path: root/examples/ffi.ts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ffi.ts')
-rw-r--r--examples/ffi.ts23
1 files changed, 13 insertions, 10 deletions
diff --git a/examples/ffi.ts b/examples/ffi.ts
index 484e84d..0840ff6 100644
--- a/examples/ffi.ts
+++ b/examples/ffi.ts
@@ -1,19 +1,22 @@
-import { Bind, Debug, DefineEffect, Effect, JsExpr, Kind1 } from "../stdlib"
+import { Bind, Debug, DefineEffect, Effect, JsExpr, Kind1 } from '../stdlib'
-interface PrintK<Label extends string = ""> extends Kind1 {
+interface PrintK<Label extends string = ''> extends Kind1 {
return: Debug<Label, this['input']>
}
type Square<N extends number> = JsExpr<`${N} ** 2`>
-interface Mathemagic<_A, _B extends number> extends Effect { }
+interface Mathemagic<_A, _B extends number> extends Effect {}
export type main = [
- Bind<JsExpr<"{ boobaa: [5 * 3, 5 * 2] }">, PrintK<'|'>>,
- Bind<Square<69>, PrintK<"69^2 =">>,
- DefineEffect<"Mathemagic", `(a, b) => {
- console.log(typeToString(a))
- return { result: 5 * b.getLiteralValue() }
- }`>,
- Bind<Mathemagic<"a", 69>, PrintK<'69 * 5 ='>>,
+ Bind<JsExpr<'{ boobaa: [5 * 3, 5 * 2] }'>, PrintK<'|'>>,
+ Bind<Square<69>, PrintK<'69^2 ='>>,
+ DefineEffect<
+ 'Mathemagic',
+ `(a, b) => {
+ console.log(typeToString(a))
+ return { result: 5 * b.getLiteralValue() }
+ }`
+ >,
+ Bind<Mathemagic<'a', 69>, PrintK<'69 * 5 ='>>
]