3 ms·
this is a super interesting reply - you kind of translated these monadic concepts to python. Is there a resource for this ? or good old intuition ?
by sandGorgon 9y ago
this is a super interesting reply - you kind of translated these monadic concepts to python.
Is there a resource for this ? or good old intuition ?
- crimsonalucard 9y agoNah no single resource, it took me a lot of time to understand monads, going over many resources. Just remember Absolutely ANY design pattern / data structure can be a monad as long as you can get an internal value out of that abstraction and define a bind operator to compose monads together. This rule tells it all: (>>=) :: m a -> (a -> m b) -> m b m is the abstraction wrapper and a is the internal thing that is wrapped. You can wrap it in a type string, a list. Even like a binary tree can be a monad. You can define the bind operator to do whatever you want, it just needs to follow the type signature above and be associative.
- crimsonalucard 9y agoOh and nothing was translated. A monad is a general concept applicable to almost any language. Deep understanding of a monad is to understand it outside of the haskell ecosystem.