style: auto-format example files with lux fmt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 06:52:44 -05:00
parent 8c90d5a8dc
commit 44ea1eebb0
54 changed files with 580 additions and 1483 deletions

View File

@@ -1,15 +1,3 @@
// Custom Logging with Effects
//
// This demonstrates how effects let you abstract side effects.
// The same code can be run with different logging implementations.
//
// Expected output:
// [INFO] Starting computation
// [DEBUG] x = 10
// [INFO] Processing
// [DEBUG] result = 20
// Final: 20
effect Log {
fn info(msg: String): Unit
fn debug(msg: String): Unit
@@ -26,18 +14,22 @@ fn computation(): Int with {Log} = {
}
handler consoleLogger: Log {
fn info(msg) = {
Console.print("[INFO] " + msg)
resume(())
}
fn debug(msg) = {
Console.print("[DEBUG] " + msg)
resume(())
}
fn info(msg) =
{
Console.print("[INFO] " + msg)
resume(())
}
fn debug(msg) =
{
Console.print("[DEBUG] " + msg)
resume(())
}
}
fn main(): Unit with {Console} = {
let result = run computation() with { Log = consoleLogger }
let result = run computation() with {
Log = consoleLogger,
}
Console.print("Final: " + toString(result))
}