haskellmonadswriter-monad

Where is the official definition of 'bind' and 'return' for the Writer Monad in Haskell?


So far I have found:

http://monads.haskell.cz/html/writermonad.html
http://en.wikipedia.org/wiki/Monad_(functional_programming)

which give definitions for >>= and return

Where is the official code?


Solution

  • The Monad instances for the standard transformers are found in the transformers package. For WriterT, look here. Unfortunately, at the moment there's not good tool support for finding where a particular instance is defined -- you just have to do some educated guesswork (or be clever with your favorite grep replacement).