aboutsummaryrefslogtreecommitdiffhomepage
path: root/std/List.bruijn
diff options
context:
space:
mode:
Diffstat (limited to 'std/List.bruijn')
-rw-r--r--std/List.bruijn7
1 files changed, 4 insertions, 3 deletions
diff --git a/std/List.bruijn b/std/List.bruijn
index 891dc7c..7673456 100644
--- a/std/List.bruijn
+++ b/std/List.bruijn
@@ -18,7 +18,6 @@ empty? [0 [[[false]]] true]
<>?( empty?
:test (<>?empty) (true)
-:test (<>?(cons (+2) empty)) (false)
# prepends an element to a list
cons P.pair
@@ -26,6 +25,7 @@ cons P.pair
(:) cons
:test ((+1) : ((+2) : empty)) (P.pair (+1) (P.pair (+2) empty))
+:test (<>?((+2) : empty)) (false)
# returns the head of a list or empty
head P.fst
@@ -203,6 +203,7 @@ concat foldr append empty
# TODO: ?
# :test (concat ((((+1) : ((+2) : empty)) : ((+3) : ((+4) : empty))) : empty)) ((+1) : ((+2) : ((+3) : ((+4) : empty))))
+
:test (concat ("a" : ("b" : empty))) ("ab")
# maps a function returning list of list and concatenates
@@ -336,6 +337,6 @@ iterate z [[[rec]]]
rec 0 : (2 1 (1 0))
:test (take (+5) (iterate inc (+0))) (((+0) : ((+1) : ((+2) : ((+3) : ((+4) : empty))))))
-:test (take (+2) (iterate dec (+5))) (((+5) : ((+4) : empty)))
-:test (take (+5) (iterate i (+4))) (repeat (+5) (+4))
+:test (take (+2) (iterate sdec (+5))) (((+5) : ((+4) : empty)))
+:test (take (+5) (iterate i (+4))) (take (+5) (repeat (+4)))
:test (take (+0) (iterate inc (+0))) (empty)