Re: [Haskell-cafe] About mplus

2007-09-05 Thread ajb
G'day all. Slight nit... Quoting ok <[EMAIL PROTECTED]>: I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy mzero `mplus` x = x x `mplus` mzero = x mzero >>= f

Re: [Haskell-cafe] About mplus

2007-09-05 Thread Jules Bean
ok wrote: On 5 Sep 2007, at 6:16 pm, Henning Thielemann wrote: I think it is very sensible to define the generalized function in terms of the specific one, not vice versa. The specific point at issue is that I would rather use ++ than `mplus`. In every case where both are defined, they agree,

Re: [Haskell-cafe] About mplus

2007-09-05 Thread Jules Bean
David Benbennick wrote: You mean (++) = mplus. I've wondered that too. Similarly, one should define map = fmap. And a lot of standard list functions can be generalized to MonadPlus, for example you can define filter :: (MonadPlus m) => (a -> Bool) -> m a -> m a Somehow this filter fails my

Re: [Haskell-cafe] About mplus

2007-09-05 Thread Henning Thielemann
On Wed, 5 Sep 2007, ok wrote: On 5 Sep 2007, at 6:16 pm, Henning Thielemann wrote: I think it is very sensible to define the generalized function in terms of the specific one, not vice versa. The specific point at issue is that I would rather use ++ than `mplus`. In every case where both a

Re: [Haskell-cafe] About mplus

2007-09-04 Thread ok
On 5 Sep 2007, at 6:16 pm, Henning Thielemann wrote: I think it is very sensible to define the generalized function in terms of the specific one, not vice versa. The specific point at issue is that I would rather use ++ than `mplus`. In every case where both are defined, they agree, so it is

Re: [Haskell-cafe] About mplus

2007-09-04 Thread Henning Thielemann
On Tue, 4 Sep 2007, David Benbennick wrote: On 9/4/07, ok <[EMAIL PROTECTED]> wrote: I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy mzero `mplus` x = x x `mplus`

Re: [Haskell-cafe] About mplus

2007-09-04 Thread David Benbennick
On 9/4/07, ok <[EMAIL PROTECTED]> wrote: > I've been thinking about making a data type an instance of MonadPlus. > From the Haddock documentation at haskell.org, I see that any such > instance should satisfy > > mzero `mplus` x = x > x `mplus` mzero = x > mzero >>= f =

Re: [Haskell-cafe] About mplus

2007-09-04 Thread Stefan O'Rear
On Wed, Sep 05, 2007 at 03:35:03PM +1200, ok wrote: > I've been thinking about making a data type an instance of MonadPlus. > From the Haddock documentation at haskell.org, I see that any such > instance should satisfy > > mzero `mplus` x = x > x `mplus` mzero = x > mzero >>= f

[Haskell-cafe] About mplus

2007-09-04 Thread ok
I've been thinking about making a data type an instance of MonadPlus. From the Haddock documentation at haskell.org, I see that any such instance should satisfy mzero `mplus` x = x x `mplus` mzero = x mzero >>= f = mzero v >> mzero = mzero but is that all