aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/greeting.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/greeting.ts b/examples/greeting.ts
index d3d755f..8ed2181 100644
--- a/examples/greeting.ts
+++ b/examples/greeting.ts
@@ -1,12 +1,21 @@
import { Bind, Kind1 } from '../stdlib/effect'
import { PutString, ReadLine, PutStringLn } from '../stdlib/stdio'
-interface GreetK extends Kind1<string> {
- return: PutStringLn<`Hello, ${this['input']}`>
+interface ResponseK extends Kind1<string> {
+ return: PutStringLn<`Interesting that you believe "${this['input']}" is your purpose. Hmmmm...`>
}
export type main = [
PutStringLn<'Greetotron 6000 initializing...'>,
+
+ PutStringLn<'----------------'>,
PutString<'Your name? '>,
- Bind<ReadLine, GreetK>
+ Bind<ReadLine, <name extends string>() =>
+ PutStringLn<`Hello, ${name}`>>,
+
+ PutStringLn<'----------------'>,
+ PutString<'Your purpose in life? '>,
+ Bind<ReadLine, ResponseK>,
+
+ PutStringLn<'----------------'>,
]