parent
b142837f1a
commit
f8c93e06f4
|
@ -0,0 +1,89 @@
|
||||||
|
|
||||||
|
Last updated for brittany version `0.10.0.0`.
|
||||||
|
|
||||||
|
# Example layouting of the module header (exports/imports)
|
||||||
|
|
||||||
|
## On default settings
|
||||||
|
|
||||||
|
~~~~.hs
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
{-# LANGUAGE BangPatterns #-}
|
||||||
|
{-# LANGUAGE LambdaCase #-}
|
||||||
|
|
||||||
|
module Main
|
||||||
|
( main
|
||||||
|
)
|
||||||
|
where
|
||||||
|
|
||||||
|
import qualified Paths_brittany
|
||||||
|
import Language.Haskell.Brittany
|
||||||
|
|
||||||
|
import Network.Wai
|
||||||
|
import Network.HTTP.Types
|
||||||
|
import qualified Network.Wai.Handler.Warp as Warp
|
||||||
|
|
||||||
|
import Data.String
|
||||||
|
|
||||||
|
import qualified Data.ByteString as BS
|
||||||
|
import qualified Data.ByteString.Lazy as BSL
|
||||||
|
|
||||||
|
import Control.Monad.Loops
|
||||||
|
|
||||||
|
import qualified Data.Text.Encoding as Text
|
||||||
|
import qualified Data.Text as Text
|
||||||
|
|
||||||
|
import Data.Version ( showVersion )
|
||||||
|
|
||||||
|
import qualified System.Mem
|
||||||
|
import qualified Control.Concurrent
|
||||||
|
import Control.Concurrent.Async ( async
|
||||||
|
, waitEitherCatch
|
||||||
|
, waitEitherCatchCancel
|
||||||
|
)
|
||||||
|
import qualified Data.Aeson as Aeson
|
||||||
|
import Data.Time.Clock
|
||||||
|
import Data.Time.Format
|
||||||
|
import Text.Parsec hiding ( (<|>) )
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
For long module names, things will be moved one line below and aligned as
|
||||||
|
before. Long identifiers may overflow our 80 column limit:
|
||||||
|
|
||||||
|
~~~~.hs
|
||||||
|
import qualified Example.Very.Long.Module.Name.Internal
|
||||||
|
as T
|
||||||
|
import Example.Very.Long.Module.Name.Internal
|
||||||
|
( a
|
||||||
|
, b
|
||||||
|
, c
|
||||||
|
)
|
||||||
|
import Example.Very.Long.Module.Name.Internal
|
||||||
|
( someVeryLongAndDescriptiveFunctionName
|
||||||
|
)
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
## Alternative setting
|
||||||
|
|
||||||
|
If you have many long module names or use large identifiers, you might
|
||||||
|
be interested in these alternative settings:
|
||||||
|
|
||||||
|
~~~~
|
||||||
|
conf_layout:
|
||||||
|
lconfig_importColumn: 21
|
||||||
|
lconfig_importAsColumn: 70
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
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
|
||||||
|
)
|
||||||
|
~~~~
|
Loading…
Reference in New Issue