aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--samples/euler/048.bruijn1
-rw-r--r--samples/fun/huge.bruijn2
-rw-r--r--std/Combinator.bruijn6
-rw-r--r--std/Math/Real.bruijn2
-rw-r--r--std/Tree/Finger.bruijn2
5 files changed, 9 insertions, 4 deletions
diff --git a/samples/euler/048.bruijn b/samples/euler/048.bruijn
index e4f2cbb..f86407f 100644
--- a/samples/euler/048.bruijn
+++ b/samples/euler/048.bruijn
@@ -1,7 +1,6 @@
# TODO: also very slow
:import std/Combinator .
-:import std/String .
:import std/Math .
solve [∑ (+1) → 0 | [pow-mod 0 0 (+10000000000)]]
diff --git a/samples/fun/huge.bruijn b/samples/fun/huge.bruijn
index 974f2ea..9631f45 100644
--- a/samples/fun/huge.bruijn
+++ b/samples/fun/huge.bruijn
@@ -1,5 +1,5 @@
# "bruijn huge.bruijn"
-# some of the fastest growing functions per blc length
+# some fun fast growing functions per blc length
# 55 bits inflating to 65536 bits, John Tromp
huge-55 [[0 0 0 0 [[0 [[0]] 1]]] (+2u)]
diff --git a/std/Combinator.bruijn b/std/Combinator.bruijn
index 452ebfb..d414b76 100644
--- a/std/Combinator.bruijn
+++ b/std/Combinator.bruijn
@@ -23,6 +23,12 @@ b'' [[[[[4 (3 2 1 0)]]]]] ⧗ (d → e) → (a → b → c → d) → a → b â†
∘∘∘‣ b''
+# 4x function composition
+# more can be generated using Church application: (+xu) b or even (+xu) b'/b''
+…∘∘∘∘… (+4u) b
+
+∘∘∘∘‣ …∘∘∘∘…
+
# becard combinator
b''' [[[[3 (2 (1 0))]]]] ⧗ (c → d) → (b → c) → (a → b) → a → d
diff --git a/std/Math/Real.bruijn b/std/Math/Real.bruijn
index d334117..d3510fa 100644
--- a/std/Math/Real.bruijn
+++ b/std/Math/Real.bruijn
@@ -130,7 +130,7 @@ pow-n [L.nth-iterate (mul 0) (+1.0r)] ⧗ Real → Number → Real
# e^x using infinite limit
# tex: \lim_{n\to\infty}(1+x/n)^n
-lim-exp [[pow-n [(N.add 2 1) : N.--1] 0]] ⧗ Number → Real
+lim-exp [[pow-n ++(1 / (number→real 0)) 0]] ⧗ Real → Real
# natural logarithm using Taylor expansion
# tex: \sum_{n=0}^\infty\frac{2}{2n+1}(\frac{x-1}{x+1})^{2n+1}
diff --git a/std/Tree/Finger.bruijn b/std/Tree/Finger.bruijn
index 50f0f2c..4ded9ce 100644
--- a/std/Tree/Finger.bruijn
+++ b/std/Tree/Finger.bruijn
@@ -279,7 +279,7 @@ append3 z [[[[2 case-deep case-single case-empty]]]] ⧗ (FingerTree a) → (Lis
single-empty 3
case-empty 0
-append [[append3 1 L.empty 0]]
+append [[append3 1 L.empty 0]] ⧗ (FingerTree a) → (FingerTree a) → (FingerTree a)
…++… append