Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Y-combinator/MANOOL/y-combinator-1.manool
Normal file
11
Task/Y-combinator/MANOOL/y-combinator-1.manool
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ {extern "manool.org.18/std/0.3/all"} in
|
||||
: let { Y = {proc {F} as {proc {X} as X[X]}[{proc {X} with {F} as F[{proc {Y} with {X} as X[X][Y]}]}]} } in
|
||||
{ for { N = Range[10] } do
|
||||
: (WriteLine) Out; N "! = "
|
||||
{Y: proc {Rec} as {proc {N} with {Rec} as: if N == 0 then 1 else N * Rec[N - 1]}}$[N]
|
||||
}
|
||||
{ for { N = Range[10] } do
|
||||
: (WriteLine) Out; "Fib " N " = "
|
||||
{Y: proc {Rec} as {proc {N} with {Rec} as: if N == 0 then 0 else: if N == 1 then 1 else Rec[N - 2] + Rec[N - 1]}}$[N]
|
||||
}
|
||||
}
|
||||
11
Task/Y-combinator/MANOOL/y-combinator-2.manool
Normal file
11
Task/Y-combinator/MANOOL/y-combinator-2.manool
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ {extern "manool.org.18/std/0.3/all"} in
|
||||
: let { Y = {proc {F} as {proc {X} as X[X]}[{proc {F; X} as F[{proc {X; Y} as X[X][Y]}.Bind[X]]}.Bind[F]]} } in
|
||||
{ for { N = Range[10] } do
|
||||
: (WriteLine) Out; N "! = "
|
||||
{Y: proc {Rec} as {proc {Rec; N} as: if N == 0 then 1 else N * Rec[N - 1]}.Bind[Rec]}$[N]
|
||||
}
|
||||
{ for { N = Range[10] } do
|
||||
: (WriteLine) Out; "Fib " N " = "
|
||||
{Y: proc {Rec} as {proc {Rec; N} as: if N == 0 then 0 else: if N == 1 then 1 else Rec[N - 2] + Rec[N - 1]}.Bind[Rec]}$[N]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue