Code style guide?

Duncan Coutts duncan.coutts at
Tue Mar 19 14:35:45 CET 2013

On Tue, 2013-03-19 at 00:15 +0000, Ben Millwood wrote:
> Hi everyone,
> Do we have a general notion of what we consider best practices for 
> contributed code to Cabal? Perhaps we should formalise something?
> One of the reasons I wanted to get the wiki back online was in the hope 
> that it had some pointers, but it doesn't seem to. (I've started 
> migrating stuff anyway: have a look at 
> for status).
> For example, many of the Cabal modules have explicit, and therefore 
> quite long, import lists, with no clear organisation, and hence when 
> adding new imports I have to read the entire list to make sure they are 
> not already there, and then wonder where makes sense to insert them. 
> Usually I just make something up with no pattern to it, and hence 
> perpetuate the problem.
> I am happy to start things off with a proposal if no-one else wants to 
> do the writing.

Go for it!

You'll also notice that the code uses different styles in different
places (because of different authors). We've not gone through and tidied
stuff up because we're lazy and because there never seems to be a good
time to do it (it causes conflicts with patches people are working on).


More information about the cabal-devel mailing list