Rearranged code

This commit is contained in:
2022-10-22 18:53:40 -07:00
parent 239aa210c5
commit 123d885adf
6 changed files with 107 additions and 204 deletions

View File

@ -3,30 +3,6 @@ from prompt_toolkit.formatted_text import HTML
from prompt_toolkit import print_formatted_text as printf
from importlib.metadata import version
import lamb.tokens as tokens
def autochurch(runner, num):
"""
Makes a church numeral from an integer.
"""
f = tokens.bound_variable("f", runner = runner)
a = tokens.bound_variable("a", runner = runner)
chain = a
for i in range(num):
chain = tokens.lambda_apply(f, chain)
return tokens.lambda_func(
f,
tokens.lambda_func(
a,
chain
)
)
style = Style.from_dict({ # type: ignore
# Basic formatting