On Nov 27, 2007 4:45 AM, Chris Eidhof <[EMAIL PROTECTED]> wrote:
> First, some people want to use return just as an imperative programmer
> would use it: to exit from a function. So the programmer doesn't
> expect the commands after that return are executed.
>
This is more a problem with the name
On 27 nov 2007, at 10:14, Reinier Lamers wrote:
Chris Eidhof wrote:
On 26 nov 2007, at 19:48, Henning Thielemann wrote:
I wonder whether it is a typical mistake of beginners
to write 'return' within a do-block (that is, not at the end)
and if it is possible to avoid this mistake by clever typ
Chris Eidhof wrote:
On 26 nov 2007, at 19:48, Henning Thielemann wrote:
I wonder whether it is a typical mistake of beginners
to write 'return' within a do-block (that is, not at the end)
and if it is possible to avoid this mistake by clever typing.
In a proper monad 'return' can be fused with
On 26 Nov 2007, at 10:48 AM, Henning Thielemann wrote:
I wonder whether it is a typical mistake of beginners
to write 'return' within a do-block (that is, not at the end)
and if it is possible to avoid this mistake by clever typing.
In a proper monad 'return' can be fused with subsequent action
Hi Henning,
> I wonder whether it is a typical mistake of beginners
> to write 'return' within a do-block (that is, not at the end)
> and if it is possible to avoid this mistake by clever typing.
There are legitimate uses of return inside a do, see:
http://www.cs.york.ac.uk/fp/darcs/catch/catch_1
On Tue, 2007-11-27 at 00:15 +0100, Chris Eidhof wrote:
> On 26 nov 2007, at 19:48, Henning Thielemann wrote:
> > I wonder whether it is a typical mistake of beginners
> > to write 'return' within a do-block (that is, not at the end)
> > and if it is possible to avoid this mistake by clever typing.
On 26 nov 2007, at 19:48, Henning Thielemann wrote:
I wonder whether it is a typical mistake of beginners
to write 'return' within a do-block (that is, not at the end)
and if it is possible to avoid this mistake by clever typing.
In a proper monad 'return' can be fused with subsequent actions,
an
Hello Henning,
Monday, November 26, 2007, 9:48:29 PM, you wrote:
> I wonder whether it is a typical mistake of beginners
> to write 'return' within a do-block (that is, not at the end)
don't forget that `return` is also used to force evaluation:
do let n = a+b
return $! n
writeChan c (n,1
I wonder whether it is a typical mistake of beginners
to write 'return' within a do-block (that is, not at the end)
and if it is possible to avoid this mistake by clever typing.
In a proper monad 'return' can be fused with subsequent actions,
and thus it is not necessary within a sequence of actio