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/guess-number.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/guess-number.ts') diff --git a/examples/guess-number.ts b/examples/guess-number.ts index 8f5d535..79f6ad1 100644 --- a/examples/guess-number.ts +++ b/examples/guess-number.ts @@ -1,4 +1,4 @@ -import { Print, PutString, Bind, Kind1, JsExpr, ReadLine, Then, PutStringLn } from '../src/stdlib' +import { Print, PutString, Bind, Kind1, JsExpr, ReadLine, Do, PutStringLn } from '../src/stdlib' export type main = [ PutStringLn<"You have 5 guesses">, @@ -11,7 +11,7 @@ export type main = [ interface AskForGuess extends Kind1 { return: `${this['input']}` extends `${N}` ? PutStringLn<"Yay! You got it right!"> - : Then<[ + : Do<[ Print<`Wrong guess. Total attempts: ${ [...Attempts, 0] extends infer Ls extends 0[] ? Ls['length'] : 0 }`>, @@ -23,7 +23,7 @@ interface StartGuessing extends Kind1 { return: Attempts['length'] extends 5 ? PutStringLn<"Max attempts exceeded. Game over!"> : Bind< - Then<[ + Do<[ PutString<"Your guess? ">, ReadLine ]>, -- cgit v1.3.1