Created
November 29, 2024 20:06
-
-
Save VictorTaelin/b8771a29d829b5aff339ca998a05d4ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Repeated Application | |
@rep(n f x) = ~ n !f !x { | |
0: x | |
p: !&0{f0 f1}=f (f0 @rep(p f1 x)) | |
} | |
// Squared Application | |
@sqr(n f x) = ~ n !f !x { | |
0: x | |
p:!&0{p0 p1}=(+ p 1) | |
!&0{fA f0}=f | |
!&0{f1 f2}=fA | |
@sqr((/ p0 2) λk(f0 (f1 k)) @rep((% p1 2) f2 x)) | |
} | |
@N(a b) = λo λi λt (t (o a) (i b)) | |
@L(x) = x | |
//@view(&s) = ~&s { | |
//0 : λx x | |
//&p: λx (x λx#0{(@view(&p) x)} λx#1{(@view(&p) x)} λa λb [a b]) | |
//} | |
@view(&s) = ~&s { | |
0 : λx x | |
&p: λx (x | |
λx λt (t 0 (@view(&p) x)) | |
λx λt (t 1 (@view(&p) x)) | |
λa λb (a λaK λaV (b λbK λbV ~aK !aV !bV { | |
0: #0{aV bV} | |
p: #1{aV bV} | |
}))) | |
} | |
@inc(s) = ~s { | |
0: λx x | |
p: λx λO λI λT (x λx(I (@inc(p) x)) λx(O x) T) | |
} | |
@dec(s) = ~s { | |
0: λx x | |
p: λx λO λI λT (x λx(O x) λx(I (@dec(p) x)) T) | |
} | |
@zero = @N(@N(@N(7 7) @N(7 7)) @N(@N(7 7) @N(7 7))) | |
@main = (@view(3) (@sqr(5000 @inc(3) @zero))) |
Author
VictorTaelin
commented
Nov 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment