File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,21 @@ I need to keep Random.runWithIO() explicit:
447447
448448The 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?
You can’t perform that action at this time.
0 commit comments