ormolu-0.1.2.0: A formatter for Haskell source code

Safe Haskell | None
Language | Haskell2010

Ormolu.Config

Description

Configuration options used by the tool.

Synopsis

- data Config region = Config {
  - cfgDynOptions :: ![DynOption]
  - cfgUnsafe :: !Bool
  - cfgDebug :: !Bool
  - cfgCheckIdempotence :: !Bool
  - cfgRegion :: !region
  }
- data RegionIndices = RegionIndices {
  - regionStartLine :: !(Maybe Int)
  - regionEndLine :: !(Maybe Int)
  }
- data RegionDeltas = RegionDeltas {
  - regionPrefixLength :: !Int
  - regionSuffixLength :: !Int
  }
- defaultConfig :: Config RegionIndices
- regionIndicesToDeltas :: Int -> RegionIndices -> RegionDeltas
- newtype DynOption = DynOption {
  - unDynOption :: String
  }
- dynOptionToLocatedStr :: DynOption -> Located String

# Documentation

data Config region Source #

Ormolu configuration.

Constructors

Config |

Fields

- cfgDynOptions :: ![DynOption]

  Dynamic options to pass to GHC parser

- 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

- cfgRegion :: !region

  Region selection

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

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

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

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

defaultConfig :: Config RegionIndices Source #

Default ``Config` `RegionIndices``.

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

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 #
Show DynOption Source # |
Instance details Defined in Ormolu.Config Methods showsPrec :: Int -> DynOption -> ShowS Source # show :: DynOption -> String Source # showList :: [DynOption] -> ShowS Source #

dynOptionToLocatedStr :: DynOption -> Located String Source #

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