fourmolu-0.14.1.0: A formatter for Haskell source code
Safe HaskellSafe-Inferred
LanguageGHC2021

Ormolu.Config

Description

Configuration options used by the tool.

Synopsis

Documentation

data Config region #

Ormolu configuration.

Constructors

Config 

Fields

Instances

Instances details
Functor Config # 
Instance details

Defined in Ormolu.Config

Methods

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

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

Generic (Config region) # 
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) # 
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) # 
Instance details

Defined in Ormolu.Config

Methods

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

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

type Rep (Config region) # 
Instance details

Defined in Ormolu.Config

type Rep (Config region) = D1 ('MetaData "Config" "Ormolu.Config" "fourmolu-0.14.1.0-2wQij9nkG5b1W1cxrUIOrR" 'False) (C1 ('MetaCons "Config" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cfgDynOptions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [DynOption]) :*: S1 ('MetaSel ('Just "cfgFixityOverrides") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FixityOverrides)) :*: (S1 ('MetaSel ('Just "cfgModuleReexports") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ModuleReexports) :*: (S1 ('MetaSel ('Just "cfgDependencies") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set PackageName)) :*: S1 ('MetaSel ('Just "cfgUnsafe") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "cfgDebug") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "cfgCheckIdempotence") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "cfgSourceType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SourceType))) :*: (S1 ('MetaSel ('Just "cfgColorMode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ColorMode) :*: (S1 ('MetaSel ('Just "cfgRegion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 region) :*: S1 ('MetaSel ('Just "cfgPrinterOpts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PrinterOptsTotal))))))

data ColorMode #

Whether to use colors and other features of ANSI terminals.

Constructors

Never 
Always 
Auto 

Instances

Instances details
Bounded ColorMode # 
Instance details

Defined in Ormolu.Terminal

Enum ColorMode # 
Instance details

Defined in Ormolu.Terminal

Show ColorMode # 
Instance details

Defined in Ormolu.Terminal

Eq ColorMode # 
Instance details

Defined in Ormolu.Terminal

data RegionIndices #

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

Constructors

RegionIndices 

Fields

Instances

Instances details
Show RegionIndices # 
Instance details

Defined in Ormolu.Config

Eq RegionIndices # 
Instance details

Defined in Ormolu.Config

data RegionDeltas #

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

Constructors

RegionDeltas 

Fields

Instances

Instances details
Show RegionDeltas # 
Instance details

Defined in Ormolu.Config

Eq RegionDeltas # 
Instance details

Defined in Ormolu.Config

data SourceType #

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 # 
Instance details

Defined in Ormolu.Config

Eq SourceType # 
Instance details

Defined in Ormolu.Config

overapproximatedDependencies :: Config region -> Set PackageName #

Return all dependencies of the module. This includes both the declared dependencies of the component we are working with and all potential module re-export targets.

regionIndicesToDeltas #

Arguments

:: Int

Total number of lines in the input

-> RegionIndices

Region indices

-> RegionDeltas

Region deltas

newtype DynOption #

A wrapper for dynamic options.

Constructors

DynOption 

Fields

Instances

Instances details
Show DynOption # 
Instance details

Defined in Ormolu.Config

Eq DynOption # 
Instance details

Defined in Ormolu.Config

Ord DynOption # 
Instance details

Defined in Ormolu.Config

Fourmolu configuration

data PrinterOpts f #

Options controlling formatting output.

Constructors

PrinterOpts 

Fields

Instances

Instances details
FromJSON PrinterOptsPartial # 
Instance details

Defined in Ormolu.Config

Monoid PrinterOptsPartial # 
Instance details

Defined in Ormolu.Config

Semigroup PrinterOptsPartial # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsPartial # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsTotal # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsPartial # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsTotal # 
Instance details

Defined in Ormolu.Config

Generic (PrinterOpts f) # 
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) # 
Instance details

Defined in Ormolu.Config.Gen

type Rep (PrinterOpts f)

type PrinterOptsPartial = PrinterOpts Maybe #

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 #

A version of PrinterOpts without empty fields.

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

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

resolvePrinterOpts :: [PrinterOptsPartial] -> PrinterOptsTotal #

Apply the given configuration in order (later options override earlier).

data FunctionArrowsStyle #

data LetStyle #

Instances

Instances details
FromJSON LetStyle # 
Instance details

Defined in Ormolu.Config.Gen

Bounded LetStyle # 
Instance details

Defined in Ormolu.Config.Gen

Enum LetStyle # 
Instance details

Defined in Ormolu.Config.Gen

Show LetStyle # 
Instance details

Defined in Ormolu.Config.Gen

Eq LetStyle # 
Instance details

Defined in Ormolu.Config.Gen

data InStyle #

Instances

Instances details
FromJSON InStyle # 
Instance details

Defined in Ormolu.Config.Gen

Bounded InStyle # 
Instance details

Defined in Ormolu.Config.Gen

Enum InStyle # 
Instance details

Defined in Ormolu.Config.Gen

Show InStyle # 
Instance details

Defined in Ormolu.Config.Gen

Eq InStyle # 
Instance details

Defined in Ormolu.Config.Gen

Methods

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

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

data Unicode #

Instances

Instances details
FromJSON Unicode # 
Instance details

Defined in Ormolu.Config.Gen

Bounded Unicode # 
Instance details

Defined in Ormolu.Config.Gen

Enum Unicode # 
Instance details

Defined in Ormolu.Config.Gen

Show Unicode # 
Instance details

Defined in Ormolu.Config.Gen

Eq Unicode # 
Instance details

Defined in Ormolu.Config.Gen

Methods

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

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

data ColumnLimit #

Constructors

NoLimit 
ColumnLimit Int 

Instances

Instances details
FromJSON ColumnLimit # 
Instance details

Defined in Ormolu.Config.Gen

Show ColumnLimit # 
Instance details

Defined in Ormolu.Config.Gen

Eq ColumnLimit # 
Instance details

Defined in Ormolu.Config.Gen

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

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

Loading Fourmolu configuration

loadConfigFile :: FilePath -> IO ConfigFileLoadResult #

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

configFileName :: FilePath #

Expected file name for YAML config.

Orphan instances