# Modules

Basic implementation of a module system including tests.
This commit is contained in:
2025-01-27 16:04:04 -06:00
committed by James Eversole
parent 72291c652d
commit 4a4b09e898
28 changed files with 373 additions and 105 deletions

View File

@ -1,20 +1,24 @@
!module Size
!import "lib/base.tri" Lib
main = size size
compose = \f g x : f (g x)
succ = y (\self :
triage
succ = Lib.y (\self :
Lib.triage
1
t
(triage
(Lib.triage
(t (t t))
(\_ tail : t t (self tail))
(\_ Lib.tail : t t (self Lib.tail))
t))
size = (\x :
(y (\self x :
(Lib.y (\self x :
compose succ
(triage
(Lib.triage
(\x : x)
self
(\x y : compose (self x) (self y))