[Haskell-cafe] question about indentation conventions
Patrick Mylund Nielsen
haskell at patrickmylund.com
Mon Jul 1 03:23:39 CEST 2013
The Haskell Style Guide is quite popular:
I am not sure what the verdict is on functions spanning multiple lines,
other than 80 columns being the max line length. Personally, I do what
haskell-mode + style-guide.el default to, which is to indent to the same
level like you said, e.g.:
fun a b c
d e f
Looking at some of the style guide author's code seems to suggest this is
what he does too:
Of course, you're free to do it whichever way you prefer--it only matters
if you are collaborating with others who don't share your preferences
(always a fun activity.)
It would be cool if there was a The One Formatting Tool for Haskell, a la
"go fmt" for Go, or an 'indent' without so many options that the tool is
On Sun, Jun 30, 2013 at 9:04 PM, Richard Cobbe <cobbe at ccs.neu.edu> wrote:
> 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" <cobbe at ccs.neu.edu> wrote:
> > > 1) Are there wide-spread conventions in the Haskell community for how
> > > indent an application expression that's split across multiple lines?
> > > how to indent an expression that uses infix operators? Or does
> > > pretty much do their own thing?
> Thanks for the pointer, Darren, and I did come across that page earlier.
> 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, where, if, do, case), but it doesn't seem to address function
> applications, beyond implying that it's ok to indent the continuing lines
> of a function application.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe