tricu/demos/size.tri

26 lines
379 B
Plaintext
Raw Normal View History

!module Size
!import "lib/base.tri" Lib
main = size size
compose = \f g x : f (g x)
2025-01-23 18:57:59 -06:00
succ = Lib.y (\self :
Lib.triage
1
t
(Lib.triage
(t (t t))
(\_ Lib.tail : t t (self Lib.tail))
2025-01-23 18:57:59 -06:00
t))
size = (\x :
(Lib.y (\self x :
compose succ
(Lib.triage
(\x : x)
self
(\x y : compose (self x) (self y))
2025-01-23 18:57:59 -06:00
x)) x 0))