On Tue, Oct 27, 2009 at 7:07 PM, Bulat Ziganshin
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 consideration
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 co
On Tue, Oct 27, 2009 at 10:08 AM, Kim-Ee Yeoh 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 making the else c
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 considerat
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 sta
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 wrote:
From: Curt Sampson
Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
To: "michael rice
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
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 ()
end up with
> two ELSES in a row and nothing between them. Oh, well, on to restructuring.
> Michael
> --- On Wed, 10/21/09, Tim Wawrzynczak wrote:
> From: Tim Wawrzynczak
> Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
> To: "michael rice&quo
On *Wed, 10/21/09, Tim Wawrzynczak //* wrote:
>
>
> From: Tim Wawrzynczak
> Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
> To: "michael rice"
> Cc: haskell-cafe@haskell.org
> Date: Wednesday, October 21, 2009, 8:49 PM
othing between them. Oh, well, on to restructuring.
Michael
--- On *Wed, 10/21/09, Tim Wawrzynczak //* wrote:
From: Tim Wawrzynczak
Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
To: "michael rice"
Cc: haskell-cafe@haskell.org
Date: Wed
: Tim Wawrzynczak
Subject: Re: [Haskell-cafe] Is there a null statement that does nothing?
To: "michael rice"
Cc: haskell-cafe@haskell.org
Date: Wednesday, October 21, 2009, 8:49 PM
Yes, an if statement must have both 'then' and 'else' branches. As an example,
what
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 const
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 man
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: http://www.haskell.org/
15 matches
Mail list logo