nilcons / hi2

haskell-indentation 2nd try
GNU General Public License v3.0
33 stars 3 forks source link

Export list indentation #3

Open superbobry opened 11 years ago

superbobry commented 11 years ago

According to haskell-style-guide, export list should be indented with 4 spaces:

module Graphics.Shape
    ( Shape(..)
    , SomeShape(..)
    , triangle
    ) where

The current implementation indents it as:

module Graphics.Shape
       ( Shape(..)
       , SomeShape(..)
       , sphere
       , triangle
       ) where

I guess the solution is to add a configurable variable for export list offset.

errge commented 11 years ago

Well, I disagree with the haskell-style-guide here.

First, 4 seems to be very inconsistent, it'd be easier to agree to 2, because we use 2 everywhere else too.

Second, indenting to the module name seems acceptable in this case, because it will always be indented by the length of "module " and not more. But this second reason seems to be invalidated by the behavior in this case:

module Graphics.Shape (
  Shape(..),
  triangle) where

So we're indenting to 2 here, so maybe we should indent to 2 in the other case too.

Let's see how it goes while fixing this, if it's easy to add a variable to have it at 4, I will add it.

hvr commented 11 years ago

First, 4 seems to be very inconsistent, it'd be easier to agree to 2, because we use 2 everywhere else too.

I don't understand this one; the style guide actually tries hard to use 4 chars indentations almost everywhere except for where clauses, which use an "odd" 2-char as a visual cue.