Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/Church-numerals/Jq/church-numerals-1.jq
Normal file
5
Task/Church-numerals/Jq/church-numerals-1.jq
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def church(f; $x; $m):
|
||||
if $m == 0 then .
|
||||
elif $m == 1 then $x|f
|
||||
else church(f; $x; $m - 1)
|
||||
end;
|
||||
6
Task/Church-numerals/Jq/church-numerals-2.jq
Normal file
6
Task/Church-numerals/Jq/church-numerals-2.jq
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def church(f; $m):
|
||||
if $m < 0 then error("church is not defined on negative integers")
|
||||
elif $m == 0 then .
|
||||
elif $m == 1 then f
|
||||
else church(f; $m - 1) | f
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue