Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Patrick Mylund Nielsen
I prefer the other style--as do others, evidently (see the example in my first reply.) I agree that this was a good discussion, but let's not conclude so easily that the entire community is in favor of one thing or the other. On Mon, Jul 1, 2013 at 8:24 PM, Richard Cobbe wrote: > On Sun, Jun 30

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard Cobbe
On Sun, Jun 30, 2013 at 07:53:08PM -0400, Richard Cobbe wrote: > Two questions: And what I've concluded by reading this thread: > 1) Are there wide-spread conventions in the Haskell community for how to > indent an application expression that's split across multiple lines? Well, there's general

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard A. O'Keefe
On 2/07/2013, at 12:00 AM, Richard Cobbe wrote: > Sure. So my first question boils down to which of the two alternatives > below does the community prefer? (To be clear about the intended > semantics: this is the application of the function f to the arguments x, y, > and z.) > >f x >y

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tikhon Jelvis
That's certainly true. As I mentioned, I was actually considering a *pretty-printer* rather than an automatic indentation tool per se. The end results are similar, but the pretty-printer is really only the latter part of the problem: it's predicated on already having a valid AST. My particular use

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 9:56 AM, Tikhon Jelvis wrote: > I've thought about writing an automatic indenting tool for Haskell (or, > more accurately, a pretty-printer) for another project I have, and this is > the main thing that threw me off. While automatic indentation might make > sense for less e

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tikhon Jelvis
<|> baz > > ~IRS > > From: haskell-cafe-boun...@haskell.org [haskell-cafe-boun...@haskell.org] > on behalf of Richard Cobbe [co...@ccs.neu.edu] > Sent: Monday, July 01, 2013 8:00 AM > To: haskell-cafe@haskell.org > Subject: Re:

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 3:43 AM, Tom Ellis < tom-lists-haskell-cafe-2...@jaguarpaw.co.uk> wrote: > > is OK but > > f (g x > > y z) > > is not. > > It seems to me that this means > > f x1 x2 > x3 x4 > > is not. The OP was initially asking about this situation. > If you wrote th

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Sturdy, Ian
___ From: haskell-cafe-boun...@haskell.org [haskell-cafe-boun...@haskell.org] on behalf of Richard Cobbe [co...@ccs.neu.edu] Sent: Monday, July 01, 2013 8:00 AM To: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] question about indentation conventions On Mon, Jul 01, 2013 at 05:

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard Cobbe
On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe wrote: > > It looked pretty explicit to me: > > The golden rule of indentation > ... > you will do fairly well if you just remember a single rule: > Code which is part of some expression should be indented >

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Johannes Waldmann
> Code which is part of some expression should be indented > further in than the beginning of that expression [...] Yes. Then the next question is "how much further in". My answer is: it does not matter, but make it consistent (like 4 spaces), with the implication that indentation sh

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tom Ellis
On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe wrote: > On 1/07/2013, at 1:04 PM, Richard Cobbe wrote: > > I should have been clearer in my original question: I'm curious about what > > to do when a multi-argument function application gets split across lines. > > That wiki page dicsus

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Richard A. O'Keefe
On 1/07/2013, at 1:04 PM, Richard Cobbe wrote: > > I should have been clearer in my original question: I'm curious about what > to do when a multi-argument function application gets split across lines. > That wiki page dicsusses how the layout rule interacts with various special > forms (let, whe

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Patrick Mylund Nielsen
The Haskell Style Guide is quite popular: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md (accompying elisp module: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.el) I am not sure what the verdict is on functions spanning multiple lines, other tha

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Richard Cobbe
On Sun, Jun 30, 2013 at 05:41:46PM -0700, Darren Grant wrote: > Hi Richard, > > This page helped me when starting out: > http://en.wikibooks.org/wiki/Haskell/Indentation > On 2013-06-30 4:55 PM, "Richard Cobbe" wrote: > > 1) Are there wide-spread conventions in the Haskell community for how to

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Darren Grant
Hi Richard, This page helped me when starting out: http://en.wikibooks.org/wiki/Haskell/Indentation On 2013-06-30 4:55 PM, "Richard Cobbe" wrote: > I hope I'm not starting a holy war with this, but I'm curious about an > aspect of coding style that's been bugging me for a while, and I'm not > fi