Code style guide?

Johan Tibell johan.tibell at
Tue Mar 19 19:33:35 CET 2013

Hi Jason,

On Tue, Mar 19, 2013 at 10:49 AM, Jason Dagit <dagitj at> wrote:

> There are a few recommendations in that guide that I'm not a fan of. Below
> are the main ones.

I'm confident that for each Haskell programmer out there there are a few
recommendations that Haskell programmer is not a fan of. There are some
things in there that I'm not a fan of, depending on the day of the week you
ask me.

Here's the thing about coding styles: having a consistent style is far more
important for code comprehension than whether option A is en epsilon better
than option B. There are several reasonable ways to format things. People
will have preferences. Those preferences don't matter. Consistency does.

> I'm not convinced that data types should have strict constructors by
> default. I agree it's the right thing in many cases, but I don't know how I
> feel about "strict by default" as a recommendation for beginners. It sounds
> like we're encouraging a cargo cult to me. I think it's better to educate
> people.

This is the conclusion I've reached from being the author of and
contributing to many of our core libraries and from being one of the go-to
person for performance related problems in Haskell. It's also the guideline
used at least 1-2 Haskell companies I know of (i.e. among people that use
Haskell in anger). The lazy default is too error prone, even for
experienced Haskellers. Lazy fields force you to be careful. Having to be
careful when programming is not good. It hurts your productivity.

-- Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the cabal-devel mailing list