RE: MonadZero (concluded)

1998-11-09 Thread Hans Aberg
At 01:58 -0800 1998/11/09, Simon Peyton-Jones wrote: Following many protests, the right thing to do seems to be to move MonadPlus to the Monad library. Specifically: class Monad m = MonadPlus m where mzero :: m a mplus :: m a - m a - m a It seems me that the

RE: MonadZero (concluded)

1998-11-09 Thread Simon Peyton-Jones
Following many protests, the right thing to do seems to be to move MonadPlus to the Monad library. Specifically: class Monad m = MonadPlus m where mzero :: m a mplus :: m a - m a - m a filterM :: MonadZero m = (a - m Bool) - [a] - m [a] guard ::

Re: MonadZero (concluded)

1998-11-07 Thread Erik Meijer
Hi Alex, Ok, then I am officially complaining about the elimination of ++ and MonadPlus. It is a much more radical change than changing default default and it will break a lot of MY code at very least. The existing implementation in hugs allows you to write extremely concise and clean code.

MonadZero (concluded)

1998-11-06 Thread Simon Peyton-Jones
OK, I think we have enough agreement to decide: class Monad m where return :: m a (=) :: m a - (a - m b) - m b () :: m a - m b - m b fail :: String - m a fail s = error s (I'm still a bit nervous about capturing 'fail' but there

Re: MonadZero (concluded)

1998-11-06 Thread Philip Wadler
class Monad m where return :: m a (=) :: m a - (a - m b) - m b () :: m a - m b - m b fail :: String - m a fail s = error s IO.fail becomes IO.ioError Looks good. class Monad m = MonadPlus m where mzero :: m

Re: MonadZero (concluded)

1998-11-06 Thread Ralf Hinze
| class Monad m = MonadPlus m where | mzero :: m a | mplus :: m a - m a - m a | | Why is this here? It doesn't need to be in the prelude. Just | leave it for the user to define (and then the user may pick | better names, like Ringad, zero, and +). -- P Yes, nuke

Re: MonadZero (concluded)

1998-11-06 Thread Olaf Chitil
Philip Wadler wrote: class Monad m = MonadPlus m where mzero :: m a mplus :: m a - m a - m a Why is this here? It doesn't need to be in the prelude. Just leave it for the user to define (and then the user may pick better names, like Ringad, zero, and +). --

RE: MonadZero (concluded)

1998-11-06 Thread Simon Peyton-Jones
| class Monad m = MonadPlus m where | mzero :: m a | mplus :: m a - m a - m a | | Why is this here? It doesn't need to be in the prelude. Just | leave it for the user to define (and then the user may pick | better names, like Ringad, zero, and +). -- P Yes, nuke

RE: MonadZero (concluded)

1998-11-06 Thread S. Alexander Jacobson
Does this mean that code which relies on ++ and do notation with Maybe will stop working? -Alex- On Fri, 6 Nov 1998, Simon Peyton-Jones wrote: | class Monad m = MonadPlus m where | mzero :: m a | mplus :: m a - m a - m a | | Why is this here? It doesn't need to be in the

Re: MonadZero (concluded)

1998-11-06 Thread Meurig Sage
Simon Peyton-Jones wrote: Phil's proposal: delete class MonadZero, MonadPlus delete filterM, guard, mfilter, concatM This is ok by me. Does anyone object? Simon If you're going to do this, are you going to change the Maybe library so that it has something equivalent to

RE: MonadZero (concluded)

1998-11-06 Thread Ralf Hinze
| Does this mean that code which relies on ++ and do notation with Maybe | will stop working? ++ is specialized to lists, I'm afraid. Ralf

Re: MonadZero (concluded)

1998-11-06 Thread Lennart Augustsson
This is ok by me. Does anyone object? I don't understand why MonadZero/MonadPlus should go away. Isn't the idea that when in doubt Haskell 98 should do what Haskell 1.4 did? What's the compelling reason for removing these classes? I've used several of the functions that would go away. It

RE: MonadZero (concluded)

1998-11-06 Thread Christian Sievers
Yes, nuke MonadPlus. For Haskell 2 we can put these things in a wonderful Monad library. I had thought that too many functions depend on MonadZero/Plus, but actually, it's the following: filterM :: MonadZero m = (a - m Bool) - [a] - m [a] guard :: MonadZero m = Bool - m () mfilter

Re: MonadZero (concluded)

1998-11-06 Thread Erik Meijer
Phil's proposal: delete class MonadZero, MonadPlus delete filterM, guard, mfilter, concatM This is ok by me. Does anyone object? No, not at all. The prelude should be as small as possible. Erik

RE: MonadZero (concluded?)

1998-11-05 Thread Simon Peyton-Jones
There is no need to have both `mzero' and `mfail' in every monad. Just have `mfail'. Leave `zero' and `plus' to MonadPlus. This should make Eric partially happy. It also means one can simply write instance Monad [] where ...return, =, as before... mfail s = []

Re: MonadZero (concluded?)

1998-11-05 Thread Lennart Augustsson
Option 1: Monad( .., mfail, mzero ), MonadPlus( mplus ) Option 2: Monad( .., mfail), MonadPlus( mzero, mplus ) Option 3: Monad( .., mfail), MonadPlus( mplus ), MonadZero( mzero ) I prefer 3 (with 2 as a close second) since it is most like status quo. -- Lennart

RE: MonadZero (concluded?)

1998-11-05 Thread Jon . Fairbairn
On 5 Nov, Simon Peyton-Jones wrote: I don't like grabbing too many very generic names like zero, plus, fail from the user (this is all in the Prelude, remember). I don't want to grab 'raise' because we're going to want it for exceptions in Haskell 2. I havn't been able to think of

RE: MonadZero (concluded?)

1998-11-05 Thread Koen Claessen
Simon Peyton-Jones wrote about Phil Wadler's idea: | Good idea! So your suggestion is: | | class Monad m where | ...return, =, as before... | | mfail :: String - m a | | class MonadPlus m where | mplus :: m a - m a - m a | mzero :: m a I

RE: MonadZero (concluded?)

1998-11-05 Thread Frank A. Christoph
The names `mzero' and `mfail' are horrible. I like Ralph's suggestion to change `fail' to `raise' in the IO monad, and use `fail' for `mfail'. If that doesn't work, try something else, but please pick names that have a simple meaning in English (as with `return') not monsters like `mzero'

Re: MonadZero (concluded?)

1998-11-04 Thread Philip Wadler
There is no need to have both `mzero' and `mfail' in every monad. Just have `mfail'. Leave `zero' and `plus' to MonadPlus. This should make Eric partially happy. It also means one can simply write instance Monad [] where ...return, =, as before... mfail s = []