fn main(): Unit with {Console} = {
    Console.print("=== List Operations ===")
    let nums = [1, 2, 3, 4, 5]
    Console.print("Original: " + toString(nums))
    Console.print("Mapped (*2): " + toString(List.map(nums, fn(x: Int): Int => x * 2)))
    Console.print("Filtered (even): " + toString(List.filter(nums, fn(x: Int): Bool => x % 2 == 0)))
    Console.print("Sum (fold): " + toString(List.fold(nums, 0, fn(acc: Int, x: Int): Int => acc + x)))
    Console.print("Length: " + toString(List.length(nums)))
    Console.print("Reversed: " + toString(List.reverse(nums)))
    Console.print("Range 1-5: " + toString(List.range(1, 6)))
    Console.print("")
    Console.print("=== String Operations ===")
    let text = "  Hello, World!  "
    Console.print("Original: \"" + text + "\"")
    Console.print("Trimmed: \"" + String.trim(text) + "\"")
    Console.print("Upper: " + String.toUpper(text))
    Console.print("Lower: " + String.toLower(text))
    Console.print("Contains 'World': " + toString(String.contains(text, "World")))
    Console.print("Split by comma: " + toString(String.split("a,b,c", ",")))
    Console.print("Join with dash: " + String.join(["x", "y", "z"], "-"))
    Console.print("")
    Console.print("=== Option Operations ===")
    let some_val = Some(42)
    let none_val: Option<Int> = None
    Console.print("Some(42) mapped (*2): " + toString(Option.map(some_val, fn(x: Int): Int => x * 2)))
    Console.print("None mapped: " + toString(Option.map(none_val, fn(x: Int): Int => x * 2)))
    Console.print("Some(42) getOrElse(0): " + toString(Option.getOrElse(some_val, 0)))
    Console.print("None getOrElse(0): " + toString(Option.getOrElse(none_val, 0)))
    Console.print("")
    Console.print("=== Math Operations ===")
    Console.print("abs(-5): " + toString(Math.abs(-5)))
    Console.print("min(3, 7): " + toString(Math.min(3, 7)))
    Console.print("max(3, 7): " + toString(Math.max(3, 7)))
    Console.print("pow(2, 10): " + toString(Math.pow(2, 10)))
}

let output = run main() with {}
