programdemos/combinators.xtl
Combinators: the Combinators library, Smullyan's birds, each a function that only rearranges, repeats or drops its arguments. Run it with "xetal run demos/combinators.xtl" (or "./demos/combinators.xtl"), or as a notebook with "just show demos/combinators.xtl"; it prints what each bird makes of small numbers, ending with 10 factorial from Y and 1024 from a function power. docs/birds.md lists every bird.
The library and two helpers
Recursion from Y, and function power
ᵘf̲act : Num a => (a -> a) -> a -> a
's_elf u:f_act n: the factorial of n, recursing through s_elf, the
function it is handed (lazy, ~), rather than by its own name. Y, the
Sage Bird, hands it itself: 'ᵘf̲act ᶜY̲ 10 is 10 factorial.
ᵘf̲act ← { ~s̲elf n → n ≤ 1 ? 1◆ n × s̲elf n − 1 }
Used in: demos/combinators.xtl:53