aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-01-06 20:40:29 +0530
committerAkshay Nair <phenax5@gmail.com>2023-01-06 20:43:49 +0530
commitcda0419722b022ed0a8f3c4fd3122230b19a0c64 (patch)
tree6d63849e950cc4c0257a2368560eb1bafefbd9d4 /src/index.ts
parenta56f093bf08780ab7ed7ef196f031c193a522922 (diff)
downloadts-types-lang-cda0419722b022ed0a8f3c4fd3122230b19a0c64.tar.gz
ts-types-lang-cda0419722b022ed0a8f3c4fd3122230b19a0c64.zip
feat: adds examples for everything
Diffstat (limited to '')
-rw-r--r--src/index.ts45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/index.ts b/src/index.ts
deleted file mode 100644
index e764623..0000000
--- a/src/index.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-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']>
-}
-
-interface AskForGuess<N extends number> extends Kind1<string> {
- return: this['input'] extends `${N}` ? Print<"Yaya"> : Print<"naaah">
-}
-
-interface StartGuessing extends Kind1<number> {
- return: Bind<Seq<[PutString<"Your guess? ">, ReadLine]>, AskForGuess<this['input']>>
-}
-
-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,
- Bind<GetEnv<"NODE_ENV">, PrintK>,
- Bind<JsExpr<"{ boobaa: [5 * 3, 5 * 2] }">, PrintK>,
- Bind<ReadFile<"./default.nix">, PrintK>,
-
- PutString<"Your name? ">,
- Bind<ReadLine, PrintK<"Hello,">>,
-
- Bind<
- JsExpr<"Math.floor(Math.random() * 10)">,
- StartGuessing
- >,
-
- Print<"Before times">,
- Seq<[
- Print<"Hey">,
- Print<"Wow">,
- Bind<JsExpr<"200 * 2">, PrintK<"200 * 2 =">>,
- ]>,
-]
-