curryparty 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
curryparty/__init__.py CHANGED
@@ -41,6 +41,12 @@ class Term:
41
41
  reduced = beta_reduce(self.nodes, lamb, b)
42
42
  return Term(reduced)
43
43
 
44
+ def reduce(self):
45
+ last_non_reduced = self
46
+ for term in self.reduction_chain():
47
+ last_non_reduced = term
48
+ return last_non_reduced
49
+
44
50
  def reduction_chain(self) -> Iterable["Term"]:
45
51
  term = self
46
52
  while True:
@@ -49,7 +55,7 @@ class Term:
49
55
  if term is None:
50
56
  break
51
57
 
52
- def show_reduction(self):
58
+ def show_beta(self):
53
59
  candidates = find_redexes(self.nodes)
54
60
  if len(candidates) == 0:
55
61
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: curryparty
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: Python playground to learn lambda calculus
5
5
  Author: Antonin P
6
6
  Author-email: Antonin P <antonin.peronnet@telecom-paris.fr>
@@ -62,6 +62,12 @@ If you use a notebook such as jupyternotebook or marimo, you will see something
62
62
 
63
63
  You can also use `term.show_reduction` to get an animated version.
64
64
 
65
+ # Tutorial
66
+
67
+ `lambda.py` shows a tutorial in marimo format. Click on the button to try it out:
68
+
69
+ [![Open with marimo](https://marimo.io/shield.svg)](https://marimo.app/github.com/rambip/curryparty/blob/main/lambda.py)
70
+
65
71
  # How it works
66
72
 
67
73
  Under the wood, all the terms are converted into a list of nodes, that can either be a `lambda`, an `application` (with 2 arguments) or a `variable` (with 0 arguments).
@@ -1,8 +1,8 @@
1
- curryparty/__init__.py,sha256=vVym-L4SH1WOMKs8_NLYg1GdEa0m8X7NrIcUi6OTwOA,5582
1
+ curryparty/__init__.py,sha256=VvTj-jDrxDqR9g-tg0IHPx81JAc6xBrRstXzyUpdtu4,5744
2
2
  curryparty/core.py,sha256=9vQJlUeYXJ71SkRV6tUiw1RSu7gUJu4f_e6w2Zt-tLQ,3665
3
3
  curryparty/display.py,sha256=8PRRP-9ys-q0OEvIhePxM9di_2n0WRkwA13qK5sq4JU,6783
4
4
  curryparty/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  curryparty/utils.py,sha256=Q5vYGQ1PvxDPntjF39D-6geAwDDdXz7pVFiAyUGE4WM,2839
6
- curryparty-0.1.1.dist-info/WHEEL,sha256=RRVLqVugUmFOqBedBFAmA4bsgFcROUBiSUKlERi0Hcg,79
7
- curryparty-0.1.1.dist-info/METADATA,sha256=8Ie0YQGsWFrfVG6ddNRCbvSguRV9LEP0Qmah_XlXUKI,1922
8
- curryparty-0.1.1.dist-info/RECORD,,
6
+ curryparty-0.2.0.dist-info/WHEEL,sha256=KSLUh82mDPEPk0Bx0ScXlWL64bc8KmzIPNcpQZFV-6E,79
7
+ curryparty-0.2.0.dist-info/METADATA,sha256=GfshNERaRDxxfFSXbpKcFf7wEmgRLY6N-yQ-0bhw0sI,2139
8
+ curryparty-0.2.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.21
2
+ Generator: uv 0.9.22
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any