Re: [Haskell-cafe] Lists vs. Monads

2005-07-16 Thread Jonathan Cast
Greg Buchholz [EMAIL PROTECTED] wrote: Here's a question for the Haskell community that I've been wrestling with lately. When we say lists are monads what does that mean? I can see one of two things. First the slightly superficial... A.) Lists can be made members of the

[Haskell-cafe] Lists vs. Monads

2005-07-15 Thread Greg Buchholz
Here's a question for the Haskell community that I've been wrestling with lately. When we say lists are monads what does that mean? I can see one of two things. First the slightly superficial... A.) Lists can be made members of the Monads class, and you can define a couple of

Re: [Haskell-cafe] Lists vs. Monads

2005-07-15 Thread Cale Gibbard
Interpretation A is correct. The type (constructor) of Lists gives a monad together with return x = [x] and x = f = concatMap f x. Interpretation B doesn't really work, because the monad interface does not give one the ability to write head or tail. You basically have return (which gets you from