fourmolu-0.18.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 Source #

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 Source # |
Instance details Defined in Ormolu.Config Methods fmap :: (a -> b) -> Config a -> Config b Source # (<$) :: a -> Config b -> Config a Source #
Generic (Config region) Source # |

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.18.0.0-5tTLGDubSihJcf8BAj2gCC" '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 Source #

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

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

Instance details

Defined in Ormolu.Config

type Rep (Config region) = D1 ('MetaData "Config" "Ormolu.Config" "fourmolu-0.18.0.0-5tTLGDubSihJcf8BAj2gCC" '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 Source #

Whether to use colors and other features of ANSI terminals.

Constructors

Never |
Always |
Auto |

#### Instances

Instances details

Bounded ColorMode Source # |
Instance details Defined in Ormolu.Terminal Methods minBound :: ColorMode Source # maxBound :: ColorMode Source #
Enum ColorMode Source # |

Instance details

Defined in Ormolu.Terminal

Methods

succ :: ColorMode -> ColorMode Source #

pred :: ColorMode -> ColorMode Source #

toEnum :: Int -> ColorMode Source #

fromEnum :: ColorMode -> Int Source #

enumFrom :: ColorMode -> [ColorMode] Source #

enumFromThen :: ColorMode -> ColorMode -> [ColorMode] Source #

enumFromTo :: ColorMode -> ColorMode -> [ColorMode] Source #

enumFromThenTo :: ColorMode -> ColorMode -> ColorMode -> [ColorMode] Source #

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

data RegionIndices Source #

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

data RegionDeltas Source #

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

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

defaultConfig :: Config RegionIndices Source #

Default ``Config` `RegionIndices``.

overapproximatedDependencies :: Config region -> Set PackageName Source #

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

Arguments

:: Int | Total number of lines in the input
-> RegionIndices | Region indices
-> RegionDeltas | Region deltas

Convert `RegionIndices` into `RegionDeltas`.

newtype DynOption Source #

A wrapper for dynamic options.

Constructors

DynOption |

Fields

- unDynOption :: String

#### Instances

Instances details

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

dynOptionToLocatedStr :: DynOption -> Located String Source #

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

# Fourmolu configuration

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

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 Source # |
Instance details Defined in Ormolu.Config Methods mempty :: PrinterOptsPartial Source # mappend :: PrinterOptsPartial -> PrinterOptsPartial -> PrinterOptsPartial Source # mconcat :: [PrinterOptsPartial] -> PrinterOptsPartial Source #
Semigroup PrinterOptsPartial Source # |
Instance details Defined in Ormolu.Config Methods (<>) :: PrinterOptsPartial -> PrinterOptsPartial -> PrinterOptsPartial Source # sconcat :: NonEmpty PrinterOptsPartial -> PrinterOptsPartial Source # stimes :: Integral b => b -> PrinterOptsPartial -> PrinterOptsPartial Source #
Show PrinterOptsPartial Source # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> PrinterOptsPartial -> ShowS Source # show :: PrinterOptsPartial -> String Source # showList :: [PrinterOptsPartial] -> ShowS Source #
Show PrinterOptsTotal Source # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> PrinterOptsTotal -> ShowS Source # show :: PrinterOptsTotal -> String Source # showList :: [PrinterOptsTotal] -> ShowS Source #
Eq PrinterOptsPartial Source # |
Instance details Defined in Ormolu.Config Methods (==) :: PrinterOptsPartial -> PrinterOptsPartial -> Bool Source # (/=) :: PrinterOptsPartial -> PrinterOptsPartial -> Bool Source #
Eq PrinterOptsTotal Source # |
Instance details Defined in Ormolu.Config Methods (==) :: PrinterOptsTotal -> PrinterOptsTotal -> Bool Source # (/=) :: PrinterOptsTotal -> PrinterOptsTotal -> Bool Source #
Generic (PrinterOpts f) Source # |

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

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

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

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.

defaultPrinterOpts :: PrinterOpts Identity Source #

defaultPrinterOptsYaml :: String Source #

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

resolvePrinterOpts :: [PrinterOptsPartial] -> PrinterOptsTotal Source #

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

data CommaStyle Source #

Constructors

Leading |
Trailing |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: CommaStyle -> CommaStyle Source #

pred :: CommaStyle -> CommaStyle Source #

toEnum :: Int -> CommaStyle Source #

fromEnum :: CommaStyle -> Int Source #

enumFrom :: CommaStyle -> [CommaStyle] Source #

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

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

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

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

data FunctionArrowsStyle Source #

Constructors

TrailingArrows |
LeadingArrows |
LeadingArgsArrows |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: FunctionArrowsStyle -> FunctionArrowsStyle Source #

pred :: FunctionArrowsStyle -> FunctionArrowsStyle Source #

toEnum :: Int -> FunctionArrowsStyle Source #

fromEnum :: FunctionArrowsStyle -> Int Source #

enumFrom :: FunctionArrowsStyle -> [FunctionArrowsStyle] Source #

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

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

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

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

data HaddockPrintStyle Source #

Constructors

HaddockSingleLine |
HaddockMultiLine |
HaddockMultiLineCompact |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: HaddockPrintStyle -> HaddockPrintStyle Source #

pred :: HaddockPrintStyle -> HaddockPrintStyle Source #

toEnum :: Int -> HaddockPrintStyle Source #

fromEnum :: HaddockPrintStyle -> Int Source #

enumFrom :: HaddockPrintStyle -> [HaddockPrintStyle] Source #

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

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

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

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

data HaddockPrintStyleModule Source #

Constructors

PrintStyleInherit |
PrintStyleOverride HaddockPrintStyle |

#### Instances

Instances details

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

data ImportExportStyle Source #

Constructors

ImportExportLeading |
ImportExportTrailing |
ImportExportDiffFriendly |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: ImportExportStyle -> ImportExportStyle Source #

pred :: ImportExportStyle -> ImportExportStyle Source #

toEnum :: Int -> ImportExportStyle Source #

fromEnum :: ImportExportStyle -> Int Source #

enumFrom :: ImportExportStyle -> [ImportExportStyle] Source #

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

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

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

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

data ImportGrouping Source #

Constructors

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

#### Instances

Instances details

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

data ImportGroup Source #

Constructors

ImportGroup |

Fields

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

#### Instances

Instances details

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

data ImportGroupRule Source #

Constructors

ImportGroupRule |

Fields

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

#### Instances

Instances details

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

data ImportModuleMatcher Source #

Constructors

MatchAllModules |
MatchLocalModules |
MatchGlob !Glob |

#### Instances

Instances details

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

newtype ImportRulePriority Source #

Constructors

ImportRulePriority Word8 |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Types

Methods

compare :: ImportRulePriority -> ImportRulePriority -> Ordering Source #

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

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

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

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

max :: ImportRulePriority -> ImportRulePriority -> ImportRulePriority Source #

min :: ImportRulePriority -> ImportRulePriority -> ImportRulePriority Source #

matchAllRulePriority :: ImportRulePriority Source #

matchLocalRulePriority :: ImportRulePriority Source #

defaultImportRulePriority :: ImportRulePriority Source #

data QualifiedImportMatcher Source #

Constructors

MatchQualifiedOnly |
MatchUnqualifiedOnly |
MatchBothQualifiedAndUnqualified |

#### Instances

Instances details

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

data LetStyle Source #

Constructors

LetAuto |
LetInline |
LetNewline |
LetMixed |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: LetStyle -> LetStyle Source #

pred :: LetStyle -> LetStyle Source #

toEnum :: Int -> LetStyle Source #

fromEnum :: LetStyle -> Int Source #

enumFrom :: LetStyle -> [LetStyle] Source #

enumFromThen :: LetStyle -> LetStyle -> [LetStyle] Source #

enumFromTo :: LetStyle -> LetStyle -> [LetStyle] Source #

enumFromThenTo :: LetStyle -> LetStyle -> LetStyle -> [LetStyle] Source #

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

data InStyle Source #

Constructors

InLeftAlign |
InRightAlign |
InNoSpace |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: InStyle -> InStyle Source #

pred :: InStyle -> InStyle Source #

toEnum :: Int -> InStyle Source #

fromEnum :: InStyle -> Int Source #

enumFrom :: InStyle -> [InStyle] Source #

enumFromThen :: InStyle -> InStyle -> [InStyle] Source #

enumFromTo :: InStyle -> InStyle -> [InStyle] Source #

enumFromThenTo :: InStyle -> InStyle -> InStyle -> [InStyle] Source #

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

data Unicode Source #

Constructors

UnicodeDetect |
UnicodeAlways |
UnicodeNever |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: Unicode -> Unicode Source #

pred :: Unicode -> Unicode Source #

toEnum :: Int -> Unicode Source #

fromEnum :: Unicode -> Int Source #

enumFrom :: Unicode -> [Unicode] Source #

enumFromThen :: Unicode -> Unicode -> [Unicode] Source #

enumFromTo :: Unicode -> Unicode -> [Unicode] Source #

enumFromThenTo :: Unicode -> Unicode -> Unicode -> [Unicode] Source #

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

data ColumnLimit Source #

Constructors

NoLimit |
ColumnLimit Int |

#### Instances

Instances details

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

data SingleDerivingParens Source #

Constructors

DerivingAuto |
DerivingAlways |
DerivingNever |

#### Instances

Instances details

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

Instance details

Defined in Ormolu.Config.Gen

Methods

succ :: SingleDerivingParens -> SingleDerivingParens Source #

pred :: SingleDerivingParens -> SingleDerivingParens Source #

toEnum :: Int -> SingleDerivingParens Source #

fromEnum :: SingleDerivingParens -> Int Source #

enumFrom :: SingleDerivingParens -> [SingleDerivingParens] Source #

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

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

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

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

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

data ConfigNotFound Source #

Constructors

ConfigNotFound |

Fields

- searchDirs :: [FilePath]

#### Instances

Instances details

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

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

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

Expected file name for YAML config.

data FourmoluConfig Source #

Constructors

FourmoluConfig |

Fields

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

#### Instances

Instances details

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

emptyConfig :: FourmoluConfig Source #

# Orphan instances

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