Re: Extending the do-notation

2001-01-08 Thread George Russell
Sebastien Carlier wrote: > > > import Monad > > ... > > do y <- liftM unzip m1 > > Thanks. > > I'm constantly amazed by the number of tricks one has > to know before he can write concise code using the > do-notation (among other things, I used to write > "x <- return $ m" instead of "let x

Re: Extending the do-notation

2001-01-07 Thread Joe English
Sebastien Carlier wrote: > Sometimes I need to write code which looks like this: > >do x <- m1 > > let y = unzip x > > ... -- never using x anymore > > I thinks the following extension to do-notation would be useful: > >pat <- exp1 # exp2 ; exp3 > would be rewritten as > >

Re: Extending the do-notation

2001-01-07 Thread Sven Panne
Sebastien Carlier wrote: > I'm constantly amazed by the number of tricks one has > to know before he can write concise code using the > do-notation [...] In my experience it is not the do-notation itself, but the mixture of monadic actions and higher-order functions. But after a while you´ll real

Re: Extending the do-notation

2001-01-07 Thread Sebastien Carlier
> import Monad > ... > do y <- liftM unzip m1 Thanks. I'm constantly amazed by the number of tricks one has to know before he can write concise code using the do-notation (among other things, I used to write "x <- return $ m" instead of "let x = m"). Is there a paper demonstrating the most

Re: Extending the do-notation

2001-01-07 Thread Marcin 'Qrczak' Kowalczyk
Sun, 7 Jan 2001 15:03:07 +0100, Sebastien Carlier <[EMAIL PROTECTED]> pisze: > Does this extension already exist ? Yes. import Monad ... do y <- liftM unzip m1 -- __("< Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRC

Re: Extending the do-notation

2001-01-07 Thread Robert Ennals
On Sun, 7 Jan 2001, Sebastien Carlier wrote: > > Sometimes I need to write code which looks like this: > >do x <- m1 > > let y = unzip x > > ... -- never using x anymore > > I thinks the following extension to do-notation would be useful: > >pat <- exp1 # exp2 ; exp3 > wo

Extending the do-notation

2001-01-07 Thread Sebastien Carlier
Sometimes I need to write code which looks like this: >do x <- m1 > let y = unzip x > ... -- never using x anymore I thinks the following extension to do-notation would be useful: >pat <- exp1 # exp2 ; exp3 would be rewritten as >exp2 >>= ((\pat -> exp3) . exp1) so that