Don't require/allow naming a module, instead require that the importer names it. Allow importing into the local scope with the name !Local. Simplify namespacing logic. Updates all tests to reflect these changes.
24 lines
340 B
Plaintext
24 lines
340 B
Plaintext
!import "lib/base.tri" !Local
|
|
|
|
main = size size
|
|
|
|
compose = \f g x : f (g x)
|
|
|
|
succ = y (\self :
|
|
triage
|
|
1
|
|
t
|
|
(triage
|
|
(t (t t))
|
|
(\_ tail : t t (self tail))
|
|
t))
|
|
|
|
size = (\x :
|
|
(y (\self x :
|
|
compose succ
|
|
(triage
|
|
(\x : x)
|
|
self
|
|
(\x y : compose (self x) (self y))
|
|
x)) x 0))
|