aboutsummaryrefslogtreecommitdiff
path: root/lib.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'lib.rkt')
-rw-r--r--lib.rkt9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib.rkt b/lib.rkt
index eb0c201..edb8623 100644
--- a/lib.rkt
+++ b/lib.rkt
@@ -34,6 +34,15 @@
; todo: write a fmt alias to format
; todo: write a namer
+(define (any? proc lst)
+ (foldl (λ (x acc) (if (proc x) #t acc)) #f lst))
+
+(define (all? proc lst)
+ (foldl (λ (x acc) (if (proc x) acc #f)) #t lst))
+
+(define (inc i) (+ i 1))
+(define (dec i) (- i 1))
+
;; removes typing annotations
(define (strip expr)
(match expr