This library is in flux. APIs may change without notice. Generated from source on 6/15/2026.

Taps

LESSON IN METAPROGRAMMING: This file implements event observation as a

taps.kz

Koru Standard Library: Event Taps ================================== LESSON IN METAPROGRAMMING: This file implements event observation as a compile-time AST transformation. Taps are not a language primitive - they're built using the same transform system available to any Koru library. THE TRANSFORMATION: Before: event() | branch b |> next_step(b.data) After: event() | branch b |> tap_call(b) |> next_step(b.data) That's it. A void call is inserted at the front of the continuation chain. The binding `b` remains in scope. The optimizer sees no difference between tap calls and regular calls - they're just steps in the flow. USAGE: ~import std/taps // Concrete source + branch (has payload access) ~tap(source: myEvent, destination: *) | result r |> log(data: r.value) // Metatype branch (required for wildcard sources) ~tap(source: *, destination: *) | Profile p |> profiler(p)