fourmolu-0.17.0.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Config

Contents

- Fourmolu configuration
  - Loading Fourmolu configuration
- Orphan instances

Description

Configuration options used by the tool.

Synopsis

- data Config region = Config {
  - cfgDynOptions :: ![DynOption]
  - cfgFixityOverrides :: !FixityOverrides
  - cfgModuleReexports :: !ModuleReexports
  - cfgDependencies :: !(Set PackageName)
  - cfgUnsafe :: !Bool
  - cfgDebug :: !Bool
  - cfgCheckIdempotence :: !Bool
  - cfgSourceType :: !SourceType
  - cfgColorMode :: !ColorMode
  - cfgRegion :: !region
  - cfgPrinterOpts :: !PrinterOptsTotal
  - cfgLocalModules :: !(Set ModuleName)
  }
- data ColorMode
  - = Never
  - | Always
  - | Auto
- data RegionIndices = RegionIndices {
  - regionStartLine :: !(Maybe Int)
  - regionEndLine :: !(Maybe Int)
  }
- data RegionDeltas = RegionDeltas {
  - regionPrefixLength :: !Int
  - regionSuffixLength :: !Int
  }
- data SourceType
  - = ModuleSource
  - | SignatureSource
- defaultConfig :: Config RegionIndices
- overapproximatedDependencies :: Config region -> Set PackageName
- regionIndicesToDeltas :: Int -> RegionIndices -> RegionDeltas
- newtype DynOption = DynOption {
  - unDynOption :: String
  }
- dynOptionToLocatedStr :: DynOption -> Located String
- data PrinterOpts (f :: Type -> Type) = PrinterOpts {
  - poIndentation :: f Int
  - poColumnLimit :: f ColumnLimit
  - poFunctionArrows :: f FunctionArrowsStyle
  - poCommaStyle :: f CommaStyle
  - poImportExportStyle :: f ImportExportStyle
  - poImportGrouping :: f ImportGrouping
  - poIndentWheres :: f Bool
  - poRecordBraceSpace :: f Bool
  - poNewlinesBetweenDecls :: f Int
  - poHaddockStyle :: f HaddockPrintStyle
  - poHaddockStyleModule :: f HaddockPrintStyleModule
  - poLetStyle :: f LetStyle
  - poInStyle :: f InStyle
  - poSingleConstraintParens :: f SingleConstraintParens
  - poSingleDerivingParens :: f SingleDerivingParens
  - poSortConstraints :: f Bool
  - poSortDerivedClasses :: f Bool
  - poSortDerivingClauses :: f Bool
  - poTrailingSectionOperators :: f Bool
  - poUnicode :: f Unicode
  - poRespectful :: f Bool
  }
- type PrinterOptsPartial = PrinterOpts Maybe
- type PrinterOptsTotal = PrinterOpts Identity
- defaultPrinterOpts :: PrinterOpts Identity
- defaultPrinterOptsYaml :: String
- fillMissingPrinterOpts :: forall (f :: Type -> Type). Applicative f => PrinterOpts Maybe -> PrinterOpts f -> PrinterOpts f
- resolvePrinterOpts :: [PrinterOptsPartial] -> PrinterOptsTotal
- data CommaStyle
  - = Leading
  - | Trailing
- data FunctionArrowsStyle
  - = TrailingArrows
  - | LeadingArrows
  - | LeadingArgsArrows
- data HaddockPrintStyle
  - = HaddockSingleLine
  - | HaddockMultiLine
  - | HaddockMultiLineCompact
- data HaddockPrintStyleModule
  - = PrintStyleInherit
  - | PrintStyleOverride HaddockPrintStyle
- data ImportExportStyle
  - = ImportExportLeading
  - | ImportExportTrailing
  - | ImportExportDiffFriendly
- data ImportGrouping
  - = ImportGroupLegacy
  - | ImportGroupPreserve
  - | ImportGroupSingle
  - | ImportGroupByScope
  - | ImportGroupByQualified
  - | ImportGroupByScopeThenQualified
  - | ImportGroupCustom (NonEmpty ImportGroup)
- data ImportGroup = ImportGroup {
  - igName :: !(Maybe String)
  - igRules :: !(NonEmpty ImportGroupRule)
  }
- data ImportGroupRule = ImportGroupRule {
  - igrModuleMatcher :: !ImportModuleMatcher
  - igrQualifiedMatcher :: !QualifiedImportMatcher
  - igrPriority :: !ImportRulePriority
  }
- data ImportModuleMatcher
  - = MatchAllModules
  - | MatchLocalModules
  - | MatchGlob !Glob
- newtype ImportRulePriority = ImportRulePriority Word8
- matchAllRulePriority :: ImportRulePriority
- matchLocalRulePriority :: ImportRulePriority
- defaultImportRulePriority :: ImportRulePriority
- data QualifiedImportMatcher
  - = MatchQualifiedOnly
  - | MatchUnqualifiedOnly
  - | MatchBothQualifiedAndUnqualified
- data LetStyle
  - = LetAuto
  - | LetInline
  - | LetNewline
  - | LetMixed
- data InStyle
  - = InLeftAlign
  - | InRightAlign
  - | InNoSpace
- data Unicode
  - = UnicodeDetect
  - | UnicodeAlways
  - | UnicodeNever
- data ColumnLimit
  - = NoLimit
  - | ColumnLimit Int
- data SingleDerivingParens
  - = DerivingAuto
  - | DerivingAlways
  - | DerivingNever
- parsePrinterOptsCLI :: Applicative f => (forall a. PrinterOptsFieldType a => String -> String -> String -> f (Maybe a)) -> f (PrinterOpts Maybe)
- parsePrinterOptType :: PrinterOptsFieldType a => String -> Either String a
- data ConfigNotFound = ConfigNotFound {
  - searchDirs :: [FilePath]
  }
- findConfigFile :: FilePath -> IO (Either ConfigNotFound FilePath)
- configFileName :: FilePath
- data FourmoluConfig = FourmoluConfig {
  - cfgFilePrinterOpts :: PrinterOptsPartial
  - cfgFileFixities :: FixityOverrides
  - cfgFileReexports :: ModuleReexports
  }
- emptyConfig :: FourmoluConfig

# Documentation

data Config region #

Ormolu configuration.

Constructors

Config |

Fields

- cfgDynOptions :: ![DynOption]

  Dynamic options to pass to GHC parser

- cfgFixityOverrides :: !FixityOverrides

  Fixity overrides

- cfgModuleReexports :: !ModuleReexports

  Module reexports to take into account when doing fixity resolution

- cfgDependencies :: !(Set PackageName)

  Known dependencies, if any

- cfgUnsafe :: !Bool

  Do formatting faster but without automatic detection of defects

- cfgDebug :: !Bool

  Output information useful for debugging

- cfgCheckIdempotence :: !Bool

  Checks if re-formatting the result is idempotent

- cfgSourceType :: !SourceType

  How to parse the input (regular haskell module or Backpack file)

- cfgColorMode :: !ColorMode

  Whether to use colors and other features of ANSI terminals

- cfgRegion :: !region

  Region selection

- cfgPrinterOpts :: !PrinterOptsTotal
- cfgLocalModules :: !(Set ModuleName)

#### 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) |

Instance details

Defined in Ormolu.Config

type Rep (Config region) = D1 ('MetaData "Config" "Ormolu.Config" "fourmolu-0.17.0.0-3YMEcBLevRzEJ6gJbl7GNk" '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) :*: S1 ('MetaSel ('Just "cfgLocalModules") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set ModuleName)))))))

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.17.0.0-3YMEcBLevRzEJ6gJbl7GNk" '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) :*: S1 ('MetaSel ('Just "cfgLocalModules") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set ModuleName)))))))

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 Methods minBound :: ColorMode # maxBound :: ColorMode #
Enum ColorMode # |
Instance details Defined in Ormolu.Terminal Methods succ :: ColorMode -> ColorMode # pred :: ColorMode -> ColorMode # toEnum :: Int -> ColorMode # fromEnum :: ColorMode -> Int # enumFrom :: ColorMode -> [ColorMode] # enumFromThen :: ColorMode -> ColorMode -> [ColorMode] # enumFromTo :: ColorMode -> ColorMode -> [ColorMode] # enumFromThenTo :: ColorMode -> ColorMode -> ColorMode -> [ColorMode] #
Show ColorMode # |
Instance details Defined in Ormolu.Terminal Methods showsPrec :: Int -> ColorMode -> ShowS # show :: ColorMode -> String # showList :: [ColorMode] -> ShowS #
Eq ColorMode # |
Instance details Defined in Ormolu.Terminal Methods (==) :: ColorMode -> ColorMode -> Bool # (/=) :: ColorMode -> ColorMode -> Bool #

data RegionIndices #

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

Constructors

RegionIndices |

Fields

- regionStartLine :: !(Maybe Int)

  Start line of the region to format

- regionEndLine :: !(Maybe Int)

  End line of the region to format

#### Instances

Instances details

Show RegionIndices # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> RegionIndices -> ShowS # show :: RegionIndices -> String # showList :: [RegionIndices] -> ShowS #
Eq RegionIndices # |
Instance details Defined in Ormolu.Config Methods (==) :: RegionIndices -> RegionIndices -> Bool # (/=) :: RegionIndices -> RegionIndices -> Bool #

data RegionDeltas #

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

Constructors

RegionDeltas |

Fields

- regionPrefixLength :: !Int

  Prefix length in number of lines

- regionSuffixLength :: !Int

  Suffix length in number of lines

#### Instances

Instances details

Show RegionDeltas # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> RegionDeltas -> ShowS # show :: RegionDeltas -> String # showList :: [RegionDeltas] -> ShowS #
Eq RegionDeltas # |
Instance details Defined in Ormolu.Config Methods (==) :: RegionDeltas -> RegionDeltas -> Bool # (/=) :: RegionDeltas -> RegionDeltas -> Bool #

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 Methods showsPrec :: Int -> SourceType -> ShowS # show :: SourceType -> String # showList :: [SourceType] -> ShowS #
Eq SourceType # |
Instance details Defined in Ormolu.Config Methods (==) :: SourceType -> SourceType -> Bool # (/=) :: SourceType -> SourceType -> Bool #

defaultConfig :: Config RegionIndices #

Default ``Config` `RegionIndices``.

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

Convert `RegionIndices` into `RegionDeltas`.

newtype DynOption #

A wrapper for dynamic options.

Constructors

DynOption |

Fields

- unDynOption :: String

#### Instances

Instances details

Show DynOption # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> DynOption -> ShowS # show :: DynOption -> String # showList :: [DynOption] -> ShowS #
Eq DynOption # |
Instance details Defined in Ormolu.Config Methods (==) :: DynOption -> DynOption -> Bool # (/=) :: DynOption -> DynOption -> Bool #
Ord DynOption # |
Instance details Defined in Ormolu.Config Methods compare :: DynOption -> DynOption -> Ordering # (<) :: DynOption -> DynOption -> Bool # (<=) :: DynOption -> DynOption -> Bool # (>) :: DynOption -> DynOption -> Bool # (>=) :: DynOption -> DynOption -> Bool # max :: DynOption -> DynOption -> DynOption # min :: DynOption -> DynOption -> DynOption #

dynOptionToLocatedStr :: DynOption -> Located String #

Convert `DynOption` to ``Located` `String``.

# Fourmolu configuration

data PrinterOpts (f :: Type -> Type) #

Options controlling formatting output.

Constructors

PrinterOpts |

Fields

- poIndentation :: f Int

  Number of spaces per indentation step

- poColumnLimit :: f ColumnLimit

  Max line length for automatic line breaking

- poFunctionArrows :: f FunctionArrowsStyle

  Styling of arrows in type signatures

- poCommaStyle :: f CommaStyle

  How to place commas in multi-line lists, records, etc.

- poImportExportStyle :: f ImportExportStyle

  Styling of import/export lists

- poImportGrouping :: f ImportGrouping

  Rules for grouping import declarations

- poIndentWheres :: f Bool

  Whether to full-indent or half-indent 'where' bindings past the preceding body

- poRecordBraceSpace :: f Bool

  Whether to leave a space before an opening record brace

- poNewlinesBetweenDecls :: f Int

  Number of spaces between top-level declarations

- poHaddockStyle :: f HaddockPrintStyle

  How to print Haddock comments

- poHaddockStyleModule :: f HaddockPrintStyleModule

  How to print module docstring

- poLetStyle :: f LetStyle

  Styling of let blocks

- poInStyle :: f InStyle

  How to align the 'in' keyword with respect to the 'let' keyword

- poSingleConstraintParens :: f SingleConstraintParens

  Whether to put parentheses around a single constraint

- poSingleDerivingParens :: f SingleDerivingParens

  Whether to put parentheses around a single deriving class

- poSortConstraints :: f Bool

  Whether to sort constraints

- poSortDerivedClasses :: f Bool

  Whether to sort derived classes

- poSortDerivingClauses :: f Bool

  Whether to sort deriving clauses

- poTrailingSectionOperators :: f Bool

  Whether to place section operators (those that are infixr 0, such as $) in trailing position, continuing the expression indented below

- poUnicode :: f Unicode

  Output Unicode syntax

- poRespectful :: f Bool

  Give the programmer more choice on where to insert blank lines

#### Instances

Instances details

FromJSON PrinterOptsPartial # |
Instance details Defined in Ormolu.Config Methods parseJSON :: Value -> Parser PrinterOptsPartial # parseJSONList :: Value -> Parser [PrinterOptsPartial] # omittedField :: Maybe PrinterOptsPartial #
Monoid PrinterOptsPartial # |
Instance details Defined in Ormolu.Config Methods mempty :: PrinterOptsPartial # mappend :: PrinterOptsPartial -> PrinterOptsPartial -> PrinterOptsPartial # mconcat :: [PrinterOptsPartial] -> PrinterOptsPartial #
Semigroup PrinterOptsPartial # |
Instance details Defined in Ormolu.Config Methods (<>) :: PrinterOptsPartial -> PrinterOptsPartial -> PrinterOptsPartial # sconcat :: NonEmpty PrinterOptsPartial -> PrinterOptsPartial # stimes :: Integral b => b -> PrinterOptsPartial -> PrinterOptsPartial #
Show PrinterOptsPartial # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> PrinterOptsPartial -> ShowS # show :: PrinterOptsPartial -> String # showList :: [PrinterOptsPartial] -> ShowS #
Show PrinterOptsTotal # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> PrinterOptsTotal -> ShowS # show :: PrinterOptsTotal -> String # showList :: [PrinterOptsTotal] -> ShowS #
Eq PrinterOptsPartial # |
Instance details Defined in Ormolu.Config Methods (==) :: PrinterOptsPartial -> PrinterOptsPartial -> Bool # (/=) :: PrinterOptsPartial -> PrinterOptsPartial -> Bool #
Eq PrinterOptsTotal # |
Instance details Defined in Ormolu.Config Methods (==) :: PrinterOptsTotal -> PrinterOptsTotal -> Bool # (/=) :: PrinterOptsTotal -> PrinterOptsTotal -> Bool #
Generic (PrinterOpts f) # |

Instance details

Defined in Ormolu.Config.Gen

Associated Types

type Rep (PrinterOpts f) |
Instance details Defined in Ormolu.Config.Gen type Rep (PrinterOpts f)

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.

defaultPrinterOpts :: PrinterOpts Identity #

defaultPrinterOptsYaml :: String #

fillMissingPrinterOpts :: forall (f :: Type -> Type). 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 CommaStyle #

Constructors

Leading |
Trailing |

#### Instances

Instances details

FromJSON CommaStyle # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser CommaStyle # parseJSONList :: Value -> Parser [CommaStyle] # omittedField :: Maybe CommaStyle #
Bounded CommaStyle # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: CommaStyle # maxBound :: CommaStyle #
Enum CommaStyle # |

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: CommaStyle -> CommaStyle #

pred :: CommaStyle -> CommaStyle #

toEnum :: Int -> CommaStyle #

fromEnum :: CommaStyle -> Int #

enumFrom :: CommaStyle -> [CommaStyle] #

enumFromThen :: CommaStyle -> CommaStyle -> [CommaStyle] #

enumFromTo :: CommaStyle -> CommaStyle -> [CommaStyle] #

enumFromThenTo :: CommaStyle -> CommaStyle -> CommaStyle -> [CommaStyle] #

Show CommaStyle # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> CommaStyle -> ShowS # show :: CommaStyle -> String # showList :: [CommaStyle] -> ShowS #
Eq CommaStyle # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: CommaStyle -> CommaStyle -> Bool # (/=) :: CommaStyle -> CommaStyle -> Bool #

data FunctionArrowsStyle #

Constructors

TrailingArrows |
LeadingArrows |
LeadingArgsArrows |

#### Instances

Instances details

FromJSON FunctionArrowsStyle # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser FunctionArrowsStyle # parseJSONList :: Value -> Parser [FunctionArrowsStyle] # omittedField :: Maybe FunctionArrowsStyle #
Bounded FunctionArrowsStyle # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: FunctionArrowsStyle # maxBound :: FunctionArrowsStyle #
Enum FunctionArrowsStyle # |

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: FunctionArrowsStyle -> FunctionArrowsStyle #

pred :: FunctionArrowsStyle -> FunctionArrowsStyle #

toEnum :: Int -> FunctionArrowsStyle #

fromEnum :: FunctionArrowsStyle -> Int #

enumFrom :: FunctionArrowsStyle -> [FunctionArrowsStyle] #

enumFromThen :: FunctionArrowsStyle -> FunctionArrowsStyle -> [FunctionArrowsStyle] #

enumFromTo :: FunctionArrowsStyle -> FunctionArrowsStyle -> [FunctionArrowsStyle] #

enumFromThenTo :: FunctionArrowsStyle -> FunctionArrowsStyle -> FunctionArrowsStyle -> [FunctionArrowsStyle] #

Show FunctionArrowsStyle # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> FunctionArrowsStyle -> ShowS # show :: FunctionArrowsStyle -> String # showList :: [FunctionArrowsStyle] -> ShowS #
Eq FunctionArrowsStyle # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: FunctionArrowsStyle -> FunctionArrowsStyle -> Bool # (/=) :: FunctionArrowsStyle -> FunctionArrowsStyle -> Bool #

data HaddockPrintStyle #

Constructors

HaddockSingleLine |
HaddockMultiLine |
HaddockMultiLineCompact |

#### Instances

Instances details

FromJSON HaddockPrintStyle # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser HaddockPrintStyle # parseJSONList :: Value -> Parser [HaddockPrintStyle] # omittedField :: Maybe HaddockPrintStyle #
Bounded HaddockPrintStyle # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: HaddockPrintStyle # maxBound :: HaddockPrintStyle #
Enum HaddockPrintStyle # |

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: HaddockPrintStyle -> HaddockPrintStyle #

pred :: HaddockPrintStyle -> HaddockPrintStyle #

toEnum :: Int -> HaddockPrintStyle #

fromEnum :: HaddockPrintStyle -> Int #

enumFrom :: HaddockPrintStyle -> [HaddockPrintStyle] #

enumFromThen :: HaddockPrintStyle -> HaddockPrintStyle -> [HaddockPrintStyle] #

enumFromTo :: HaddockPrintStyle -> HaddockPrintStyle -> [HaddockPrintStyle] #

enumFromThenTo :: HaddockPrintStyle -> HaddockPrintStyle -> HaddockPrintStyle -> [HaddockPrintStyle] #

Show HaddockPrintStyle # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> HaddockPrintStyle -> ShowS # show :: HaddockPrintStyle -> String # showList :: [HaddockPrintStyle] -> ShowS #
Eq HaddockPrintStyle # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: HaddockPrintStyle -> HaddockPrintStyle -> Bool # (/=) :: HaddockPrintStyle -> HaddockPrintStyle -> Bool #

data HaddockPrintStyleModule #

Constructors

PrintStyleInherit |
PrintStyleOverride HaddockPrintStyle |

#### Instances

Instances details

FromJSON HaddockPrintStyleModule # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser HaddockPrintStyleModule # parseJSONList :: Value -> Parser [HaddockPrintStyleModule] # omittedField :: Maybe HaddockPrintStyleModule #
Show HaddockPrintStyleModule # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> HaddockPrintStyleModule -> ShowS # show :: HaddockPrintStyleModule -> String # showList :: [HaddockPrintStyleModule] -> ShowS #
Eq HaddockPrintStyleModule # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: HaddockPrintStyleModule -> HaddockPrintStyleModule -> Bool # (/=) :: HaddockPrintStyleModule -> HaddockPrintStyleModule -> Bool #

data ImportExportStyle #

Constructors

ImportExportLeading |
ImportExportTrailing |
ImportExportDiffFriendly |

#### Instances

Instances details

FromJSON ImportExportStyle # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser ImportExportStyle # parseJSONList :: Value -> Parser [ImportExportStyle] # omittedField :: Maybe ImportExportStyle #
Bounded ImportExportStyle # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: ImportExportStyle # maxBound :: ImportExportStyle #
Enum ImportExportStyle # |

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: ImportExportStyle -> ImportExportStyle #

pred :: ImportExportStyle -> ImportExportStyle #

toEnum :: Int -> ImportExportStyle #

fromEnum :: ImportExportStyle -> Int #

enumFrom :: ImportExportStyle -> [ImportExportStyle] #

enumFromThen :: ImportExportStyle -> ImportExportStyle -> [ImportExportStyle] #

enumFromTo :: ImportExportStyle -> ImportExportStyle -> [ImportExportStyle] #

enumFromThenTo :: ImportExportStyle -> ImportExportStyle -> ImportExportStyle -> [ImportExportStyle] #

Show ImportExportStyle # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> ImportExportStyle -> ShowS # show :: ImportExportStyle -> String # showList :: [ImportExportStyle] -> ShowS #
Eq ImportExportStyle # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: ImportExportStyle -> ImportExportStyle -> Bool # (/=) :: ImportExportStyle -> ImportExportStyle -> Bool #

data ImportGrouping #

Constructors

ImportGroupLegacy |
ImportGroupPreserve |
ImportGroupSingle |
ImportGroupByScope |
ImportGroupByQualified |
ImportGroupByScopeThenQualified |
ImportGroupCustom (NonEmpty ImportGroup) |

#### Instances

Instances details

FromJSON ImportGrouping # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser ImportGrouping # parseJSONList :: Value -> Parser [ImportGrouping] # omittedField :: Maybe ImportGrouping #
Show ImportGrouping # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> ImportGrouping -> ShowS # show :: ImportGrouping -> String # showList :: [ImportGrouping] -> ShowS #
Eq ImportGrouping # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: ImportGrouping -> ImportGrouping -> Bool # (/=) :: ImportGrouping -> ImportGrouping -> Bool #

data ImportGroup #

Constructors

ImportGroup |

Fields

- igName :: !(Maybe String)
- igRules :: !(NonEmpty ImportGroupRule)

#### Instances

Instances details

FromJSON ImportGroup # |
Instance details Defined in Ormolu.Config.Types Methods parseJSON :: Value -> Parser ImportGroup # parseJSONList :: Value -> Parser [ImportGroup] # omittedField :: Maybe ImportGroup #
Show ImportGroup # |
Instance details Defined in Ormolu.Config.Types Methods showsPrec :: Int -> ImportGroup -> ShowS # show :: ImportGroup -> String # showList :: [ImportGroup] -> ShowS #
Eq ImportGroup # |
Instance details Defined in Ormolu.Config.Types Methods (==) :: ImportGroup -> ImportGroup -> Bool # (/=) :: ImportGroup -> ImportGroup -> Bool #

data ImportGroupRule #

Constructors

ImportGroupRule |

Fields

- igrModuleMatcher :: !ImportModuleMatcher
- igrQualifiedMatcher :: !QualifiedImportMatcher
- igrPriority :: !ImportRulePriority

#### Instances

Instances details

FromJSON ImportGroupRule # |
Instance details Defined in Ormolu.Config.Types Methods parseJSON :: Value -> Parser ImportGroupRule # parseJSONList :: Value -> Parser [ImportGroupRule] # omittedField :: Maybe ImportGroupRule #
Show ImportGroupRule # |
Instance details Defined in Ormolu.Config.Types Methods showsPrec :: Int -> ImportGroupRule -> ShowS # show :: ImportGroupRule -> String # showList :: [ImportGroupRule] -> ShowS #
Eq ImportGroupRule # |
Instance details Defined in Ormolu.Config.Types Methods (==) :: ImportGroupRule -> ImportGroupRule -> Bool # (/=) :: ImportGroupRule -> ImportGroupRule -> Bool #

data ImportModuleMatcher #

Constructors

MatchAllModules |
MatchLocalModules |
MatchGlob !Glob |

#### Instances

Instances details

FromJSON ImportModuleMatcher # |
Instance details Defined in Ormolu.Config.Types Methods parseJSON :: Value -> Parser ImportModuleMatcher # parseJSONList :: Value -> Parser [ImportModuleMatcher] # omittedField :: Maybe ImportModuleMatcher #
Show ImportModuleMatcher # |
Instance details Defined in Ormolu.Config.Types Methods showsPrec :: Int -> ImportModuleMatcher -> ShowS # show :: ImportModuleMatcher -> String # showList :: [ImportModuleMatcher] -> ShowS #
Eq ImportModuleMatcher # |
Instance details Defined in Ormolu.Config.Types Methods (==) :: ImportModuleMatcher -> ImportModuleMatcher -> Bool # (/=) :: ImportModuleMatcher -> ImportModuleMatcher -> Bool #

newtype ImportRulePriority #

Constructors

ImportRulePriority Word8 |

#### Instances

Instances details

FromJSON ImportRulePriority # |
Instance details Defined in Ormolu.Config.Types Methods parseJSON :: Value -> Parser ImportRulePriority # parseJSONList :: Value -> Parser [ImportRulePriority] # omittedField :: Maybe ImportRulePriority #
Bounded ImportRulePriority # |
Instance details Defined in Ormolu.Config.Types Methods minBound :: ImportRulePriority # maxBound :: ImportRulePriority #
Show ImportRulePriority # |
Instance details Defined in Ormolu.Config.Types Methods showsPrec :: Int -> ImportRulePriority -> ShowS # show :: ImportRulePriority -> String # showList :: [ImportRulePriority] -> ShowS #
Eq ImportRulePriority # |
Instance details Defined in Ormolu.Config.Types Methods (==) :: ImportRulePriority -> ImportRulePriority -> Bool # (/=) :: ImportRulePriority -> ImportRulePriority -> Bool #
Ord ImportRulePriority # |

Instance details

Defined in Ormolu.Config.Types

Methods

compare :: ImportRulePriority -> ImportRulePriority -> Ordering #

(<) :: ImportRulePriority -> ImportRulePriority -> Bool #

(<=) :: ImportRulePriority -> ImportRulePriority -> Bool #

(>) :: ImportRulePriority -> ImportRulePriority -> Bool #

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

max :: ImportRulePriority -> ImportRulePriority -> ImportRulePriority #

min :: ImportRulePriority -> ImportRulePriority -> ImportRulePriority #

matchAllRulePriority :: ImportRulePriority #

matchLocalRulePriority :: ImportRulePriority #

defaultImportRulePriority :: ImportRulePriority #

data QualifiedImportMatcher #

Constructors

MatchQualifiedOnly |
MatchUnqualifiedOnly |
MatchBothQualifiedAndUnqualified |

#### Instances

Instances details

Show QualifiedImportMatcher # |
Instance details Defined in Ormolu.Config.Types Methods showsPrec :: Int -> QualifiedImportMatcher -> ShowS # show :: QualifiedImportMatcher -> String # showList :: [QualifiedImportMatcher] -> ShowS #
Eq QualifiedImportMatcher # |
Instance details Defined in Ormolu.Config.Types Methods (==) :: QualifiedImportMatcher -> QualifiedImportMatcher -> Bool # (/=) :: QualifiedImportMatcher -> QualifiedImportMatcher -> Bool #

data LetStyle #

Constructors

LetAuto |
LetInline |
LetNewline |
LetMixed |

#### Instances

Instances details

FromJSON LetStyle # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser LetStyle # parseJSONList :: Value -> Parser [LetStyle] # omittedField :: Maybe LetStyle #
Bounded LetStyle # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: LetStyle # maxBound :: LetStyle #
Enum LetStyle # |
Instance details Defined in Ormolu.Config.Gen Methods succ :: LetStyle -> LetStyle # pred :: LetStyle -> LetStyle # toEnum :: Int -> LetStyle # fromEnum :: LetStyle -> Int # enumFrom :: LetStyle -> [LetStyle] # enumFromThen :: LetStyle -> LetStyle -> [LetStyle] # enumFromTo :: LetStyle -> LetStyle -> [LetStyle] # enumFromThenTo :: LetStyle -> LetStyle -> LetStyle -> [LetStyle] #
Show LetStyle # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> LetStyle -> ShowS # show :: LetStyle -> String # showList :: [LetStyle] -> ShowS #
Eq LetStyle # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: LetStyle -> LetStyle -> Bool # (/=) :: LetStyle -> LetStyle -> Bool #

data InStyle #

Constructors

InLeftAlign |
InRightAlign |
InNoSpace |

#### Instances

Instances details

FromJSON InStyle # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser InStyle # parseJSONList :: Value -> Parser [InStyle] # omittedField :: Maybe InStyle #
Bounded InStyle # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: InStyle # maxBound :: InStyle #
Enum InStyle # |
Instance details Defined in Ormolu.Config.Gen Methods succ :: InStyle -> InStyle # pred :: InStyle -> InStyle # toEnum :: Int -> InStyle # fromEnum :: InStyle -> Int # enumFrom :: InStyle -> [InStyle] # enumFromThen :: InStyle -> InStyle -> [InStyle] # enumFromTo :: InStyle -> InStyle -> [InStyle] # enumFromThenTo :: InStyle -> InStyle -> InStyle -> [InStyle] #
Show InStyle # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> InStyle -> ShowS # show :: InStyle -> String # showList :: [InStyle] -> ShowS #
Eq InStyle # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: InStyle -> InStyle -> Bool # (/=) :: InStyle -> InStyle -> Bool #

data Unicode #

Constructors

UnicodeDetect |
UnicodeAlways |
UnicodeNever |

#### Instances

Instances details

FromJSON Unicode # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser Unicode # parseJSONList :: Value -> Parser [Unicode] # omittedField :: Maybe Unicode #
Bounded Unicode # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: Unicode # maxBound :: Unicode #
Enum Unicode # |
Instance details Defined in Ormolu.Config.Gen Methods succ :: Unicode -> Unicode # pred :: Unicode -> Unicode # toEnum :: Int -> Unicode # fromEnum :: Unicode -> Int # enumFrom :: Unicode -> [Unicode] # enumFromThen :: Unicode -> Unicode -> [Unicode] # enumFromTo :: Unicode -> Unicode -> [Unicode] # enumFromThenTo :: Unicode -> Unicode -> Unicode -> [Unicode] #
Show Unicode # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> Unicode -> ShowS # show :: Unicode -> String # showList :: [Unicode] -> ShowS #
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 Methods parseJSON :: Value -> Parser ColumnLimit # parseJSONList :: Value -> Parser [ColumnLimit] # omittedField :: Maybe ColumnLimit #
Show ColumnLimit # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> ColumnLimit -> ShowS # show :: ColumnLimit -> String # showList :: [ColumnLimit] -> ShowS #
Eq ColumnLimit # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: ColumnLimit -> ColumnLimit -> Bool # (/=) :: ColumnLimit -> ColumnLimit -> Bool #

data SingleDerivingParens #

Constructors

DerivingAuto |
DerivingAlways |
DerivingNever |

#### Instances

Instances details

FromJSON SingleDerivingParens # |
Instance details Defined in Ormolu.Config.Gen Methods parseJSON :: Value -> Parser SingleDerivingParens # parseJSONList :: Value -> Parser [SingleDerivingParens] # omittedField :: Maybe SingleDerivingParens #
Bounded SingleDerivingParens # |
Instance details Defined in Ormolu.Config.Gen Methods minBound :: SingleDerivingParens # maxBound :: SingleDerivingParens #
Enum SingleDerivingParens # |

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: SingleDerivingParens -> SingleDerivingParens #

pred :: SingleDerivingParens -> SingleDerivingParens #

toEnum :: Int -> SingleDerivingParens #

fromEnum :: SingleDerivingParens -> Int #

enumFrom :: SingleDerivingParens -> [SingleDerivingParens] #

enumFromThen :: SingleDerivingParens -> SingleDerivingParens -> [SingleDerivingParens] #

enumFromTo :: SingleDerivingParens -> SingleDerivingParens -> [SingleDerivingParens] #

enumFromThenTo :: SingleDerivingParens -> SingleDerivingParens -> SingleDerivingParens -> [SingleDerivingParens] #

Show SingleDerivingParens # |
Instance details Defined in Ormolu.Config.Gen Methods showsPrec :: Int -> SingleDerivingParens -> ShowS # show :: SingleDerivingParens -> String # showList :: [SingleDerivingParens] -> ShowS #
Eq SingleDerivingParens # |
Instance details Defined in Ormolu.Config.Gen Methods (==) :: SingleDerivingParens -> SingleDerivingParens -> Bool # (/=) :: SingleDerivingParens -> SingleDerivingParens -> Bool #

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

data ConfigNotFound #

Constructors

ConfigNotFound |

Fields

- searchDirs :: [FilePath]

#### Instances

Instances details

Show ConfigNotFound # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> ConfigNotFound -> ShowS # show :: ConfigNotFound -> String # showList :: [ConfigNotFound] -> ShowS #

findConfigFile :: FilePath -> IO (Either ConfigNotFound FilePath) #

Find a fourmolu configuration file.

Looks for a file named fourmolu.yaml, first in the given path and its parents, and then in the XDG config directory.

configFileName :: FilePath #

Expected file name for YAML config.

data FourmoluConfig #

Constructors

FourmoluConfig |

Fields

- cfgFilePrinterOpts :: PrinterOptsPartial
- cfgFileFixities :: FixityOverrides
- cfgFileReexports :: ModuleReexports

#### Instances

Instances details

FromJSON FourmoluConfig # |
Instance details Defined in Ormolu.Config Methods parseJSON :: Value -> Parser FourmoluConfig # parseJSONList :: Value -> Parser [FourmoluConfig] # omittedField :: Maybe FourmoluConfig #
Show FourmoluConfig # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> FourmoluConfig -> ShowS # show :: FourmoluConfig -> String # showList :: [FourmoluConfig] -> ShowS #
Eq FourmoluConfig # |
Instance details Defined in Ormolu.Config Methods (==) :: FourmoluConfig -> FourmoluConfig -> Bool # (/=) :: FourmoluConfig -> FourmoluConfig -> Bool #

emptyConfig :: FourmoluConfig #

# Orphan instances

FromJSON PrinterOptsPartial # |
Instance details Methods parseJSON :: Value -> Parser PrinterOptsPartial # parseJSONList :: Value -> Parser [PrinterOptsPartial] # omittedField :: Maybe PrinterOptsPartial #
Monoid PrinterOptsPartial # |
Instance details Methods mempty :: PrinterOptsPartial # mappend :: PrinterOptsPartial -> PrinterOptsPartial -> PrinterOptsPartial # mconcat :: [PrinterOptsPartial] -> PrinterOptsPartial #
Semigroup PrinterOptsPartial # |
Instance details Methods (<>) :: PrinterOptsPartial -> PrinterOptsPartial -> PrinterOptsPartial # sconcat :: NonEmpty PrinterOptsPartial -> PrinterOptsPartial # stimes :: Integral b => b -> PrinterOptsPartial -> PrinterOptsPartial #
Show PrinterOptsPartial # |
Instance details Methods showsPrec :: Int -> PrinterOptsPartial -> ShowS # show :: PrinterOptsPartial -> String # showList :: [PrinterOptsPartial] -> ShowS #
Show PrinterOptsTotal # |
Instance details Methods showsPrec :: Int -> PrinterOptsTotal -> ShowS # show :: PrinterOptsTotal -> String # showList :: [PrinterOptsTotal] -> ShowS #
Eq PrinterOptsPartial # |
Instance details Methods (==) :: PrinterOptsPartial -> PrinterOptsPartial -> Bool # (/=) :: PrinterOptsPartial -> PrinterOptsPartial -> Bool #
Eq PrinterOptsTotal # |
Instance details Methods (==) :: PrinterOptsTotal -> PrinterOptsTotal -> Bool # (/=) :: PrinterOptsTotal -> PrinterOptsTotal -> Bool #