Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Created October 24, 2016 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethagnawl/52b01111172a0d685c603d8784fef6e1 to your computer and use it in GitHub Desktop.
Save ethagnawl/52b01111172a0d685c603d8784fef6e1 to your computer and use it in GitHub Desktop.
racket compose
(define (count-zeros lst)
((compose length
(curry filter zero?)
flatten)
lst))
(count-zeros '(0 0 (1 (1 (0 0) 0)) (1 0 0))) ;; 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment