[Haskell-cafe] Coding conventions for Haskell?

Daniel Fischer daniel.is.fischer at web.de
Mon Sep 27 09:44:59 EDT 2010


On Monday 27 September 2010 14:52:18, Henning Thielemann wrote:
> data Foo a b =
>      Foo    a
>    | Bar      b
>    | Foobar a b
>
> avoids this, at least for the type name "Foo".

Tastes vary, but I find that ugly. I much rather have the '=' aligned with 
the '|'.

data Foo a b
    = Foo      a
    | Bar        b
    | Foobar  a b
      deriving (Eq, Ord)

There, that looks good.

With the one exception that as a rule, in a multi-constructor type, none of 
the constructors should be identical to the type name (IMO).


More information about the Haskell-Cafe mailing list