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
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
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. I
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
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)
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,
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.
In a
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:
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