3 ms·
I was referring to monad, as used in programming, as a transform that can be applied to the elements of a structure. For instance, a transform that wraps each
by Nevermark 3y ago
I was referring to monad, as used in programming, as a transform that can be applied to the elements of a structure.
For instance, a transform that wraps each joining operator, in an expression tree, with a new operator that applies the original operator if all its inputs are defined, but returns a null if any input is null.
The expression tree structure hasn’t changed, but it now consistently (anvoiding error) responds to null values by propagating them.
In my example, a monad converts the list combining operation of concatenation into other list combining operations.
The result was that the identity of concatenation (the empty list) formed the basis for the new list operator’s identity.
—
Both concepts are indeed relevant.
A “monoid-to-aggregator” monad could convert 2-element operations into recursively applied list operations (which also return the single element for unitary lists, and the identity element for empty lists).
Then a structure of monoids processing pairs of values could be transformed into a structure that processes lists.