// Benchmark: Effect handling (measures effect overhead)
// Tests: Effect dispatch, handler lookup, effect calls

effect Counter {
    fn increment(): Unit
    fn get(): Int
}

fn countTo(n: Int): Int with {Counter} =
    if n <= 0 then Counter.get()
    else {
        Counter.increment()
        countTo(n - 1)
    }

handler counterHandler: Counter {
    fn increment() = ()
    fn get() = 0
}

// Run the effect benchmark
let result = run countTo(10000) with {
    Counter = counterHandler
}
