Re: [Haskell-cafe] MonadList?

2006-09-13 Thread Michael Shulman
On 9/13/06, Bertram Felgenhauer [EMAIL PROTECTED] wrote: Michael Shulman wrote: class MonadList m where option :: [a] - m a [...] There's no need for an extra class, it can be done with MonadPlus: option :: MonadPlus m = [a] - m a option = msum . map return But this doesn't always give

Re: [Haskell-cafe] MonadList?

2006-09-13 Thread Twan van Laarhoven
Michael Shulman wrote: The frequent occurence of ListT $ return in my code when I use the ListT monad transformer has made me wonder why there isn't a standard typeclass `MonadList', like those for the other monad transformers, encapsulating the essence of being a list-like monad -- in this