Re: Indentation of If-Then-Else

2006-10-25 Thread Neil Mitchell
Hi Are these numbers high, or low? I have no idea unless you specify a reference point. Compared to guards, say? Or case? Let's just say that 2000 occursances of a syntactic construct between 3 projects probably means that it's not going to be depreciated ever (thankfully!) Neil _

Re: Indentation of If-Then-Else

2006-10-25 Thread Mirko Rahn
> I have 501 if statements in my current project. Yhc has 626. Hoogle > has 101. If's seem pretty well used to me! 920 in jhc. "I win!" :) Are these numbers high, or low? I have no idea unless you specify a reference point. Compared to guards, say? Or case? For me: find . -name '*.hs' | w

Re: Indentation of If-Then-Else

2006-10-25 Thread Sebastian Sylvan
On 10/24/06, John Meacham <[EMAIL PROTECTED]> wrote: On Tue, Oct 24, 2006 at 05:29:58PM +0100, Neil Mitchell wrote: > >> Actually if-then-else isn't used that often today. Most programmers > >> gave it up in favor of guards. > > > >I question both these statements. Can you cite some evidence here

Re: Indentation of If-Then-Else

2006-10-24 Thread John Meacham
On Tue, Oct 24, 2006 at 05:29:58PM +0100, Neil Mitchell wrote: > >> Actually if-then-else isn't used that often today. Most programmers > >> gave it up in favor of guards. > > > >I question both these statements. Can you cite some evidence here? > > I have 501 if statements in my current project.

Re[2]: Indentation of If-Then-Else

2006-10-24 Thread Bulat Ziganshin
Hello Taral, Tuesday, October 24, 2006, 8:52:47 PM, you wrote: >> if' :: Bool -> a -> a -> a >> if' True x _ = x >> if' False _ y = y > I support the inclusion of if' because it is the Bool catamorphism, > but I would structure its arguments as (a -> a -> Bool -> a) because > that facilitates u

Re: Indentation of If-Then-Else

2006-10-24 Thread Taral
On 10/24/06, Henning Thielemann <[EMAIL PROTECTED]> wrote: For processing conditions, the if-then-else syntax was defined in Haskell98. However it could be simply replaced by the function if' with if' :: Bool -> a -> a -> a if' True x _ = x if' False _ y = y I support the inclusion of if' bec

Re: Indentation of If-Then-Else

2006-10-24 Thread Henning Thielemann
On Tue, 24 Oct 2006, Neil Mitchell wrote: > > > Actually if-then-else isn't used that often today. Most programmers > > > gave it up in favor of guards. > > > > I question both these statements. Can you cite some evidence here? > > I have 501 if statements in my current project. Yhc has 626. Ho

Re: Indentation of If-Then-Else

2006-10-24 Thread Henning Thielemann
On Tue, 24 Oct 2006, Dave Menendez wrote: > Henning Thielemann writes: > > > Actually if-then-else isn't used that often today. Most programmers > > gave it up in favor of guards. > > I question both these statements. Can you cite some evidence here? I have not made statistics. My subjective

Re: Indentation of If-Then-Else

2006-10-24 Thread Neil Mitchell
> Actually if-then-else isn't used that often today. Most programmers > gave it up in favor of guards. I question both these statements. Can you cite some evidence here? I have 501 if statements in my current project. Yhc has 626. Hoogle has 101. If's seem pretty well used to me! Thanks Neil

Re: Indentation of If-Then-Else

2006-10-24 Thread Dave Menendez
Henning Thielemann writes: > Actually if-then-else isn't used that often today. Most programmers > gave it up in favor of guards. I question both these statements. Can you cite some evidence here? -- David Menendez <[EMAIL PROTECTED]> | "In this house, we obey the laws

Re: Indentation of If-Then-Else

2006-10-24 Thread Henning Thielemann
On Mon, 23 Oct 2006, Philippa Cowderoy wrote: > On Mon, 23 Oct 2006, Cale Gibbard wrote: > > > Of course I disagree with this course for all the reasons I stated > > above. The whole point of having high level programming languages is > > so that you can put more work into the tools so that the

Re: Indentation of If-Then-Else

2006-10-23 Thread Henrik Nilsson
> > Yes, one can argue that they should learn "the right way", > > but this is really a very minor detail that many think would > > be best if people didn't have to worry about in the first place. > > There are too much of these minor details. Yes! Which is why this fix is good, as it means peopl

Re: Indentation of If-Then-Else

2006-10-23 Thread Philippa Cowderoy
On Mon, 23 Oct 2006, Cale Gibbard wrote: > Of course I disagree with this course for all the reasons I stated > above. The whole point of having high level programming languages is > so that you can put more work into the tools so that the end user > doesn't have to work as hard. One shouldn't ask

Re: Indentation of If-Then-Else

2006-10-23 Thread Cale Gibbard
On 23/10/06, Henning Thielemann <[EMAIL PROTECTED]> wrote: Cale Gibbard cgibbard at gmail.com, Sun Oct 22 12:23:18 EDT 2006 > The 'then' and 'else' visually separate the parts of the > if-expression, and serve to guide one's eyes when reading code > silently, and one's words when speaking it alo

Re: Indentation of If-Then-Else

2006-10-23 Thread kahl
Henning Thielemann (haskell at henning-thielemann dot de) wrote: > > Cale Gibbard cgibbard at gmail.com, Sun Oct 22 12:23:18 EDT 2006 > > > The 'then' and 'else' visually separate the parts of the > > if-expression, and serve to guide one's eyes when reading code > > silently, and one's wo

Re: Indentation of If-Then-Else

2006-10-23 Thread Cale Gibbard
On 23/10/06, Henning Thielemann <[EMAIL PROTECTED]> wrote: I like to convince other programmers of Haskell by telling them, that Haskell can abstract so powerful, that you can define your own control structures, and consequently most control structures are actually library functions. Two people

Re: Indentation of If-Then-Else

2006-10-23 Thread Henning Thielemann
Cale Gibbard cgibbard at gmail.com, Sun Oct 22 12:23:18 EDT 2006 > The 'then' and 'else' visually separate the parts of the > if-expression, and serve to guide one's eyes when reading code > silently, and one's words when speaking it aloud. This argument is true for every function. I don't see

Re: Indentation of If-Then-Else

2006-10-23 Thread Henning Thielemann
On Mon, 23 Oct 2006, Henrik Nilsson wrote: > The background to the proposal was that Haskell 98 prevents > an arguably reasonable style of indentation, and that this > has turned out to be a problem in practice: i.e. it tends to > trip up a lot of unsuspecting people, in particular beginners. I

Re: Indentation of If-Then-Else

2006-10-23 Thread John Meacham
On Mon, Oct 23, 2006 at 01:36:41PM +0100, Henrik Nilsson wrote: > The background to the proposal was that Haskell 98 prevents > an arguably reasonable style of indentation, and that this > has turned out to be a problem in practice: i.e. it tends to > trip up a lot of unsuspecting people, in partic

Re: Indentation of If-Then-Else

2006-10-23 Thread Henrik Nilsson
Dear All, Henning Thielmann wrote: > I object strongly to the proposal > http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse > because it solves problems with syntactic sugar with even more sugar, > where no sugar is needed at all. > > In order to solve the trouble I propose enha

Re: Indentation of If-Then-Else

2006-10-22 Thread Taral
On 10/22/06, Benjamin Franksen <[EMAIL PROTECTED]> wrote: The problem with this is that in a do block it forces me to use /two/ indentation levels, instead of one, e.g. +1. This is also my primary reason for wanting the sugar. In some code, indentation is at a premium. Forcing the extra indenta

Re: Indentation of If-Then-Else

2006-10-22 Thread Benjamin Franksen
Henning Thielemann wrote: > 1. 'if' syntax should be teached as > if a >then b >else c >This indentation makes pretty clear, >what is condition, and what is the result in both cases. >It just resembles > case a of >True -> b >False -> c . The

Re: Indentation of If-Then-Else

2006-10-22 Thread Cale Gibbard
These suggestions would, firstly, break lots of code for little benefit, and secondly, make code harder to read. The 'then' and 'else' visually separate the parts of the if-expression, and serve to guide one's eyes when reading code silently, and one's words when speaking it aloud. Certainly, one

Re: Indentation of If-Then-Else

2006-10-22 Thread Brian Smith
On 10/22/06, Neil Mitchell <[EMAIL PROTECTED]> wrote: Hi> In order to solve the trouble I propose enhancements> to teachers, compilers and standard libraries:> 1. 'if' syntax should be teached as>  if a>then b>else c I love being able to ident if however I like:I agree with Henn

Re: Indentation of If-Then-Else

2006-10-22 Thread Neil Mitchell
> It seems better to change the language so it works like _everyone_ > expects it does, rather than become syntax dictators. It's hard enough > persuading people to move from C, but when you tell someone that their > perfectly unambiguous sytnax is "wrong", they aren't going to be > amused. I don

Re: Indentation of If-Then-Else

2006-10-22 Thread Henning Thielemann
On Sun, 22 Oct 2006, Neil Mitchell wrote: > It seems better to change the language so it works like _everyone_ > expects it does, rather than become syntax dictators. It's hard enough > persuading people to move from C, but when you tell someone that their > perfectly unambiguous sytnax is "wrong

Re: Indentation of If-Then-Else

2006-10-22 Thread Neil Mitchell
Hi In order to solve the trouble I propose enhancements to teachers, compilers and standard libraries: 1. 'if' syntax should be teached as if a then b else c I love being able to ident if however I like: if a then b else c Where b is a trivial case, and c is the hard one

Indentation of If-Then-Else

2006-10-22 Thread Henning Thielemann
I object strongly to the proposal http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse because it solves problems with syntactic sugar with even more sugar, where no sugar is needed at all. In order to solve the trouble I propose enhancements to teachers, compilers and standard li