practicalli / practicalli/clojure
eduction
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 117
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
Does anyone actually use eduction? It sounds great in theory but when I benchmark it once in a while, it does not seem to provide much, even with reduce
I see eduction as a way of attaching some transducer to a collection, while not doing anything yet. You can compose this many times, until you actually want to transduce the thing.
user=> (def xform1 (map inc))
#'user/xform1
user=> (def e (eduction xform1 [1 2 3]))
#'user/e
user=> (into [] (map inc) e)
[3 4 5]
range returns something that's a sequence, but also implements IReduce. Similarly, eduction returns something seqable and reducible. Useful in situations where you have a multi-stage pipeline, and each stage can return an eduction, and the rest can treat the previous stuff as sequences (which is especially useful for REPL-interaction).
This has the advantage of not having to write everything in transducers, while still getting the benefit when you do.
TIL that when you print an eduction, it actually realizes the thing?
$ clj -e '(prn (eduction (map inc) [1 2 3]))'
(2 3 4)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository files or tests. Start by reproducing the shown clj command and reviewing the discussion about eduction, transducers, and printing behavior. A useful outcome would first define the documentation change or question to resolve, since the current issue does not specify one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100