Skip to content

Commit a1ebc07

Browse files
committed
.
1 parent 7371040 commit a1ebc07

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

content/blog/llms-new-languages.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,21 @@ I need to keep Random.runWithIO() explicit:
447447

448448
The refactoring completes successfully. The new `main` is:
449449

450+
```flix
450451
452+
def main(): Unit \ {Console, IO, NonDet} =
453+
let logFile = "game_log.txt";
454+
// Initialize log file
455+
discard FileWrite.runWithIO(() -> FileWrite.write({str = "=== Tic-Tac-Toe Game Log ===\n"}, logFile));
456+
// Run the game - Console uses default handler, Random/Logger/FileWrite need explicit handlers
457+
discard FileWrite.runWithIO(() ->
458+
handleLoggerWithFile(logFile, () ->
459+
Random.runWithIO(() ->
460+
startGame()
461+
)
462+
)
463+
)
464+
```
451465

452466
```claude
453467
What about the FileWrite effect? Can we use the default handler for that too?

0 commit comments

Comments
 (0)