diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-09 20:13:33 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-09 20:13:33 +0530 |
| commit | 5aad91f273f39ba1a11143585835e757a57de234 (patch) | |
| tree | 28379cc54ccb1bdd3de2a4c639d24ea5dac82dd5 /examples/guess-number.ts | |
| parent | 2af211f1bd6a5c81ee7acd2ded2bfacf4dcfb2a4 (diff) | |
| download | ts-types-lang-5aad91f273f39ba1a11143585835e757a57de234.tar.gz ts-types-lang-5aad91f273f39ba1a11143585835e757a57de234.zip | |
refactor: moves stuff around
Diffstat (limited to 'examples/guess-number.ts')
| -rw-r--r-- | examples/guess-number.ts | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/examples/guess-number.ts b/examples/guess-number.ts index f03ee10..169805f 100644 --- a/examples/guess-number.ts +++ b/examples/guess-number.ts @@ -1,20 +1,13 @@ -import { - PutString, - Bind, - Kind1, - JsExpr, - ReadLine, - Do, - PutStringLn, -} from '../stdlib' +import { Bind, Kind1, Do } from '../stdlib/effect' +import { PutString, ReadLine, PutStringLn } from '../stdlib/stdio' +import { JsExpr } from '../stdlib/sys' export type main = [ PutStringLn<'Guess a number between 0 & 9. You have 5 guesses'>, Bind<JsExpr<'Math.floor(Math.random() * 10)'>, StartGuessing> ] -interface AskForGuess<N extends number, Attempts extends 0[]> - extends Kind1<string> { +interface AskForGuess<N extends number, Attempts extends 0[]> extends Kind1<string> { return: `${this['input']}` extends `${N}` ? PutStringLn<'Yay! You got it right!'> : Do< |
