
I wonder if there are any Coding Standards or Coding Conventions for Haskell. Does anybody know something about it? Kind regards, Philipp Volgger

pvolgger:
I wonder if there are any Coding Standards or Coding Conventions for Haskell. Does anybody know something about it?
We've collected some style guides on the wiki. You could also look at projects whose code you think is in good style. http://haskell.org/haskellwiki/Category:Style GHC has a style guide. Our small little window manager, xmonad, also has a pretty strict style guide. -- Don

conrad:
On 28/05/07, Donald Bruce Stewart
wrote: Our small little window manager, xmonad, also has a pretty strict style guide.
where? Perhaps I need coffee, but I couldn't find this in the source (xmonad, x11-extras, XMonadContrib) or documentation links from xmonad.org :-/
Oh, sorry, it doesn't have a written style guide, just some conventions we should write down. I was unclear. -- Don

On 5/28/07, Donald Bruce Stewart
conrad:
On 28/05/07, Donald Bruce Stewart
wrote: Our small little window manager, xmonad, also has a pretty strict style guide.
where? Perhaps I need coffee, but I couldn't find this in the source (xmonad, x11-extras, XMonadContrib) or documentation links from xmonad.org :-/
Oh, sorry, it doesn't have a written style guide, just some conventions we should write down. I was unclear.
The same appears to be true with darcs. For example, one that is not enforced but seems to be known to some of the developers is that functions internal to a module use an underscore to separate words and functions which are exported use camel case. An example of one that is strictly enforced in darcs is the use of tabs. There is a script that runs on every record that checks if the user put in tabs and aborts the patch recording if there are tabs in the source. It could be an interesting project to go through the code submitted to hackage and extract different styles. Especially interesting would be to correlate these styles with different factors such as average time to learn the code base, defect density and so on. Jason

On 5/28/07, Donald Bruce Stewart
pvolgger:
I wonder if there are any Coding Standards or Coding Conventions for Haskell. Does anybody know something about it?
We've collected some style guides on the wiki. You could also look at projects whose code you think is in good style.
http://haskell.org/haskellwiki/Category:Style
GHC has a style guide. Our small little window manager, xmonad, also has a pretty strict style guide.
Pugs has a style described here:
http://svn.pugscode.org/pugs/docs/Pugs/Doc/Hack/Style.pod
It recommends against punning datatypes and constructors, since we've noticed
that confuses people reading the code. It also proposes a convention
that minimizes
clashes in field names. Pugs code tends to favor declarative over
expression style
and where over let.
--
Gaal Yahas
participants (5)
-
Conrad Parker
-
dons@cse.unsw.edu.au
-
Gaal Yahas
-
Jason Dagit
-
Philipp Volgger