From 3faeba8c3e31bbe254a4facec8704d419e1bbdb8 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 18 Jan 2024 16:36:34 +0100 Subject: More efficient str→blc --- samples/fun/interpreter.bruijn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'samples/fun/interpreter.bruijn') 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]]))) -- cgit v1.2.3