Add showcase for IndentPolicyLeft

pull/132/head
Lennart Spitzner 2018-03-25 18:06:37 +02:00
parent f8c93e06f4
commit e9f764e0e7
1 changed files with 41 additions and 12 deletions

View File

@ -5,6 +5,16 @@ Last updated for brittany version `0.10.0.0`.
## On default settings
default settings are:
~~~~
conf_layout:
lconfig_indentPolicy: IndentPolicyFree
lconfig_importColumn: 50
lconfig_importAsColumn: 50
~~~~
~~~~.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
@ -54,16 +64,16 @@ before. Long identifiers may overflow our 80 column limit:
import qualified Example.Very.Long.Module.Name.Internal
as T
import Example.Very.Long.Module.Name.Internal
( a
, b
, c
( someFunc
, MyDataType
, globalConstant
)
import Example.Very.Long.Module.Name.Internal
( someVeryLongAndDescriptiveFunctionName
)
~~~~
## Alternative setting
## Alternative setting - long identifiers
If you have many long module names or use large identifiers, you might
be interested in these alternative settings:
@ -77,13 +87,32 @@ conf_layout:
Now, our previous examples becomes:
~~~~.hs
import qualified Example.Very.Long.Module.Name.Strict.Internal as T
import Example.Very.Long.Module.Name.Strict.Internal
( a
, b
, c
)
import Example.Very.Long.Module.Name.Strict.Internal
( someVeryLongAndDescriptiveFunctionName
import qualified Example.Very.Long.Module.Name.Internal as T
import Example.Very.Long.Module.Name.Internal
( someFunc
, MyDataType
, globalConstant
)
import Example.Very.Long.Module.Name.Internal
( someVeryLongAndDescriptiveFunctionName )
~~~~
## Alternative setting - "IndentPolicyLeft"
The global switch "indent policy" that has the rough intention of removing any
cases of "hanging indentation" also affects module layouting:
~~~~
conf_layout:
lconfig_indentPolicy: IndentPolicyLeft
~~~~
Now, our previous examples becomes:
~~~~.hs
import qualified Example.Very.Long.Module.Name.Internal as T
import Example.Very.Long.Module.Name.Internal
(someFunc, MyDataType, globalConstant)
import Example.Very.Long.Module.Name.Internal
(someVeryLongAndDescriptiveFunctionName)
~~~~