improved performance

main
Inga 🏳‍🌈 1 year ago
parent a96161a5ae
commit 2a75e9eaa9
  1. 4
      day01-hard/main.scm

@ -59,7 +59,7 @@
'(1 2 3)
((first is-not-empty) '(() (1 2 3))))
(define (coalesce-not-empty default) (lambda (value) ((first is-not-empty) (list value default))))
(define (coalesce-not-empty default-lazy) (lambda (value) (if (null? value) (default-lazy) value)))
(define (truthy-chaining f) (lambda (value) (if value (f value) #f)))
@ -116,7 +116,7 @@
(null? values)
'(())
((compose (list
(coalesce-not-empty (f (cdr values)))
(coalesce-not-empty (lambda () (f (cdr values))))
flat
(filter id)
(map

Loading…
Cancel
Save