<https:// open.substack.com/pub/michaeljbu rry/p/foundations-...>
A transducer is simply a function of the form `a -> List<b>`. Yes this is fully polymorphic, i.e. it holds even for transducers that only operate over just lists.
In this case `mapping` is just
This lens views a transducer through the lens of the `eduction` function as a more souped up `map`. Whereas with a normal `map` you only get to use a function `a -> b`, which means you can't change the underlying structure, with `eduction` you get to use `a -> List<b>` (again a transducer), where you "keep" any elements that are in the output list and you "discard" any elements not in the output list.
So e.g. `mapping` would be:
(defn mapping [f] (fn [x] [(f x)]))
or in Python def mapping(f):
return lambda x: [f(x)]
and `filtering` would be: (defn filtering [f] (fn [x] [if (f x) [x] []]))
or in Python def filtering(f):
return lambda x: [x] if f(x) else []
In my opinion way clearer and easier!For more details on the full equivalence see https://news.ycombinator.com/item?id=27778423
The current presentation of transducers has always felt like a wart in Clojure.
Consciousness or self awareness is of course a different question, and ones whose answer seems less clear right now.
Knee jerk dismissing the evidence in front of your eyes because you find it unbelievable that we can achieve true reasoning via scaled matrix multiplication is understandable, but also betrays a lack of imagination and flexibility of thought. The world is full of bizarre wonders and this is just one more to add to the list.
Life solves problems itself poses or collides with. Tools solve problems only when applied.
Loading parent story...
Loading comment...
Loading parent story...
Loading comment...