Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Fritz Ruehr
On Jul 26, 2006, at 6:44 PM, Sebastian Sylvan wrote: For example ... if :: Bool - a - a - a if True t _ = t if False _ e = e -- example usage myAbs x = if (x 0) (negate x) x I suppose there might also be a case for flipping the arguments about like this: if :: a - a - Bool - a

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Niklas Broberg
I often find myself at odds with this choice. The reason is that I use Haskell as a host for embedded languages, and these often come with their own control flows. So I find myself wanting to write my own definition of the if-then-else construct that works on terms of some other type, e.g. tests

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Tom Schrijvers
I often find myself at odds with this choice. The reason is that I use Haskell as a host for embedded languages, and these often come with their own control flows. So I find myself wanting to write my own definition of the if-then-else construct that works on terms of some other type, e.g. tests

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Chris Kuklewicz
Niklas Broberg wrote: I often find myself at odds with this choice. The reason is that I use Haskell as a host for embedded languages, and these often come with their own control flows. So I find myself wanting to write my own definition of the if-then-else construct that works on terms of some

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Henning Thielemann
On Wed, 26 Jul 2006, Fritz Ruehr wrote: On Jul 26, 2006, at 6:44 PM, Sebastian Sylvan wrote: For example ... if :: Bool - a - a - a if True t _ = t if False _ e = e -- example usage myAbs x = if (x 0) (negate x) x I suppose there might also be a case for flipping the

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Jon Fairbairn
On 2006-07-27 at 01:33EDT Paul Hudak wrote: Thanks for asking about this -- it probably should be in the paper. Dan Doel's answer is closest to the truth: I imagine the answer is that having the syntax for it looks nicer/is clearer. if a b c could be more cryptic than if a then b

RE: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Simon Peyton-Jones
to put a feature request in Trac? Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Niklas | Broberg | Sent: 27 July 2006 09:01 | To: Haskell-cafe | Subject: Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax? | | I often find myself

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Tomasz Zielonka
On Thu, Jul 27, 2006 at 10:22:31AM +0100, Jon Fairbairn wrote: On 2006-07-27 at 01:33EDT Paul Hudak wrote: Thanks for asking about this -- it probably should be in the paper. Dan Doel's answer is closest to the truth: I imagine the answer is that having the syntax for it looks

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Jon Fairbairn
On 2006-07-27 at 13:01+0200 Tomasz Zielonka wrote: But because if-then-else is an expression, there is another problem. That was exactly my point when I made the muttering about self-bracketing (if ... fi, like everything else, is an expression in Algol68) all those years ago. I really regret

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Brian Hulley
Jon Fairbairn wrote: On 2006-07-27 at 13:01+0200 Tomasz Zielonka wrote: Also, after a few years of Haskell programming, I am still not sure how to indent if-then-else. what I was alluding to in my footnote... I think there's really only one way when it needs to occupy more than one line:

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread David House
On 27/07/06, Brian Hulley [EMAIL PROTECTED] wrote: I think there's really only one way when it needs to occupy more than one line: if c then t else f Confusingly, if c then t else f Also works, although no-one really knows why. -- -David House, [EMAIL

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Brian Hulley
David House wrote: On 27/07/06, Brian Hulley [EMAIL PROTECTED] wrote: I think there's really only one way when it needs to occupy more than one line: if c then t else f Confusingly, if c then t else f Also works, although no-one really knows why. Only if

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread David House
On 27/07/06, Brian Hulley [EMAIL PROTECTED] wrote: I'd be in favour of /if /case /let /\ etc instead of fi esac tel because it looks more systematic and follows the usual XML conventions for end tags. I'd suggest that floating point division should just be written `divide` - it's just a very

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-27 Thread Mike Gunter
Thanks for the answer. (And doubly thanks for giving the answer I hoped for!) I propose that ifThenElse and thenElseIf be added to the Prelude for Haskell'. While these names are a bit long, I think we want both functions and these names make the behaviors clear (to me, at least). Comments?

[Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-26 Thread Mike Gunter
I had hoped the History of Haskell paper would answer a question I've pondered for some time: why does Haskell have the if-then-else syntax? The paper doesn't address this. What's the story? thanks, -m ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-26 Thread mvanier
As opposed to what? Mike Mike Gunter wrote: I had hoped the History of Haskell paper would answer a question I've pondered for some time: why does Haskell have the if-then-else syntax? The paper doesn't address this. What's the story? thanks, -m

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-26 Thread Sebastian Sylvan
On 7/27/06, mvanier [EMAIL PROTECTED] wrote: As opposed to what? For example case-of, guards (in combination with let or where), or just a function: if :: Bool - a - a - a if True t _ = t if False _ e = e -- example usage myAbs x = if (x 0) (negate x) x /S -- Sebastian Sylvan

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-26 Thread Donn Cave
Quoth Sebastian Sylvan [EMAIL PROTECTED]: | On 7/27/06, mvanier [EMAIL PROTECTED] wrote: | As opposed to what? | | For example case-of, guards (in combination with let or where), or | just a function: | | if :: Bool - a - a - a | if True t _ = t | if False _ e = e | | -- example usage | myAbs x =

Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?

2006-07-26 Thread Paul Hudak
Mike Gunter wrote: I had hoped the History of Haskell paper would answer a question I've pondered for some time: why does Haskell have the if-then-else syntax? The paper doesn't address this. What's the story? thanks, -m Thanks for asking about this -- it probably should be in the paper.