15 ms·
>small functions that lift types from simple to complex. That's not what Monad is. Monad isn't core to FP, but it's a convenient way to express some common th
by coolsunglasses 10y ago
>small functions that lift types from simple to complex.
That's not what Monad is.
Monad isn't core to FP, but it's a convenient way to express some common things in functional programs.
>In the Haskell language, and many other modern languages, the definition is more complex. Here, a monad is also function, but it is a special type of function. Monads typically “lift” a primitive variable types (Integer, String, etc), to more complex types (MutableString, NullableInt).
This is completely wrong.
>we can define the Haskell monads as that which takes one singular state and outputs another.
This is also wrong.
>Thus, we can arrive at a definition of the computer science monad as a fundamental unit of computation.
It's not at all fundamental to computation. It's a useful pattern that can be reified in a sufficiently expressive type system.
There's no relationship between Leibniz monads and the Monad you see in FP. Sorry.