4

Haskell monad functions are not easy to understand, where can I find usage examples?

4 Answers4

3

You mean the functions with names like fooM and fooM_? You can understand them better possibly by reading their source code, or when you write a do-expression, you could think if that can be expressed with a relevant fooM-function.

You could also take a look at this question.

Community
  • 1
  • 1
mattiast
  • 1,934
  • 12
  • 18
3

I wrote a case study called "Anatomy of a New Monad". Is this what you meant?

Paul Johnson
  • 17,438
  • 3
  • 42
  • 59
2

The answer I was looking for is: [A tour of the Haskell monad functions][1]

But I'm still looking for something similar for the non standard monads.

[1]: http://members.chello.nl/hjgtuyl/tourdemonad.html A tour of the Haskell monad functions

2

The new O'Reilly book Real World Haskell has some good chapters on monads, which include the kind of wacky ad hoc user-defined abstract monad function stuff you seem to be looking for.

comingstorm
  • 25,557
  • 3
  • 43
  • 67
  • You can find that book here: http://book.realworldhaskell.org/read/ (Saving you a trip to Google :-) – Magnus Jan 17 '09 at 09:56