# Modules
Basic implementation of a module system including tests.
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user