aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/fun/interpreter.bruijn
diff options
context:
space:
mode:
authorMarvin Borner2024-01-18 16:36:34 +0100
committerMarvin Borner2024-01-18 16:36:34 +0100
commit3faeba8c3e31bbe254a4facec8704d419e1bbdb8 (patch)
treee4fedc9d65c2875421ff441a50731ebe2987f8f2 /samples/fun/interpreter.bruijn
parentd22c013e4e74889a82004b05aab1158b98cfafc9 (diff)
More efficient str→blc
Diffstat (limited to 'samples/fun/interpreter.bruijn')
-rw-r--r--samples/fun/interpreter.bruijn5
1 files changed, 2 insertions, 3 deletions
diff --git a/samples/fun/interpreter.bruijn b/samples/fun/interpreter.bruijn
index c2b8020..2e0673a 100644
--- a/samples/fun/interpreter.bruijn
+++ b/samples/fun/interpreter.bruijn
@@ -3,9 +3,8 @@
# note that Tromp's IO uses an additional abstraction at the beginning ("00" ++ ...)
:import std/Combinator .
-:import std/Number .
+:import std/Number/Binary .
:import std/List .
-:import std/Char C
uni [0 0] int [0 Ω] ⧗ (List Bit) → Term
int [[[0 go (2 2) 1]]]
@@ -23,7 +22,7 @@ uni [0 0] int [0 Ω] ⧗ (List Bit) → Term
case-11 [3 [3 var] 4]
var [1 (0 3)]
-str→blc map (=?‣ ∘ C.number!)
+str→blc map (c ∘ lsb)
:test (str→blc "0010") ([[1]] : ([[1]] : ([[0]] : {}[[1]])))