import std/html.{type Html}
import std/io
effect log
{
fn log :: msg: String -> ()
}
pub fn greet :: name: String -> Html /
{
log ("rendering " <> name)
Hello, {name}!
}
fn with_console_log :: action: fn() -> a / -> a /
{
handle
{
action ()
}
with
{ log msg -> io.println ("[log] " <> msg) }
}
pub fn main :: -> () /
{
use <- with_console_log
io.println (html.render (greet "Ada"))
}
//> [log] rendering Ada
//> Hello, Ada!