3 ms·
1. There is probably no faithful grade-school language explanation. Monads are generally the composite of a left adjoint functor followed by its right adjoint.
by ihm 13y ago
1. There is probably no faithful grade-school language explanation. Monads are generally the composite of a left adjoint functor followed by its right adjoint. Adjoint functor pairs often consist of a free and a forgetful functor. A forgetful functor maps objects from some category to similar objects with less structure. E.g., groups to their underlying sets, abelian groups to groups, groups to monoids, etc.
A free functor gives objects with less structure the "minimum possible" stuff needed to be an object with more structure. Importantly it doesn't assume anything about the simpler object. That is, the free construction should work in the same way for all objects of the same kind. For example, we might want to construct the "free monoid" from a set. A monoid has an associative binary operation and an identity element. The most natural way to make a monoid out of the set is by making the elements of the monoid strings of elements of the set, with string concatenation as the operation and the empty string as the identity element.
Composing a free functor with a forgetful functor means we're taking some object, giving it some generic properties, and then "forgetting" what kind of properties it was given. Forgetting is in scare quotes here because a lot of the information about what these properties are like is captured in two natural transformations, `return' and `join'. (I won't attempt to explain what those are. If you have some experience with functional languages, they're a lot like polymorphic functions. E.g., a function that takes a type `A' to the type `List A'.)
Say F is a free functor and G is a forgetful functor. T = G . F is a monad. For some object X in our less-structured category, `return' expresses a correspondence between X and T X. `join' expresses a correspondence between `T (T X)' and `T X' (the basic idea here being that adding free structure twice is similar to adding it once). This is obviously a pretty incomplete (and judging from your request, too mathematical) treatment, but there is no such thing as a faithful non-mathematical treatment of monads. They are mathematical objects.
One neat things about monads in practice is that they're typically pretty useful. Go out and find an arbitrary adjunction, and it's likely that it leads to a useful and/or interesting monad. One fun one is (s,-) and (s ->) which leads to the state monad.
2. You can't really express monads in C and C++. The necessary constructs to talk about these mathematical objects are just not there.
3. If you use Haskell regularly, you'll use them all the time, even outside of your class. They are a useful way of doing things like passing around state or expressing safe exceptions. I doubt Google would ever ask you about something like monads in an interview.
Sorry I can't give you a better idea. The best way to learn about monads is to use them and study the relevant category theory.