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

Ormolu.Config

Description

Configuration options used by the tool.

Synopsis

Documentation

data Config region Source #

Ormolu configuration.

Constructors

Config 

Fields

Instances

Instances details
Functor Config Source # 
Instance details

Defined in Ormolu.Config

Methods

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

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

Generic (Config region) Source # 
Instance details

Defined in Ormolu.Config

Associated Types

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

Methods

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

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

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

Defined in Ormolu.Config

Methods

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

show :: Config region -> String #

showList :: [Config region] -> ShowS #

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

Defined in Ormolu.Config

Methods

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

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

type Rep (Config region) Source # 
Instance details

Defined in Ormolu.Config

data ColorMode Source #

Whether to use colors and other features of ANSI terminals.

Constructors

Never 
Always 
Auto 

data RegionIndices Source #

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

Constructors

RegionIndices 

Fields

Instances

Instances details
Show RegionIndices Source # 
Instance details

Defined in Ormolu.Config

Eq RegionIndices Source # 
Instance details

Defined in Ormolu.Config

data RegionDeltas Source #

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

Constructors

RegionDeltas 

Fields

Instances

Instances details
Show RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

Eq RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

data SourceType Source #

Type of sources that can be formatted by Ormolu.

Constructors

ModuleSource

Consider the input as a regular Haskell module

SignatureSource

Consider the input as a Backpack module signature

Instances

Instances details
Show SourceType Source # 
Instance details

Defined in Ormolu.Config

Eq SourceType Source # 
Instance details

Defined in Ormolu.Config

regionIndicesToDeltas Source #

Arguments

:: Int

Total number of lines in the input

-> RegionIndices

Region indices

-> RegionDeltas

Region deltas

newtype DynOption Source #

A wrapper for dynamic options.

Constructors

DynOption 

Fields

Instances

Instances details
Show DynOption Source # 
Instance details

Defined in Ormolu.Config

Eq DynOption Source # 
Instance details

Defined in Ormolu.Config

Ord DynOption Source # 
Instance details

Defined in Ormolu.Config

Fourmolu configuration

data PrinterOpts f Source #

Options controlling formatting output.

Constructors

PrinterOpts 

Fields

Instances

Instances details
FromJSON PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Monoid PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Semigroup PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Generic (PrinterOpts f) Source # 
Instance details

Defined in Ormolu.Config.Types

Associated Types

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

Methods

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

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

type Rep (PrinterOpts f) Source # 
Instance details

Defined in Ormolu.Config.Types

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.

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

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

data HaddockPrintStyle Source #

data ImportExportStyle Source #

Loading Fourmolu configuration

loadConfigFile :: FilePath -> IO ConfigFileLoadResult Source #

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

configFileName :: FilePath Source #

Expected file name for YAML config.

Utilities

data PrinterOptsFieldMeta a where Source #

Source of truth for how PrinterOpts is parsed from configuration sources.

Constructors

PrinterOptsFieldMeta 

Fields

class PrinterOptsFieldType a where Source #

Minimal complete definition

Nothing

Methods

parseJSON :: Value -> Parser a Source #

default parseJSON :: FromJSON a => Value -> Parser a Source #

parseText :: String -> Either String a Source #

default parseText :: Read a => String -> Either String a Source #

showText :: a -> String Source #

default showText :: Show a => a -> String Source #

overFields :: (forall a. f a -> g a) -> PrinterOpts f -> PrinterOpts g Source #

overFieldsM :: Applicative m => (forall a. f a -> m (g a)) -> PrinterOpts f -> m (PrinterOpts g) Source #

Orphan instances