Skip to content

Instantly share code, notes, and snippets.

@raspasov
Last active March 20, 2023 22:21
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 raspasov/c25c9b635fa9ef7c8743cb115dae45dd to your computer and use it in GitHub Desktop.
Save raspasov/c25c9b635fa9ef7c8743cb115dae45dd to your computer and use it in GitHub Desktop.
Transducers interrupt
(transduce
(comp
(map-indexed (fn [idx item] [idx item]))
(map (fn [[idx item]]
(println "sending to space" idx)
[idx item])))
(fn
;;completing arity
([accum] accum)
;;reduce arity
([accum [idx item]]
(if (< 100 idx)
(reduced accum)
accum)))
[]
(range))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment