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
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
> >
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
> 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
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
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
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