The good news is since they aren't complex, once you understand the abstraction, it appears to be very simple in retrospect.
http://byorgey.wordpress.com/2009/01/12/abstraction-intuitio...
The good news is since they aren't complex, once you understand the abstraction, it appears to be very simple in retrospect.
http://byorgey.wordpress.com/2009/01/12/abstraction-intuitio...
So if I understand monads correctly then they are basically functions that work like a Unix pipe between functions which takes input data in a monadic container, performs some side effects (I/O for instance), and yields another monadic container with output data that is forwarded to the next function - all that without violating the purely functional character of the whole application chain.
https://en.wikipedia.org/wiki/Monads_in_functional_programmi...
That much is true of any applicative functor (which is a superset of monads). The additional power monad gives you is to change up the later portions of that chain based on the earlier results.
Of course, a lot of uses of "monads" don't really make the distinction (and applicative functors are plenty useful).
What you're describing is the IO monad to first approximation, most monads don't perform side-effects at all ( List, Cont, Maybe, ... ) and the bind operations only performs some pure overloaded operation specific to the monad instance. For example the list monad performs the concatMap function which is pure.
instance Monad [] where
m >>= f = concat (map f m)
return x = [x]