On Wed, Oct 21, 2009 at 07:49:14PM -0500, Tim Wawrzynczak wrote:
Yes, an if statement must have both 'then' and 'else' branches. As an
example, what if you had
let a = if b == 2 then True else False
and you were missing an else branch? What would 'a' get assigned to?
The if statement
Hi Brent,
Re: 'if expressions, not statements' is an elegant clarification, one
definitely for the haskellwiki, if not there already.
Just for completeness' sake, bottom is a value for any expression.
Wouldn't making the else clause optional by defaulting to undefined
worthy of consideration
On Tue, Oct 27, 2009 at 10:08 AM, Kim-Ee Yeoh a.biurvo...@asuhan.com wrote:
Hi Brent,
Re: 'if expressions, not statements' is an elegant clarification, one
definitely for the haskellwiki, if not there already.
Just for completeness' sake, bottom is a value for any expression.
Wouldn't
Hello Kim-Ee,
Tuesday, October 27, 2009, 8:08:27 PM, you wrote:
Just for completeness' sake, bottom is a value for any expression.
Wouldn't making the else clause optional by defaulting to undefined
worthy of consideration for Evil Haskell?
in this case you will get an exception when
On Tue, Oct 27, 2009 at 7:07 PM, Bulat Ziganshin
bulat.zigans...@gmail.com wrote:
Hello Kim-Ee,
Tuesday, October 27, 2009, 8:08:27 PM, you wrote:
Just for completeness' sake, bottom is a value for any expression.
Wouldn't making the else clause optional by defaulting to undefined
worthy of
Hi Curt,
Thanks for the tips. Looks like return () would be a good candidate for that
null statement I was seeking earlier.
Michael
--- On Sun, 10/25/09, Curt Sampson c...@starling-software.com wrote:
From: Curt Sampson c...@starling-software.com
Subject: Re: [Haskell-cafe] Is there a null
Dan Weston schrieb:
If you have a long if/else if/else chain, you might consider a trivial
case statement with guards. Whether you think this is attractive is a
matter of taste, but it has the fall-through semantics you want and ghc
optimizes the _ pattern matching away:
f x = case () of
On 2009-10-21 18:27 -0700 (Wed), michael rice wrote:
Those nested IF/THEN/ELSEs are real killers. I kind of use them to
sort out my thoughts, then end up with a nested mess. The restructuring
to WHENs went smoothly and looks a lot cleaner besides.
Indeed. Monadic control flow is one of the
in a row and nothing between them. Oh, well, on to restructuring.
Michael
--- On Wed, 10/21/09, Tim Wawrzynczak inforichl...@gmail.com wrote:
From: Tim Wawrzynczak inforichl...@gmail.com
Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
To: michael rice nowg...@yahoo.com
Cc
It looks like both the THEN and the ELSE in an IF expression must each have an
expression. What's a graceful way to do nothing in either or both slots, kind
of like the Fortran CONTINUE statement.
--mr
[mich...@localhost ~]$ ghci
GHCi, version 6.10.3:
If its monadic code then use Control.Monad.when.
If its pure code then omitting the 'else' clause makes no sense
what-so-ever; to omit the else you must know the boolean is always true so
why have the if? See the Common Misunderstandings [1] page I put together
in response to seeing one too many
Yes, an if statement must have both 'then' and 'else' branches. As an
example, what if you had
let a = if b == 2 then True else False
and you were missing an else branch? What would 'a' get assigned to?
The if statement returns a value so must have both branches.
However, in a monadic
wrote:
From: Tim Wawrzynczak inforichl...@gmail.com
Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Wednesday, October 21, 2009, 8:49 PM
Yes, an if statement must have both 'then' and 'else' branches
, on to restructuring.
Michael
--- On *Wed, 10/21/09, Tim Wawrzynczak /inforichl...@gmail.com/* wrote:
From: Tim Wawrzynczak inforichl...@gmail.com
Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe
...@imageworks.com
Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
To: michael rice nowg...@yahoo.com
Cc: Tim Wawrzynczak inforichl...@gmail.com, haskell-cafe@haskell.org
haskell-cafe@haskell.org
Date: Wednesday, October 21, 2009, 9:16 PM
If you have a long if/else if/else
15 matches
Mail list logo