Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@bigworld12 reduce, aggregate and fold are all the same, they are catamorphisms. Generators/unfolds are anamorphic:
f = n => n > 0 ? [n, ...f(n - 1)] : []
Map is the homomorphism. An unfold-fold is an hylomorphism. Then there are para/apomorphisms which are like cata/ana but retaining their shape (I think filter is paramorphic, reduce + keep?)
My beard is not long enough yet to store all the category theory stuff. -
@hack Math.
The constructs programmers use to fold/unfold/map/etc are called morphisms in set theory, transformations in linear algebra and functors in category theory.
To make it confusing, in functional programming (Clojure/Haskell/etc) the category of mappables/reducables is often referred to as functors while functors are labelled morphisms.
JS map, filter, reduce...
joke/meme