3 ms·
Do you want to know "what a monad is" in math or Haskell? In programming, a monad is a particular design pattern, which is exposed in a particular interface (a
by dllthomas 13y ago
Do you want to know "what a monad is" in math or Haskell?
In programming, a monad is a particular design pattern, which is exposed in a particular interface (appropriately called Monad) in Haskell. The design pattern supports a certain way of combining things. The fact that so many disparate things support this interface (State, IO, Software Transactional Memory, Readers, Writers, Continuations...) means that all of the code we write that generically talks to that interface can talk about any of those things, and that's pretty powerful. The fact that one of those things is, in a certain sense, voodoo (IO) shouldn't lead you to think they all are - Monad is just an interface for combining things according to certain patterns.