>>1006297
A monad is a special type. It's best described by the operations are defined on it:
# Put value `x` in Monad
pure x = Monad x
# Apply function `fn` to `x` when `x` is in Monad
Monad x >>= fn
A monad is an abstraction that encompasses data structures, objects, classes, state machines, timers, file handles, etc. Anything that specifies the way primitive values can be manipulated can be a monad. A chess piece, for example, can be a monad because there are specific positions it can move to. A list is a monad, too, because it links a bunch of values one after another. Monads allow you to define its behavior once and have it run every time your program interacts with it.
It might be beneficial, for example, to say your chess piece can only exist at certain positions by implementing the ``>>='' function:
ChessPieceMonad x >>= fn = if (validPosition (fn x)) then ChessPiece (fn x) else NotAChessPiece
The chess piece can only be accessed by other functions via the ``>>='' operation, so you can make sure certain things are done every time the monadic value is touched. This general idea can be used for doing more complicated, potentially dangerous stuff like logging to a database every time someone logs in to your server.
That's all you should ever know about monads. Don't try to read about it beyond what I wrote here because it's a massive waste of time. It's a lot of pseudointellectual mental masturbation that has never resulted in better software. Haskell is cargo cult bullshit for retards who want to larp as mathematicians.