The following is the Category Theory Definition of Monad, confirmed as such with Mac Lane, and I am failing to see much resemblance to Haskell Monad. However, shock to my core, Monads are the foundation of Expressions and List in Wolfram Mathematica, verbatim my red selections are a part of the Wolfram language and new features in 14.3 has made implementing Monads as programmable structures much easier.
I compared these definitions and structures with Haskell and saw much confusion:
- Monad is about Transforming Lists or Sequences into Multiplicative Monoids
- And do so in a cookie-cutter manner that works for most? categories
- This causes a structure separation for any function: a) the structure that involves maintaining the data shared amongst all functions via Lists, b) the structure is which actually the body of the function and structure is called Natural Transformation, actually two, see this ref: https://ncatlab.org/nlab/show/monad#Idea
I see faint traces of 3.a in Haskell, in a vague manner that requires much English verbiage to explain.
In Wolfram language 1,3.a are part of the core language!
Q: Why do we need to study programmable Monads in the Wolfram language?
A: Because we need to extend/reimplement some Multiplicative monoids already in place in the language. Or turn programming structures in the language that are not in monoidal forms e.g. we have developed code to turn DiracDelta[ ] function into a pre-fix operator as a product.