fourmolu-0.15.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
  }
- 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
  - 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
  - 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 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
- loadConfigFile :: FilePath -> IO ConfigFileLoadResult
- configFileName :: FilePath
- data FourmoluConfig = FourmoluConfig {
  - cfgFilePrinterOpts :: PrinterOptsPartial
  - cfgFileFixities :: FixityOverrides
  - cfgFileReexports :: ModuleReexports
  }
- emptyConfig :: FourmoluConfig
- data ConfigFileLoadResult
  - = ConfigLoaded FilePath FourmoluConfig
  - | ConfigParseError FilePath ParseException
  - | ConfigNotFound [FilePath]

# 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

#### 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.15.0.0-51eFJWqL96B8IrLScWezv1" '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))))))
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.15.0.0-51eFJWqL96B8IrLScWezv1" '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 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 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 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 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

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.

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 #

data ConfigFileLoadResult #

The result of calling `loadConfigFile`.

Constructors

ConfigLoaded FilePath FourmoluConfig |
ConfigParseError FilePath ParseException |
ConfigNotFound [FilePath] |

#### Instances

Instances details

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

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