What exactly is a monad in terms of functional programming in Haskell? What relation does it have with the mathematical concept of a monad?