Code style guide?

Ben Millwood haskell at benmachine.co.uk
Wed Mar 20 00:03:25 CET 2013


On Tue, Mar 19, 2013 at 07:29:27AM -0700, Johan Tibell wrote:
>If you need to write a style guide, why not use
>
>https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
>
>as a starting point. It's widely used in the Haskell community nowadays
>(e.g. it's a common recommendation on IRC) and it's based on the coding
>style of Duncan, Bryan, and Don for the most part.

Sounds like a good place to start. My pet disagreement with it is 
everywhere that it allows the indentation of some code to depend on the 
*name* of the thing being defined. I always indent my code so that I can 
change names without reindenting anything.

I like the import rules, though. Should probably clarify "standard 
library": do we mean boot packages, or the HP?

In any case, it would be nice to get from the major contributors to 
Cabal a "yes" (even if it is a "yes but") or a "no" on the above style 
guide.

My inclination with regards to newly enforcing it would be to fix code 
that you're visiting anyway – e.g. every time you add an import, 
re-organise the entire list. That way you minimise conflicts and 
everything gets done sooner or later.

regards,
Ben



More information about the cabal-devel mailing list