fourmolu-0.11.0.0: A formatter for Haskell source code
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ormolu.Config

Description

Configuration options used by the tool.

Synopsis

Documentation

data Config region Source #

Ormolu configuration.

Constructors

Config 

Fields

Instances

Instances details
Functor Config Source # 
Instance details

Defined in Ormolu.Config

Methods

fmap :: (a -> b) -> Config a -> Config b #

(<$) :: a -> Config b -> Config a #

Generic (Config region) Source # 
Instance details

Defined in Ormolu.Config

Associated Types

type Rep (Config region) :: Type -> Type #

Methods

from :: Config region -> Rep (Config region) x #

to :: Rep (Config region) x -> Config region #

Show region => Show (Config region) Source # 
Instance details

Defined in Ormolu.Config

Methods

showsPrec :: Int -> Config region -> ShowS #

show :: Config region -> String #

showList :: [Config region] -> ShowS #

Eq region => Eq (Config region) Source # 
Instance details

Defined in Ormolu.Config

Methods

(==) :: Config region -> Config region -> Bool #

(/=) :: Config region -> Config region -> Bool #

type Rep (Config region) Source # 
Instance details

Defined in Ormolu.Config

data ColorMode Source #

Whether to use colors and other features of ANSI terminals.

Constructors

Never 
Always 
Auto 

data RegionIndices Source #

Region selection as the combination of start and end line numbers.

Constructors

RegionIndices 

Fields

Instances

Instances details
Show RegionIndices Source # 
Instance details

Defined in Ormolu.Config

Eq RegionIndices Source # 
Instance details

Defined in Ormolu.Config

data RegionDeltas Source #

Region selection as the length of the literal prefix and the literal suffix.

Constructors

RegionDeltas 

Fields

Instances

Instances details
Show RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

Eq RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

data SourceType Source #

Type of sources that can be formatted by Ormolu.

Constructors

ModuleSource

Consider the input as a regular Haskell module

SignatureSource

Consider the input as a Backpack module signature

Instances

Instances details
Show SourceType Source # 
Instance details

Defined in Ormolu.Config

Eq SourceType Source # 
Instance details

Defined in Ormolu.Config

regionIndicesToDeltas Source #

Arguments

:: Int

Total number of lines in the input

-> RegionIndices

Region indices

-> RegionDeltas

Region deltas

newtype DynOption Source #

A wrapper for dynamic options.

Constructors

DynOption 

Fields

Instances

Instances details
Show DynOption Source # 
Instance details

Defined in Ormolu.Config

Eq DynOption Source # 
Instance details

Defined in Ormolu.Config

Ord DynOption Source # 
Instance details

Defined in Ormolu.Config

Fourmolu configuration

data PrinterOpts f Source #

Options controlling formatting output.

Constructors

PrinterOpts 

Fields

Instances

Instances details
FromJSON PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Monoid PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Semigroup PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Generic (PrinterOpts f) Source # 
Instance details

Defined in Ormolu.Config.Gen

Associated Types

type Rep (PrinterOpts f) :: Type -> Type #

Methods

from :: PrinterOpts f -> Rep (PrinterOpts f) x #

to :: Rep (PrinterOpts f) x -> PrinterOpts f #

type Rep (PrinterOpts f) Source # 
Instance details

Defined in Ormolu.Config.Gen

type Rep (PrinterOpts f) = D1 ('MetaData "PrinterOpts" "Ormolu.Config.Gen" "fourmolu-0.11.0.0-9IRmiTAcaJL22tfcf7hbce" 'False) (C1 ('MetaCons "PrinterOpts" 'PrefixI 'True) (((S1 ('MetaSel ('Just "poIndentation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Int)) :*: (S1 ('MetaSel ('Just "poFunctionArrows") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f FunctionArrowsStyle)) :*: S1 ('MetaSel ('Just "poCommaStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f CommaStyle)))) :*: (S1 ('MetaSel ('Just "poImportExportStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f ImportExportStyle)) :*: (S1 ('MetaSel ('Just "poIndentWheres") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)) :*: S1 ('MetaSel ('Just "poRecordBraceSpace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool))))) :*: ((S1 ('MetaSel ('Just "poNewlinesBetweenDecls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Int)) :*: (S1 ('MetaSel ('Just "poHaddockStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f HaddockPrintStyle)) :*: S1 ('MetaSel ('Just "poHaddockStyleModule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f HaddockPrintStyleModule)))) :*: ((S1 ('MetaSel ('Just "poLetStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f LetStyle)) :*: S1 ('MetaSel ('Just "poInStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f InStyle))) :*: (S1 ('MetaSel ('Just "poUnicode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Unicode)) :*: S1 ('MetaSel ('Just "poRespectful") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)))))))

type PrinterOptsPartial = PrinterOpts Maybe Source #

A version of PrinterOpts where any field can be empty. This corresponds to the information in a config file or in CLI options.

type PrinterOptsTotal = PrinterOpts Identity Source #

A version of PrinterOpts without empty fields.

fillMissingPrinterOpts :: forall f. Applicative f => PrinterOpts Maybe -> PrinterOpts f -> PrinterOpts f Source #

Fill the field values that are Nothing in the first argument with the values of the corresponding fields of the second argument.

data FunctionArrowsStyle Source #

data InStyle Source #

Instances

Instances details
FromJSON InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Bounded InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Enum InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Show InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

(==) :: InStyle -> InStyle -> Bool #

(/=) :: InStyle -> InStyle -> Bool #

data Unicode Source #

Instances

Instances details
FromJSON Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Bounded Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Enum Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Show Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

(==) :: Unicode -> Unicode -> Bool #

(/=) :: Unicode -> Unicode -> Bool #

parsePrinterOptsCLI :: Applicative f => (forall a. PrinterOptsFieldType a => String -> String -> String -> f (Maybe a)) -> f (PrinterOpts Maybe) Source #

parsePrinterOptType :: PrinterOptsFieldType a => String -> Either String a Source #

Loading Fourmolu configuration

loadConfigFile :: FilePath -> IO ConfigFileLoadResult Source #

Read options from a config file, if found. Looks recursively in parent folders, then in XdgConfig, for a file named fourmolu.yaml.

configFileName :: FilePath Source #

Expected file name for YAML config.

Orphan instances