enum Option { None, Some T, } let from = fn x -> x << @(from (x+1)) let nats = from 0 let when = fn pred (x << xs) -> if !#pred x then Option::Some(from 0) << @(when pred !@xs) else Option::None << @(when pred !@xs) let switch = fn (x << xs) (e << es) -> match e { Option::None => x << @(switch !@xs !@es), Option::Some (a << as) => a << @(switch !@as !@es) } let loop_10 = switch nats (when #(fn x -> x % 10 == 0) nats) let head = fn (hd << tl) -> hd let print_loop_10 = print_int (head loop_10) << @print_loop_10 let chicken = (match egg { x << egg => if x == 0 then true else false, }) << @chicken and egg = (match chicken { x << chicken => if x then 1 else 0, }) << @egg with 0 let print_egg = print_int (head egg) << @print_egg