-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A formatter for Haskell source code
--   
--   A formatter for Haskell source code.
@package ormolu
@version 0.8.0.0


-- | Build span stream from AST.
module Ormolu.Printer.SpanStream

-- | A stream of <a>RealSrcSpan</a>s in ascending order. This allows us to
--   tell e.g. whether there is another "located" element of AST between
--   current element and comment we're considering for printing.
newtype SpanStream
SpanStream :: [RealSrcSpan] -> SpanStream

-- | Create <a>SpanStream</a> from a data structure containing "located"
--   elements.
mkSpanStream :: Data a => a -> SpanStream
instance GHC.Internal.Data.Data.Data Ormolu.Printer.SpanStream.SpanStream
instance GHC.Classes.Eq Ormolu.Printer.SpanStream.SpanStream
instance GHC.Internal.Base.Monoid Ormolu.Printer.SpanStream.SpanStream
instance GHC.Internal.Base.Semigroup Ormolu.Printer.SpanStream.SpanStream
instance GHC.Internal.Show.Show Ormolu.Printer.SpanStream.SpanStream


-- | Support for CPP.
module Ormolu.Processing.Cpp

-- | Return an <a>IntSet</a> containing all lines which are affected by
--   CPP.
cppLines :: Text -> IntSet

-- | Replace all lines affected by CPP with blank lines.
eraseCppLines :: Text -> Text
instance GHC.Classes.Eq Ormolu.Processing.Cpp.State
instance GHC.Internal.Show.Show Ormolu.Processing.Cpp.State


-- | Random utilities used by the code.
module Ormolu.Utils

-- | Relative positions in a list.
data RelativePos
SinglePos :: RelativePos
FirstPos :: RelativePos
MiddlePos :: RelativePos
LastPos :: RelativePos

-- | Attach <a>RelativePos</a>es to elements of a given list.
attachRelativePos :: [a] -> [(RelativePos, a)]

-- | Combine all source spans from the given list.
combineSrcSpans' :: NonEmpty SrcSpan -> SrcSpan

-- | Placeholder for things that are not yet implemented.
notImplemented :: String -> a

-- | Pretty-print an <a>Outputable</a> thing.
showOutputable :: Outputable o => o -> String

-- | Split and normalize a doc string. The result is a list of lines that
--   make up the comment.
splitDocString :: HsDocString -> [Text]

-- | Increment line number in a <a>SrcSpan</a>.
incSpanLine :: Int -> SrcSpan -> SrcSpan

-- | Do two declarations have a blank between them?
separatedByBlank :: (a -> SrcSpan) -> a -> a -> Bool

-- | Do two declaration groups have a blank between them?
separatedByBlankNE :: (a -> SrcSpan) -> NonEmpty a -> NonEmpty a -> Bool

-- | Return <a>True</a> if one span ends on the same line the second one
--   starts.
onTheSameLine :: SrcSpan -> SrcSpan -> Bool

-- | Convert <a>Text</a> to a <a>StringBuffer</a> by making a copy.
textToStringBuffer :: Text -> StringBuffer

-- | Convert GHC's <a>ModuleName</a> into the one used by Cabal.
ghcModuleNameToCabal :: ModuleName -> ModuleName
instance GHC.Classes.Eq Ormolu.Utils.RelativePos
instance GHC.Internal.Show.Show Ormolu.Utils.RelativePos


-- | An abstraction for colorful output in terminal.
module Ormolu.Terminal
type Term = TermOutput ()

-- | Whether to use colors and other features of ANSI terminals.
data ColorMode
Never :: ColorMode
Always :: ColorMode
Auto :: ColorMode

-- | Run <a>Term</a> monad.
runTerm :: Term -> ColorMode -> Handle -> IO ()
runTermPure :: Term -> Text

-- | Make the output bold text.
bold :: Term -> Term

-- | Make the output cyan text.
cyan :: Term -> Term

-- | Make the output green text.
green :: Term -> Term

-- | Make the output red text.
red :: Term -> Term

-- | Output <a>Text</a>.
put :: Text -> Term

-- | Output a <a>Show</a> value.
putShow :: Show a => a -> Term

-- | Output an <a>Outputable</a> value.
putOutputable :: Outputable a => a -> Term

-- | Output a newline.
newline :: Term
instance GHC.Internal.Base.Applicative Ormolu.Terminal.TermOutput
instance GHC.Classes.Eq Ormolu.Terminal.ColorMode
instance GHC.Internal.Base.Functor Ormolu.Terminal.TermOutput
instance GHC.Internal.Base.Monoid (Ormolu.Terminal.TermOutput a)
instance GHC.Internal.Base.Semigroup (Ormolu.Terminal.TermOutput a)
instance GHC.Internal.Show.Show Ormolu.Terminal.ColorMode

module Ormolu.Terminal.QualifiedDo
(>>) :: Term -> Term -> Term


-- | This module allows us to diff two <a>Text</a> values.
module Ormolu.Diff.Text

-- | Result of diffing two <a>Text</a>s.
data TextDiff

-- | Diff two texts and produce a <a>TextDiff</a>.
diffText :: Text -> Text -> FilePath -> Maybe TextDiff

-- | Select certain spans in the diff (line numbers are interpreted as
--   belonging to the “before” state). Only selected spans will be printed.
selectSpans :: [RealSrcSpan] -> TextDiff -> TextDiff

-- | Print the given <a>TextDiff</a> as a <a>Term</a> action. This function
--   tries to mimic the style of <tt>git diff</tt>.
printTextDiff :: TextDiff -> Term
instance GHC.Classes.Eq Ormolu.Diff.Text.TextDiff
instance GHC.Internal.Show.Show Ormolu.Diff.Text.Hunk
instance GHC.Internal.Show.Show Ormolu.Diff.Text.TextDiff


-- | <a>OrmoluException</a> type and surrounding definitions.
module Ormolu.Exception

-- | Ormolu exception representing all cases when Ormolu can fail.
data OrmoluException

-- | Parsing of original source code failed
OrmoluParsingFailed :: SrcSpan -> String -> OrmoluException

-- | Parsing of formatted source code failed
OrmoluOutputParsingFailed :: SrcSpan -> String -> OrmoluException

-- | Original and resulting ASTs differ
OrmoluASTDiffers :: TextDiff -> [RealSrcSpan] -> OrmoluException

-- | Formatted source code is not idempotent
OrmoluNonIdempotentOutput :: TextDiff -> OrmoluException

-- | Some GHC options were not recognized
OrmoluUnrecognizedOpts :: NonEmpty String -> OrmoluException

-- | Cabal file parsing failed
OrmoluCabalFileParsingFailed :: FilePath -> NonEmpty PError -> OrmoluException

-- | Missing input file path when using stdin input and accounting for
--   .cabal files
OrmoluMissingStdinInputFile :: OrmoluException

-- | A parse error in a fixity overrides file
OrmoluFixityOverridesParseError :: ParseErrorBundle Text Void -> OrmoluException

-- | Print an <a>OrmoluException</a>.
printOrmoluException :: OrmoluException -> Term

-- | Inside this wrapper <a>OrmoluException</a> will be caught and
--   displayed nicely.
withPrettyOrmoluExceptions :: ColorMode -> IO ExitCode -> IO ExitCode
instance GHC.Internal.Exception.Type.Exception Ormolu.Exception.OrmoluException
instance GHC.Internal.Show.Show Ormolu.Exception.OrmoluException


-- | A module for parsing of pragmas from comments.
module Ormolu.Parser.Pragma

-- | Ormolu's representation of pragmas.
data Pragma

-- | Language pragma
PragmaLanguage :: [Text] -> Pragma

-- | GHC options pragma
PragmaOptionsGHC :: Text -> Pragma

-- | Haddock options pragma
PragmaOptionsHaddock :: Text -> Pragma

-- | Extract a pragma from a comment if possible, or return <a>Nothing</a>
--   otherwise.
parsePragma :: Text -> Maybe Pragma
instance GHC.Classes.Eq Ormolu.Parser.Pragma.Pragma
instance GHC.Internal.Show.Show Ormolu.Parser.Pragma.Pragma


-- | Functions for working with comment stream.
module Ormolu.Parser.CommentStream

-- | A stream of <a>RealLocated</a> <a>Comment</a>s in ascending order with
--   respect to beginning of corresponding spans.
newtype CommentStream
CommentStream :: [LComment] -> CommentStream

-- | Create <a>CommentStream</a> from <a>HsModule</a>. The pragmas are
--   removed from the <a>CommentStream</a>.
mkCommentStream :: Text -> HsModule GhcPs -> (Maybe LComment, [([LComment], Pragma)], CommentStream)
type LComment = RealLocated Comment

-- | A wrapper for a single comment. The <a>Bool</a> indicates whether
--   there were atoms before beginning of the comment in the original
--   input. The <a>NonEmpty</a> list inside contains lines of multiline
--   comment <tt>{- … -}</tt> or just single item/line otherwise.
data Comment
Comment :: Bool -> NonEmpty Text -> Comment

-- | Get a collection of lines from a <a>Comment</a>.
unComment :: Comment -> NonEmpty Text

-- | Check whether the <a>Comment</a> had some non-whitespace atoms in
--   front of it in the original input.
hasAtomsBefore :: Comment -> Bool

-- | Is this comment multiline-style?
isMultilineComment :: Comment -> Bool
instance GHC.Internal.Data.Data.Data Ormolu.Parser.CommentStream.Comment
instance GHC.Internal.Data.Data.Data Ormolu.Parser.CommentStream.CommentStream
instance GHC.Classes.Eq Ormolu.Parser.CommentStream.Comment
instance GHC.Classes.Eq Ormolu.Parser.CommentStream.CommentStream
instance GHC.Internal.Base.Monoid Ormolu.Parser.CommentStream.CommentStream
instance GHC.Internal.Base.Semigroup Ormolu.Parser.CommentStream.CommentStream
instance GHC.Internal.Show.Show Ormolu.Parser.CommentStream.Comment


-- | Manipulations on import lists.
module Ormolu.Imports

-- | Sort and normalize imports.
normalizeImports :: [LImportDecl GhcPs] -> [LImportDecl GhcPs]
instance GHC.Classes.Eq Ormolu.Imports.IEWrappedNameOrd
instance GHC.Classes.Eq Ormolu.Imports.ImportId
instance GHC.Classes.Eq Ormolu.Imports.ImportListInterpretationOrd
instance GHC.Classes.Eq Ormolu.Imports.ImportPkgQual
instance GHC.Classes.Ord Ormolu.Imports.IEWrappedNameOrd
instance GHC.Classes.Ord Ormolu.Imports.ImportId
instance GHC.Classes.Ord Ormolu.Imports.ImportListInterpretationOrd
instance GHC.Classes.Ord Ormolu.Imports.ImportPkgQual

module Ormolu.Fixity.Internal

-- | An operator name.
data OpName
pattern OpName :: Text -> OpName

-- | Convert an <a>OpName</a> to <a>Text</a>.
unOpName :: OpName -> Text

-- | Convert an 'OccName to an <a>OpName</a>.
occOpName :: OccName -> OpName

-- | Fixity direction.
data FixityDirection
InfixL :: FixityDirection
InfixR :: FixityDirection
InfixN :: FixityDirection

-- | Fixity information about an infix operator. This type provides precise
--   information as opposed to <a>FixityApproximation</a>.
data FixityInfo
FixityInfo :: FixityDirection -> Double -> FixityInfo

-- | Fixity direction
[fiDirection] :: FixityInfo -> FixityDirection

-- | Precedence
[fiPrecedence] :: FixityInfo -> Double

-- | Fixity info of the built-in colon data constructor.
colonFixityInfo :: FixityInfo

-- | Fixity that is implicitly assumed if no fixity declaration is present.
defaultFixityInfo :: FixityInfo

-- | Approximation of fixity information that takes the uncertainty that
--   can arise from conflicting definitions into account.
data FixityApproximation
FixityApproximation :: Maybe FixityDirection -> Double -> Double -> FixityApproximation

-- | Fixity direction if it is known
[faDirection] :: FixityApproximation -> Maybe FixityDirection

-- | Minimum precedence level found in the (maybe conflicting) definitions
--   for the operator (inclusive)
[faMinPrecedence] :: FixityApproximation -> Double

-- | Maximum precedence level found in the (maybe conflicting) definitions
--   for the operator (inclusive)
[faMaxPrecedence] :: FixityApproximation -> Double

-- | The lowest level of information we can have about an operator.
defaultFixityApproximation :: FixityApproximation

-- | The map of operators declared by each package grouped by module name.
newtype HackageInfo
HackageInfo :: Map PackageName (Map ModuleName (Map OpName FixityInfo)) -> HackageInfo

-- | Map from the operator name to its <a>FixityInfo</a>.
newtype FixityOverrides
FixityOverrides :: Map OpName FixityInfo -> FixityOverrides
[unFixityOverrides] :: FixityOverrides -> Map OpName FixityInfo

-- | Fixity overrides to use by default.
defaultFixityOverrides :: FixityOverrides

-- | Module re-exports
newtype ModuleReexports
ModuleReexports :: Map ModuleName (NonEmpty (Maybe PackageName, ModuleName)) -> ModuleReexports
[unModuleReexports] :: ModuleReexports -> Map ModuleName (NonEmpty (Maybe PackageName, ModuleName))

-- | Module re-exports to apply by default.
defaultModuleReexports :: ModuleReexports

-- | Fixity information that is specific to a package being formatted. It
--   requires module-specific imports in order to be usable.
newtype PackageFixityMap
PackageFixityMap :: Map OpName (NonEmpty (PackageName, ModuleName, FixityInfo)) -> PackageFixityMap

-- | Fixity map that takes into account imports in a particular module.
newtype ModuleFixityMap
ModuleFixityMap :: Map OpName FixityProvenance -> ModuleFixityMap

-- | Provenance of fixity info.
data FixityProvenance

-- | <a>FixityInfo</a> of a built-in operator or provided by a user
--   override.
Given :: FixityInfo -> FixityProvenance

-- | <a>FixityInfo</a> to be inferred from module imports.
FromModuleImports :: NonEmpty (FixityQualification, FixityInfo) -> FixityProvenance

-- | Fixity qualification that determines how <a>FixityInfo</a> matches a
--   particular use of an operator, given whether it is qualified or
--   unqualified and the module name used.
data FixityQualification
UnqualifiedAndQualified :: ModuleName -> FixityQualification
OnlyQualified :: ModuleName -> FixityQualification

-- | Get a <a>FixityApproximation</a> of an operator.
inferFixity :: Choice "debug" -> RdrName -> ModuleFixityMap -> FixityApproximation
instance Data.Binary.Class.Binary Ormolu.Fixity.Internal.FixityApproximation
instance Data.Binary.Class.Binary Ormolu.Fixity.Internal.FixityDirection
instance Data.Binary.Class.Binary Ormolu.Fixity.Internal.FixityInfo
instance Data.Binary.Class.Binary Ormolu.Fixity.Internal.HackageInfo
instance Data.Binary.Class.Binary Ormolu.Fixity.Internal.OpName
instance GHC.Classes.Eq Ormolu.Fixity.Internal.FixityApproximation
instance GHC.Classes.Eq Ormolu.Fixity.Internal.FixityDirection
instance GHC.Classes.Eq Ormolu.Fixity.Internal.FixityInfo
instance GHC.Classes.Eq Ormolu.Fixity.Internal.FixityOverrides
instance GHC.Classes.Eq Ormolu.Fixity.Internal.FixityProvenance
instance GHC.Classes.Eq Ormolu.Fixity.Internal.FixityQualification
instance GHC.Classes.Eq Ormolu.Fixity.Internal.ModuleFixityMap
instance GHC.Classes.Eq Ormolu.Fixity.Internal.ModuleReexports
instance GHC.Classes.Eq Ormolu.Fixity.Internal.OpName
instance GHC.Classes.Eq Ormolu.Fixity.Internal.PackageFixityMap
instance GHC.Internal.Generics.Generic Ormolu.Fixity.Internal.FixityApproximation
instance GHC.Internal.Generics.Generic Ormolu.Fixity.Internal.FixityDirection
instance GHC.Internal.Generics.Generic Ormolu.Fixity.Internal.FixityInfo
instance GHC.Internal.Generics.Generic Ormolu.Fixity.Internal.HackageInfo
instance GHC.Internal.Data.String.IsString Ormolu.Fixity.Internal.OpName
instance GHC.Classes.Ord Ormolu.Fixity.Internal.FixityApproximation
instance GHC.Classes.Ord Ormolu.Fixity.Internal.FixityDirection
instance GHC.Classes.Ord Ormolu.Fixity.Internal.FixityInfo
instance GHC.Classes.Ord Ormolu.Fixity.Internal.OpName
instance GHC.Internal.Base.Semigroup Ormolu.Fixity.Internal.FixityApproximation
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.FixityApproximation
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.FixityDirection
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.FixityInfo
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.FixityOverrides
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.FixityProvenance
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.FixityQualification
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.ModuleFixityMap
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.ModuleReexports
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.OpName
instance GHC.Internal.Show.Show Ormolu.Fixity.Internal.PackageFixityMap


-- | Simplified representation of the import list for the purposes of
--   fixity inference.
module Ormolu.Fixity.Imports

-- | Simplified info about an import.
data FixityImport
FixityImport :: !Maybe PackageName -> !ModuleName -> !FixityQualification -> !Maybe (ImportListInterpretation, [OpName]) -> FixityImport
[fimportPackage] :: FixityImport -> !Maybe PackageName
[fimportModule] :: FixityImport -> !ModuleName
[fimportQualified] :: FixityImport -> !FixityQualification
[fimportList] :: FixityImport -> !Maybe (ImportListInterpretation, [OpName])

-- | Extract <a>FixityImport</a>s from the AST.
extractFixityImports :: [LImportDecl GhcPs] -> [FixityImport]

-- | Apply given module re-exports.
applyModuleReexports :: ModuleReexports -> [FixityImport] -> [FixityImport]


-- | Definitions for fixity analysis.
module Ormolu.Fixity

-- | An operator name.
data OpName
pattern OpName :: Text -> OpName

-- | Convert an <a>OpName</a> to <a>Text</a>.
unOpName :: OpName -> Text

-- | Convert an 'OccName to an <a>OpName</a>.
occOpName :: OccName -> OpName

-- | Fixity direction.
data FixityDirection
InfixL :: FixityDirection
InfixR :: FixityDirection
InfixN :: FixityDirection

-- | Fixity information about an infix operator. This type provides precise
--   information as opposed to <a>FixityApproximation</a>.
data FixityInfo
FixityInfo :: FixityDirection -> Double -> FixityInfo

-- | Fixity direction
[fiDirection] :: FixityInfo -> FixityDirection

-- | Precedence
[fiPrecedence] :: FixityInfo -> Double

-- | Fixity that is implicitly assumed if no fixity declaration is present.
defaultFixityInfo :: FixityInfo

-- | Approximation of fixity information that takes the uncertainty that
--   can arise from conflicting definitions into account.
data FixityApproximation
FixityApproximation :: Maybe FixityDirection -> Double -> Double -> FixityApproximation

-- | Fixity direction if it is known
[faDirection] :: FixityApproximation -> Maybe FixityDirection

-- | Minimum precedence level found in the (maybe conflicting) definitions
--   for the operator (inclusive)
[faMinPrecedence] :: FixityApproximation -> Double

-- | Maximum precedence level found in the (maybe conflicting) definitions
--   for the operator (inclusive)
[faMaxPrecedence] :: FixityApproximation -> Double

-- | The lowest level of information we can have about an operator.
defaultFixityApproximation :: FixityApproximation

-- | Map from the operator name to its <a>FixityInfo</a>.
newtype FixityOverrides
FixityOverrides :: Map OpName FixityInfo -> FixityOverrides
[unFixityOverrides] :: FixityOverrides -> Map OpName FixityInfo

-- | Fixity overrides to use by default.
defaultFixityOverrides :: FixityOverrides

-- | Module re-exports
newtype ModuleReexports
ModuleReexports :: Map ModuleName (NonEmpty (Maybe PackageName, ModuleName)) -> ModuleReexports
[unModuleReexports] :: ModuleReexports -> Map ModuleName (NonEmpty (Maybe PackageName, ModuleName))

-- | Module re-exports to apply by default.
defaultModuleReexports :: ModuleReexports

-- | Fixity information that is specific to a package being formatted. It
--   requires module-specific imports in order to be usable.
newtype PackageFixityMap
PackageFixityMap :: Map OpName (NonEmpty (PackageName, ModuleName, FixityInfo)) -> PackageFixityMap

-- | Fixity map that takes into account imports in a particular module.
newtype ModuleFixityMap
ModuleFixityMap :: Map OpName FixityProvenance -> ModuleFixityMap

-- | Get a <a>FixityApproximation</a> of an operator.
inferFixity :: Choice "debug" -> RdrName -> ModuleFixityMap -> FixityApproximation

-- | The map of operators declared by each package grouped by module name.
newtype HackageInfo
HackageInfo :: Map PackageName (Map ModuleName (Map OpName FixityInfo)) -> HackageInfo

-- | The built-in <a>HackageInfo</a> used by Ormolu.
hackageInfo :: HackageInfo

-- | Default set of packages to assume as dependencies e.g. when no Cabal
--   file is found or taken into consideration.
defaultDependencies :: Set PackageName

-- | Compute the fixity map that is specific to the package we are
--   formatting.
packageFixityMap :: Set PackageName -> PackageFixityMap

-- | The same as <a>packageFixityMap</a>, except this specific version of
--   the function allows the user to specify <a>HackageInfo</a> used to
--   build the final fixity map.
packageFixityMap' :: HackageInfo -> Set PackageName -> PackageFixityMap

-- | Compute the fixity map that is specific to the module we are
--   formatting.
moduleFixityMap :: PackageFixityMap -> [FixityImport] -> ModuleFixityMap

-- | Apply fixity overrides.
applyFixityOverrides :: FixityOverrides -> ModuleFixityMap -> ModuleFixityMap


-- | This module helps handle operator chains composed of different
--   operators that may have different precedence and fixities.
module Ormolu.Printer.Operators

-- | Intermediate representation of operator trees, where a branching is
--   not just a binary branching (with a left node, right node, and
--   operator like in the GHC's AST), but rather a n-ary branching, with n
--   + 1 nodes and n operators (n &gt;= 1).
--   
--   This representation allows us to put all the operators with the same
--   precedence level as direct siblings in this tree, to better represent
--   the idea of a chain of operators.
data OpTree ty op

-- | A node which is not an operator application
OpNode :: ty -> OpTree ty op

-- | A subtree of operator application(s); the invariant is: <tt>length
--   exprs == length ops + 1</tt>. <tt>OpBranches [x, y, z] [op1, op2]</tt>
--   represents the expression <tt>x op1 y op2 z</tt>.
OpBranches :: NonEmpty (OpTree ty op) -> [op] -> OpTree ty op
pattern BinaryOpBranches :: OpTree ty op -> op -> OpTree ty op -> OpTree ty op

-- | Wrapper for an operator, carrying information about its name and
--   fixity.
data OpInfo op
OpInfo :: op -> Maybe RdrName -> FixityApproximation -> OpInfo op

-- | The actual operator
[opiOp] :: OpInfo op -> op

-- | Its name, if available. We use 'Maybe RdrName' here instead of
--   <a>RdrName</a> because the name-fetching function received by
--   <a>reassociateOpTree</a> returns a <a>Maybe</a>
[opiName] :: OpInfo op -> Maybe RdrName

-- | Information about the fixity direction and precedence level of the
--   operator
[opiFixityApproximation] :: OpInfo op -> FixityApproximation

-- | Return combined <a>SrcSpan</a>s of all elements in this <a>OpTree</a>.
opTreeLoc :: HasLoc l => OpTree (GenLocated l a) b -> SrcSpan

-- | Re-associate an <a>OpTree</a> taking into account precedence of
--   operators. Users are expected to first construct an initial
--   <a>OpTree</a>, then re-associate it using this function before
--   printing.
reassociateOpTree :: Choice "debug" -> (op -> Maybe RdrName) -> ModuleFixityMap -> OpTree ty op -> OpTree ty (OpInfo op)

-- | Indicate if an operator has <tt><a>InfixR</a> 0</tt> fixity. We
--   special-case this class of operators because they often have, like
--   (<a>$</a>), a specific “separator” use-case, and we sometimes format
--   them differently than other operators.
isHardSplitterOp :: FixityApproximation -> Bool
instance GHC.Classes.Eq op => GHC.Classes.Eq (Ormolu.Printer.Operators.OpInfo op)
instance (GHC.Classes.Eq ty, GHC.Classes.Eq op) => GHC.Classes.Eq (Ormolu.Printer.Operators.OpTree ty op)
instance (GHC.Internal.Show.Show ty, GHC.Internal.Show.Show op) => GHC.Internal.Show.Show (Ormolu.Printer.Operators.OpTree ty op)


-- | Printer for fixity overrides.
module Ormolu.Fixity.Printer

-- | Print out a textual representation of an <tt>.ormolu</tt> file.
printDotOrmolu :: FixityOverrides -> ModuleReexports -> Text


-- | Parser for fixity maps.
module Ormolu.Fixity.Parser

-- | Parse textual representation of <a>FixityOverrides</a>.
parseDotOrmolu :: FilePath -> Text -> Either (ParseErrorBundle Text Void) (FixityOverrides, ModuleReexports)

-- | Parse a single self-contained fixity declaration.
parseFixityDeclaration :: Text -> Either (ParseErrorBundle Text Void) [(OpName, FixityInfo)]

-- | Parse a single self-contained module re-export declaration.
parseModuleReexportDeclaration :: Text -> Either (ParseErrorBundle Text Void) (ModuleName, NonEmpty (Maybe PackageName, ModuleName))

-- | Parse a single fixity declaration, such as
--   
--   <pre>
--   infixr 4 +++, &gt;&gt;&gt;
--   </pre>
pFixity :: Parser [(OpName, FixityInfo)]

-- | See
--   <a>https://www.haskell.org/onlinereport/haskell2010/haskellch2.html</a>
pOperator :: Parser OpName
pModuleName :: Parser ModuleName
pPackageName :: Parser PackageName
isIdentifierFirstChar :: Char -> Bool
isIdentifierConstituent :: Char -> Bool
isOperatorConstituent :: Char -> Bool
isPackageNameConstituent :: Char -> Bool
isModuleSegmentFirstChar :: Char -> Bool
isModuleSegmentConstituent :: Char -> Bool


-- | Configuration options used by the tool.
module Ormolu.Config

-- | Ormolu configuration.
data Config region
Config :: ![DynOption] -> !FixityOverrides -> !ModuleReexports -> !Set PackageName -> !Bool -> !Bool -> !Bool -> !SourceType -> !ColorMode -> !region -> Config region

-- | Dynamic options to pass to GHC parser
[cfgDynOptions] :: Config region -> ![DynOption]

-- | Fixity overrides
[cfgFixityOverrides] :: Config region -> !FixityOverrides

-- | Module reexports to take into account when doing fixity resolution
[cfgModuleReexports] :: Config region -> !ModuleReexports

-- | Known dependencies, if any
[cfgDependencies] :: Config region -> !Set PackageName

-- | Do formatting faster but without automatic detection of defects
[cfgUnsafe] :: Config region -> !Bool

-- | Output information useful for debugging
[cfgDebug] :: Config region -> !Bool

-- | Checks if re-formatting the result is idempotent
[cfgCheckIdempotence] :: Config region -> !Bool

-- | How to parse the input (regular haskell module or Backpack file)
[cfgSourceType] :: Config region -> !SourceType

-- | Whether to use colors and other features of ANSI terminals
[cfgColorMode] :: Config region -> !ColorMode

-- | Region selection
[cfgRegion] :: Config region -> !region

-- | Whether to use colors and other features of ANSI terminals.
data ColorMode
Never :: ColorMode
Always :: ColorMode
Auto :: ColorMode

-- | Region selection as the combination of start and end line numbers.
data RegionIndices
RegionIndices :: !Maybe Int -> !Maybe Int -> RegionIndices

-- | Start line of the region to format
[regionStartLine] :: RegionIndices -> !Maybe Int

-- | End line of the region to format
[regionEndLine] :: RegionIndices -> !Maybe Int

-- | Region selection as the length of the literal prefix and the literal
--   suffix.
data RegionDeltas
RegionDeltas :: !Int -> !Int -> RegionDeltas

-- | Prefix length in number of lines
[regionPrefixLength] :: RegionDeltas -> !Int

-- | Suffix length in number of lines
[regionSuffixLength] :: RegionDeltas -> !Int

-- | Type of sources that can be formatted by Ormolu.
data SourceType

-- | Consider the input as a regular Haskell module
ModuleSource :: SourceType

-- | Consider the input as a Backpack module signature
SignatureSource :: SourceType

-- | Default <tt><a>Config</a> <a>RegionIndices</a></tt>.
defaultConfig :: Config RegionIndices

-- | 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.
overapproximatedDependencies :: Config region -> Set PackageName

-- | Convert <a>RegionIndices</a> into <a>RegionDeltas</a>.
regionIndicesToDeltas :: Int -> RegionIndices -> RegionDeltas

-- | A wrapper for dynamic options.
newtype DynOption
DynOption :: String -> DynOption
[unDynOption] :: DynOption -> String

-- | Convert <a>DynOption</a> to <tt><a>Located</a> <a>String</a></tt>.
dynOptionToLocatedStr :: DynOption -> Located String
instance GHC.Classes.Eq region => GHC.Classes.Eq (Ormolu.Config.Config region)
instance GHC.Classes.Eq Ormolu.Config.DynOption
instance GHC.Classes.Eq Ormolu.Config.RegionDeltas
instance GHC.Classes.Eq Ormolu.Config.RegionIndices
instance GHC.Classes.Eq Ormolu.Config.SourceType
instance GHC.Internal.Base.Functor Ormolu.Config.Config
instance GHC.Internal.Generics.Generic (Ormolu.Config.Config region)
instance GHC.Classes.Ord Ormolu.Config.DynOption
instance GHC.Internal.Show.Show region => GHC.Internal.Show.Show (Ormolu.Config.Config region)
instance GHC.Internal.Show.Show Ormolu.Config.DynOption
instance GHC.Internal.Show.Show Ormolu.Config.RegionDeltas
instance GHC.Internal.Show.Show Ormolu.Config.RegionIndices
instance GHC.Internal.Show.Show Ormolu.Config.SourceType


-- | Common definitions for pre- and post- processing.
module Ormolu.Processing.Common

-- | Remove indentation from a given <a>Text</a>. Return the input with
--   indentation removed and the detected indentation level.
removeIndentation :: Text -> (Text, Int)

-- | Add indentation to a <a>Text</a>.
reindent :: Int -> Text -> Text

-- | All lines in the region specified by <a>RegionDeltas</a>.
linesInRegion :: RegionDeltas -> Text -> Text

-- | Convert a set of line indices into disjoint <tt>RegionDelta</tt>s
intSetToRegions :: Int -> IntSet -> [RegionDeltas]


-- | Preprocessing for input source code.
module Ormolu.Processing.Preprocess

-- | Preprocess the specified region of the input into raw snippets and
--   subregions to be formatted.
preprocess :: Bool -> RegionDeltas -> Text -> [Either Text RegionDeltas]
instance GHC.Classes.Eq Ormolu.Processing.Preprocess.OrmoluState
instance GHC.Internal.Show.Show Ormolu.Processing.Preprocess.OrmoluState


-- | In most cases import <a>Ormolu.Printer.Combinators</a> instead, these
--   functions are the low-level building blocks and should not be used on
--   their own. The <a>R</a> monad is re-exported from
--   <a>Ormolu.Printer.Combinators</a> as well.
module Ormolu.Printer.Internal

-- | The <a>R</a> monad hosts combinators that allow us to describe how to
--   render AST.
data R a

-- | Run <a>R</a> monad.
runR :: R () -> SpanStream -> CommentStream -> SourceType -> EnumSet Extension -> ModuleFixityMap -> Bool -> Text

-- | Output a fixed <a>Text</a> fragment. The argument may not contain any
--   line breaks. <a>txt</a> is used to output all sorts of “fixed” bits of
--   syntax like keywords and pipes <tt>|</tt> in functional dependencies.
--   
--   To separate various bits of syntax with white space use <a>space</a>
--   instead of <tt><a>txt</a> " "</tt>. To output <a>Outputable</a>
--   Haskell entities like numbers use <a>atom</a>.
txt :: Text -> R ()

-- | Similar to <a>txt</a> but the text inserted this way is assumed to
--   break the “link” between the preceding atom and its pending comments.
interferingTxt :: Text -> R ()

-- | Output <a>Outputable</a> fragment of AST. This can be used to output
--   numeric literals and similar. Everything that doesn't have inner
--   structure but does have an <a>Outputable</a> instance.
atom :: Outputable a => a -> R ()

-- | This primitive <i>does not</i> necessarily output a space. It just
--   ensures that the next thing that will be printed on the same line will
--   be separated by a single space from the previous output. Using this
--   combinator twice results in at most one space.
--   
--   In practice this design prevents trailing white space and makes it
--   hard to output more than one delimiting space in a row, which is what
--   we usually want.
space :: R ()

-- | Output a newline. First time <a>newline</a> is used after some
--   non-<a>newline</a> output it gets inserted immediately. Second use of
--   <a>newline</a> does not output anything but makes sure that the next
--   non-white space output will be prefixed by a newline. Using
--   <a>newline</a> more than twice in a row has no effect. Also, using
--   <a>newline</a> at the very beginning has no effect, this is to avoid
--   leading whitespace.
--   
--   Similarly to <a>space</a>, this design prevents trailing newlines and
--   makes it hard to output more than one blank newline in a row.
newline :: R ()

-- | Return the source type.
askSourceType :: R SourceType

-- | Retrieve the module fixity map.
askModuleFixityMap :: R ModuleFixityMap

-- | Retrieve whether we should print out certain debug information while
--   printing.
askDebug :: R (Choice "debug")

-- | Increase indentation level by one indentation step for the inner
--   computation. <a>inci</a> should be used when a part of code must be
--   more indented relative to the parts outside of <a>inci</a> in order
--   for the output to be valid Haskell. When layout is single-line there
--   is no obvious effect, but with multi-line layout correct indentation
--   levels matter.
inci :: R () -> R ()

-- | Set indentation level for the inner computation equal to current
--   column. This makes sure that the entire inner block is uniformly
--   "shifted" to the right.
sitcc :: R () -> R ()

-- | <a>Layout</a> options.
data Layout

-- | Put everything on single line
SingleLine :: Layout

-- | Use multiple lines
MultiLine :: Layout

-- | Set <a>Layout</a> for internal computation.
enterLayout :: Layout -> R () -> R ()

-- | Do one or another thing depending on current <a>Layout</a>.
vlayout :: R a -> R a -> R a

-- | Get current <a>Layout</a>.
getLayout :: R Layout

-- | Make the inner computation use braces around single-line layouts.
useBraces :: R () -> R ()

-- | Make the inner computation omit braces around single-line layouts.
dontUseBraces :: R () -> R ()

-- | Return <a>True</a> if we can use braces in this context.
canUseBraces :: R Bool

-- | Modes for rendering of pending comments.
data CommentPosition

-- | Put the comment on the same line
OnTheSameLine :: CommentPosition

-- | Put the comment on next line
OnNextLine :: CommentPosition

-- | Register a comment line for outputting. It will be inserted right
--   before next newline. When the comment goes after something else on the
--   same line, a space will be inserted between preceding text and the
--   comment when necessary.
registerPendingCommentLine :: CommentPosition -> Text -> R ()

-- | Drop elements that begin before or at the same place as given
--   <a>SrcSpan</a>.
trimSpanStream :: RealSrcSpan -> R ()

-- | Get location of next element in AST.
nextEltSpan :: R (Maybe RealSrcSpan)

-- | Pop a <a>Comment</a> from the <a>CommentStream</a> if given predicate
--   is satisfied and there are comments in the stream.
popComment :: (LComment -> Bool) -> R (Maybe LComment)

-- | Get the comments contained in the enclosing span.
getEnclosingComments :: R [LComment]

-- | Get the immediately enclosing <a>RealSrcSpan</a>.
getEnclosingSpan :: R (Maybe RealSrcSpan)

-- | Get the first enclosing <a>RealSrcSpan</a> that satisfies given
--   predicate.
getEnclosingSpanWhere :: (RealSrcSpan -> Bool) -> R (Maybe RealSrcSpan)

-- | Set <a>RealSrcSpan</a> of enclosing span for the given computation.
withEnclosingSpan :: RealSrcSpan -> R () -> R ()

-- | Get spans on this line so far.
thisLineSpans :: R [RealSrcSpan]

-- | An auxiliary marker for keeping track of last output element.
data SpanMark

-- | Haddock comment
HaddockSpan :: HaddockStyle -> RealSrcSpan -> SpanMark

-- | Non-haddock comment
CommentSpan :: RealSrcSpan -> SpanMark

-- | A statement in a do-block and such span
StatementSpan :: RealSrcSpan -> SpanMark

-- | Project <a>RealSrcSpan</a> from <a>SpanMark</a>.
spanMarkSpan :: SpanMark -> RealSrcSpan

-- | Haddock string style.
data HaddockStyle

-- | <pre>
--   -- |
--   </pre>
Pipe :: HaddockStyle

-- | <pre>
--   -- ^
--   </pre>
Caret :: HaddockStyle

-- | <pre>
--   -- *
--   </pre>
Asterisk :: Int -> HaddockStyle

-- | <pre>
--   -- $
--   </pre>
Named :: String -> HaddockStyle

-- | Set span of last output comment.
setSpanMark :: SpanMark -> R ()

-- | Get span of last output comment.
getSpanMark :: R (Maybe SpanMark)
isExtensionEnabled :: Extension -> R Bool
instance GHC.Internal.Base.Applicative Ormolu.Printer.Internal.R
instance GHC.Classes.Eq Ormolu.Printer.Internal.CommentPosition
instance GHC.Classes.Eq Ormolu.Printer.Internal.Layout
instance GHC.Classes.Eq Ormolu.Printer.Internal.RequestedDelimiter
instance GHC.Classes.Eq Ormolu.Printer.Internal.SpitType
instance GHC.Internal.Base.Functor Ormolu.Printer.Internal.R
instance GHC.Internal.Base.Monad Ormolu.Printer.Internal.R
instance GHC.Internal.Show.Show Ormolu.Printer.Internal.CommentPosition
instance GHC.Internal.Show.Show Ormolu.Printer.Internal.Layout
instance GHC.Internal.Show.Show Ormolu.Printer.Internal.RequestedDelimiter
instance GHC.Internal.Show.Show Ormolu.Printer.Internal.SpitType


-- | Helpers for formatting of comments. This is low-level code, use
--   <a>Ormolu.Printer.Combinators</a> unless you know what you are doing.
module Ormolu.Printer.Comments

-- | Output all preceding comments for an element at given location.
spitPrecedingComments :: RealSrcSpan -> R ()

-- | Output all comments following an element at given location.
spitFollowingComments :: RealSrcSpan -> R ()

-- | Output all remaining comments in the comment stream.
spitRemainingComments :: R ()

-- | Output a <a>Comment</a> immediately. This is a low-level printing
--   function.
spitCommentNow :: RealSrcSpan -> Comment -> R ()

-- | Output a <a>Comment</a> at the end of correct line or after it
--   depending on <a>CommentPosition</a>. Used for comments that may
--   potentially follow on the same line as something we just rendered, but
--   not immediately after it.
spitCommentPending :: CommentPosition -> RealSrcSpan -> Comment -> R ()


-- | Printing combinators. The definitions here are presented in such an
--   order so you can just go through the Haddocks and by the end of the
--   file you should have a pretty good idea how to program rendering
--   logic.
module Ormolu.Printer.Combinators

-- | The <a>R</a> monad hosts combinators that allow us to describe how to
--   render AST.
data R a

-- | Run <a>R</a> monad.
runR :: R () -> SpanStream -> CommentStream -> SourceType -> EnumSet Extension -> ModuleFixityMap -> Bool -> Text

-- | Get the immediately enclosing <a>RealSrcSpan</a>.
getEnclosingSpan :: R (Maybe RealSrcSpan)

-- | Get the first enclosing <a>RealSrcSpan</a> that satisfies given
--   predicate.
getEnclosingSpanWhere :: (RealSrcSpan -> Bool) -> R (Maybe RealSrcSpan)

-- | Get the comments contained in the enclosing span.
getEnclosingComments :: R [LComment]
isExtensionEnabled :: Extension -> R Bool

-- | Output a fixed <a>Text</a> fragment. The argument may not contain any
--   line breaks. <a>txt</a> is used to output all sorts of “fixed” bits of
--   syntax like keywords and pipes <tt>|</tt> in functional dependencies.
--   
--   To separate various bits of syntax with white space use <a>space</a>
--   instead of <tt><a>txt</a> " "</tt>. To output <a>Outputable</a>
--   Haskell entities like numbers use <a>atom</a>.
txt :: Text -> R ()

-- | Output <a>Outputable</a> fragment of AST. This can be used to output
--   numeric literals and similar. Everything that doesn't have inner
--   structure but does have an <a>Outputable</a> instance.
atom :: Outputable a => a -> R ()

-- | This primitive <i>does not</i> necessarily output a space. It just
--   ensures that the next thing that will be printed on the same line will
--   be separated by a single space from the previous output. Using this
--   combinator twice results in at most one space.
--   
--   In practice this design prevents trailing white space and makes it
--   hard to output more than one delimiting space in a row, which is what
--   we usually want.
space :: R ()

-- | Output a newline. First time <a>newline</a> is used after some
--   non-<a>newline</a> output it gets inserted immediately. Second use of
--   <a>newline</a> does not output anything but makes sure that the next
--   non-white space output will be prefixed by a newline. Using
--   <a>newline</a> more than twice in a row has no effect. Also, using
--   <a>newline</a> at the very beginning has no effect, this is to avoid
--   leading whitespace.
--   
--   Similarly to <a>space</a>, this design prevents trailing newlines and
--   makes it hard to output more than one blank newline in a row.
newline :: R ()

-- | Increase indentation level by one indentation step for the inner
--   computation. <a>inci</a> should be used when a part of code must be
--   more indented relative to the parts outside of <a>inci</a> in order
--   for the output to be valid Haskell. When layout is single-line there
--   is no obvious effect, but with multi-line layout correct indentation
--   levels matter.
inci :: R () -> R ()

-- | Indent the inner expression if the first argument is <a>True</a>.
inciIf :: Bool -> R () -> R ()

-- | Return the source type.
askSourceType :: R SourceType

-- | Retrieve the module fixity map.
askModuleFixityMap :: R ModuleFixityMap

-- | Retrieve whether we should print out certain debug information while
--   printing.
askDebug :: R (Choice "debug")

-- | Enter a <a>GenLocated</a> entity. This combinator handles outputting
--   comments and sets layout (single-line vs multi-line) for the inner
--   computation. Roughly, the rule for using <a>located</a> is that every
--   time there is a <a>Located</a> wrapper, it should be “discharged” with
--   a corresponding <a>located</a> invocation.
located :: HasLoc l => GenLocated l a -> (a -> R ()) -> R ()

-- | Similar to <a>located</a>, but when the "payload" is an empty list,
--   print virtual elements at the start and end of the source span to
--   prevent comments from "floating out".
encloseLocated :: HasLoc l => GenLocated l [a] -> ([a] -> R ()) -> R ()

-- | A version of <a>located</a> with arguments flipped.
located' :: HasLoc l => (a -> R ()) -> GenLocated l a -> R ()

-- | Set layout according to combination of given <a>SrcSpan</a>s for a
--   given. Use this only when you need to set layout based on e.g.
--   combined span of several elements when there is no corresponding
--   <a>Located</a> wrapper provided by GHC AST. It is relatively rare that
--   this one is needed.
--   
--   Given empty list this function will set layout to single line.
switchLayout :: [SrcSpan] -> R () -> R ()

-- | <a>Layout</a> options.
data Layout

-- | Put everything on single line
SingleLine :: Layout

-- | Use multiple lines
MultiLine :: Layout

-- | Do one or another thing depending on current <a>Layout</a>.
vlayout :: R a -> R a -> R a

-- | Get current <a>Layout</a>.
getLayout :: R Layout

-- | Insert a space if enclosing layout is single-line, or newline if it's
--   multiline.
--   
--   <pre>
--   breakpoint = vlayout space newline
--   </pre>
breakpoint :: R ()

-- | Similar to <a>breakpoint</a> but outputs nothing in case of
--   single-line layout.
--   
--   <pre>
--   breakpoint' = vlayout (return ()) newline
--   </pre>
breakpoint' :: R ()

-- | Render a collection of elements inserting a separator between them.
sep :: R () -> (a -> R ()) -> [a] -> R ()

-- | Render a collection of elements layout-sensitively using given
--   printer, inserting semicolons if necessary and respecting
--   <a>useBraces</a> and <a>dontUseBraces</a> combinators.
--   
--   <pre>
--   useBraces $ sepSemi txt ["foo", "bar"]
--     == vlayout (txt "{ foo; bar }") (txt "foo\nbar")
--   </pre>
--   
--   <pre>
--   dontUseBraces $ sepSemi txt ["foo", "bar"]
--     == vlayout (txt "foo; bar") (txt "foo\nbar")
--   </pre>
sepSemi :: (a -> R ()) -> [a] -> R ()

-- | Return <a>True</a> if we can use braces in this context.
canUseBraces :: R Bool

-- | Make the inner computation use braces around single-line layouts.
useBraces :: R () -> R ()

-- | Make the inner computation omit braces around single-line layouts.
dontUseBraces :: R () -> R ()

-- | <a>BracketStyle</a> controlling how closing bracket is rendered.
data BracketStyle

-- | Normal
N :: BracketStyle

-- | Shifted one level
S :: BracketStyle

-- | Set indentation level for the inner computation equal to current
--   column. This makes sure that the entire inner block is uniformly
--   "shifted" to the right.
sitcc :: R () -> R ()

-- | Surround given entity by backticks.
backticks :: R () -> R ()

-- | Surround given entity by banana brackets (i.e., from arrow notation.)
banana :: BracketStyle -> R () -> R ()

-- | Surround given entity by curly braces <tt>{</tt> and <tt>}</tt>.
braces :: BracketStyle -> R () -> R ()

-- | Surround given entity by square brackets <tt>[</tt> and <tt>]</tt>.
brackets :: BracketStyle -> R () -> R ()

-- | Surround given entity by parentheses <tt>(</tt> and <tt>)</tt>.
parens :: BracketStyle -> R () -> R ()

-- | Surround given entity by <tt>(# </tt> and <tt> #)</tt>.
parensHash :: BracketStyle -> R () -> R ()

-- | Braces as used for pragmas: <tt>{-#</tt> and <tt>#-}</tt>.
pragmaBraces :: R () -> R ()

-- | Surround the body with a pragma name and <a>pragmaBraces</a>.
pragma :: Text -> R () -> R ()

-- | Print <tt>,</tt>.
comma :: R ()

-- | Delimiting combination with <a>comma</a>. To be used with <a>sep</a>.
commaDel :: R ()

-- | Print <tt>=</tt>. Do not use <tt><a>txt</a> "="</tt>.
equals :: R ()

-- | An auxiliary marker for keeping track of last output element.
data SpanMark

-- | Haddock comment
HaddockSpan :: HaddockStyle -> RealSrcSpan -> SpanMark

-- | Non-haddock comment
CommentSpan :: RealSrcSpan -> SpanMark

-- | A statement in a do-block and such span
StatementSpan :: RealSrcSpan -> SpanMark

-- | Project <a>RealSrcSpan</a> from <a>SpanMark</a>.
spanMarkSpan :: SpanMark -> RealSrcSpan

-- | Haddock string style.
data HaddockStyle

-- | <pre>
--   -- |
--   </pre>
Pipe :: HaddockStyle

-- | <pre>
--   -- ^
--   </pre>
Caret :: HaddockStyle

-- | <pre>
--   -- *
--   </pre>
Asterisk :: Int -> HaddockStyle

-- | <pre>
--   -- $
--   </pre>
Named :: String -> HaddockStyle

-- | Set span of last output comment.
setSpanMark :: SpanMark -> R ()

-- | Get span of last output comment.
getSpanMark :: R (Maybe SpanMark)

-- | Expression placement. This marks the places where expressions that
--   implement handing forms may use them.
data Placement

-- | Multi-line layout should cause insertion of a newline and indentation
--   bump
Normal :: Placement

-- | Expressions that have hanging form should use it and avoid bumping one
--   level of indentation
Hanging :: Placement

-- | Place a thing that may have a hanging form. This function handles how
--   to separate it from preceding expressions and whether to bump
--   indentation depending on what sort of expression we have.
placeHanging :: Placement -> R () -> R ()
instance GHC.Classes.Eq Ormolu.Printer.Combinators.BracketStyle
instance GHC.Classes.Eq Ormolu.Printer.Combinators.Placement
instance GHC.Internal.Show.Show Ormolu.Printer.Combinators.BracketStyle
instance GHC.Internal.Show.Show Ormolu.Printer.Combinators.Placement


-- | Pretty-printing of language pragmas.
module Ormolu.Printer.Meat.Pragma

-- | Print a collection of <a>Pragma</a>s with their associated comments.
p_pragmas :: [([LComment], Pragma)] -> R ()
instance GHC.Classes.Eq Ormolu.Printer.Meat.Pragma.LanguagePragmaClass
instance GHC.Classes.Eq Ormolu.Printer.Meat.Pragma.PragmaTy
instance GHC.Classes.Ord Ormolu.Printer.Meat.Pragma.LanguagePragmaClass
instance GHC.Classes.Ord Ormolu.Printer.Meat.Pragma.PragmaTy

module Ormolu.Printer.Meat.Declaration.StringLiteral

-- | Print the source text of a string literal while indenting gaps and
--   newlines correctly.
p_stringLit :: FastString -> R ()
instance GHC.Classes.Eq Ormolu.Printer.Meat.Declaration.StringLiteral.ParsedStringLiteral
instance GHC.Classes.Eq Ormolu.Printer.Meat.Declaration.StringLiteral.StringLiteralKind
instance GHC.Internal.Show.Show Ormolu.Printer.Meat.Declaration.StringLiteral.ParsedStringLiteral
instance GHC.Internal.Show.Show Ormolu.Printer.Meat.Declaration.StringLiteral.StringLiteralKind


-- | Rendering of commonly useful bits.
module Ormolu.Printer.Meat.Common

-- | Data and type family style.
data FamilyStyle

-- | Declarations in type classes
Associated :: FamilyStyle

-- | Top-level declarations
Free :: FamilyStyle

-- | Outputs the name of the module-like entity, preceeded by the correct
--   prefix ("module" or "signature").
p_hsmodName :: ModuleName -> R ()
p_ieWrappedName :: IEWrappedName GhcPs -> R ()

-- | Render a <tt><a>LocatedN</a> <a>RdrName</a></tt>.
p_rdrName :: LocatedN RdrName -> R ()
p_qualName :: ModuleName -> OccName -> R ()

-- | A helper for formatting infix constructions in lhs of definitions.
p_infixDefHelper :: Bool -> Bool -> R () -> [R ()] -> R ()

-- | Print a Haddock.
p_hsDoc :: HaddockStyle -> Choice "endNewline" -> LHsDoc GhcPs -> R ()

-- | Print anchor of named doc section.
p_hsDocName :: String -> R ()
p_sourceText :: SourceText -> R ()
p_namespaceSpec :: NamespaceSpecifier -> R ()
p_arrow :: (mult -> R ()) -> HsArrowOf mult GhcPs -> R ()


-- | Rendering of types.
module Ormolu.Printer.Meat.Type
p_hsType :: HsType GhcPs -> R ()

-- | Return <a>True</a> if at least one argument in <a>HsType</a> has a doc
--   string attached to it.
hasDocStrings :: HsType GhcPs -> Bool
p_hsContext :: HsContext GhcPs -> R ()
p_hsContext' :: HasLoc (Anno a) => (a -> R ()) -> [XRec GhcPs a] -> R ()
p_hsTyVarBndr :: IsTyVarBndrFlag flag => HsTyVarBndr flag GhcPs -> R ()
data ForAllVisibility
ForAllInvis :: ForAllVisibility
ForAllVis :: ForAllVisibility

-- | Render several <tt>forall</tt>-ed variables.
p_forallBndrs :: HasLoc l => ForAllVisibility -> (a -> R ()) -> [GenLocated l a] -> R ()
p_conDeclFields :: [LConDeclField GhcPs] -> R ()
p_lhsTypeArg :: LHsTypeArg GhcPs -> R ()
p_hsSigType :: HsSigType GhcPs -> R ()
p_hsForAllTelescope :: HsForAllTelescope GhcPs -> R ()
hsOuterTyVarBndrsToHsType :: HsOuterTyVarBndrs Specificity GhcPs -> LHsType GhcPs -> HsType GhcPs
lhsTypeToSigType :: LHsType GhcPs -> LHsSigType GhcPs
instance Ormolu.Printer.Meat.Type.IsTyVarBndrFlag (Language.Haskell.Syntax.Type.HsBndrVis GHC.Hs.Extension.GhcPs)
instance Ormolu.Printer.Meat.Type.IsTyVarBndrFlag Language.Haskell.Syntax.Specificity.Specificity
instance Ormolu.Printer.Meat.Type.IsTyVarBndrFlag ()

module Ormolu.Printer.Meat.Declaration.Warning
p_warnDecls :: WarnDecls GhcPs -> R ()
p_warningTxt :: WarningTxt GhcPs -> R ()


-- | Rendering of import and export lists.
module Ormolu.Printer.Meat.ImportExport
p_hsmodExports :: [LIE GhcPs] -> R ()
p_hsmodImport :: ImportDecl GhcPs -> R ()


-- | Rendering of data/type families.
module Ormolu.Printer.Meat.Declaration.TypeFamily
p_famDecl :: FamilyStyle -> FamilyDecl GhcPs -> R ()
p_tyFamInstEqn :: TyFamInstEqn GhcPs -> R ()


-- | Rendering of type synonym declarations.
module Ormolu.Printer.Meat.Declaration.Type
p_synDecl :: LocatedN RdrName -> LexicalFixity -> LHsQTyVars GhcPs -> LHsType GhcPs -> R ()


-- | Type signature declarations.
module Ormolu.Printer.Meat.Declaration.Signature
p_sigDecl :: Sig GhcPs -> R ()
p_typeAscription :: LHsSigType GhcPs -> R ()
p_activation :: Activation -> R ()
p_standaloneKindSig :: StandaloneKindSig GhcPs -> R ()


-- | Rendering of Role annotation declarations.
module Ormolu.Printer.Meat.Declaration.RoleAnnotation
p_roleAnnot :: RoleAnnotDecl GhcPs -> R ()

module Ormolu.Printer.Meat.Declaration.Foreign
p_foreignDecl :: ForeignDecl GhcPs -> R ()

module Ormolu.Printer.Meat.Declaration.Default
p_defaultDecl :: DefaultDecl GhcPs -> R ()


-- | Renedring of data type declarations.
module Ormolu.Printer.Meat.Declaration.Data
p_dataDecl :: FamilyStyle -> LocatedN RdrName -> [tyVar] -> (tyVar -> SrcSpan) -> (tyVar -> R ()) -> LexicalFixity -> HsDataDefn GhcPs -> R ()

module Ormolu.Printer.Meat.Declaration.Value
p_valDecl :: HsBind GhcPs -> R ()
p_pat :: Pat GhcPs -> R ()
p_hsExpr :: HsExpr GhcPs -> R ()
p_hsUntypedSplice :: SpliceDecoration -> HsUntypedSplice GhcPs -> R ()

-- | An applicand is the left-hand side in a function application, i.e.
--   <tt>f</tt> in <tt>f a</tt>. We need to track this in order to add
--   extra identation in cases like
--   
--   <pre>
--   foo =
--     do
--         succ
--       1
--   </pre>
data IsApplicand
Applicand :: IsApplicand
NotApplicand :: IsApplicand
p_hsExpr' :: IsApplicand -> BracketStyle -> HsExpr GhcPs -> R ()

-- | Print a top-level command.
p_hsCmdTop :: BracketStyle -> HsCmdTop GhcPs -> R ()

-- | Check if given expression has a hanging form.
exprPlacement :: HsExpr GhcPs -> Placement

-- | Determine placement of a top level command.
cmdTopPlacement :: HsCmdTop GhcPs -> Placement

module Ormolu.Printer.Meat.Declaration.Splice
p_spliceDecl :: SpliceDecl GhcPs -> R ()

module Ormolu.Printer.Meat.Declaration.Rule
p_ruleDecls :: RuleDecls GhcPs -> R ()


-- | Printing of operator trees.
module Ormolu.Printer.Meat.Declaration.OpTree

-- | Print an operator tree where leaves are values.
p_exprOpTree :: BracketStyle -> OpTree (LHsExpr GhcPs) (OpInfo (LHsExpr GhcPs)) -> R ()

-- | Convert a <a>LHsExpr</a> containing an operator tree to the
--   <a>OpTree</a> intermediate representation.
exprOpTree :: LHsExpr GhcPs -> OpTree (LHsExpr GhcPs) (LHsExpr GhcPs)

-- | Print an operator tree where leaves are commands.
p_cmdOpTree :: BracketStyle -> OpTree (LHsCmdTop GhcPs) (OpInfo (LHsExpr GhcPs)) -> R ()

-- | Convert a <a>LHsCmdTop</a> containing an operator tree to the
--   <a>OpTree</a> intermediate representation.
cmdOpTree :: LHsCmdTop GhcPs -> OpTree (LHsCmdTop GhcPs) (LHsExpr GhcPs)

-- | Print an operator tree where leaves are types.
p_tyOpTree :: OpTree (LHsType GhcPs) (OpInfo (LocatedN RdrName)) -> R ()

-- | Convert a LHsType containing an operator tree to the <a>OpTree</a>
--   intermediate representation.
tyOpTree :: LHsType GhcPs -> OpTree (LHsType GhcPs) (LocatedN RdrName)

-- | Extract the operator name of the specified <a>HsExpr</a> if this
--   expression corresponds to an operator.
getOpName :: HsExpr GhcPs -> Maybe RdrName

-- | Convert an operator name to a <a>String</a>.
getOpNameStr :: RdrName -> String

module Ormolu.Printer.Meat.Declaration.Annotation
p_annDecl :: AnnDecl GhcPs -> R ()


-- | Type class, type family, and data family instance declarations.
module Ormolu.Printer.Meat.Declaration.Instance
p_clsInstDecl :: ClsInstDecl GhcPs -> R ()
p_tyFamInstDecl :: FamilyStyle -> TyFamInstDecl GhcPs -> R ()
p_dataFamInstDecl :: FamilyStyle -> DataFamInstDecl GhcPs -> R ()
p_standaloneDerivDecl :: DerivDecl GhcPs -> R ()


-- | Rendering of type class declarations.
module Ormolu.Printer.Meat.Declaration.Class
p_classDecl :: Maybe (LHsContext GhcPs) -> LocatedN RdrName -> LHsQTyVars GhcPs -> LexicalFixity -> [LHsFunDep GhcPs] -> [LSig GhcPs] -> LHsBinds GhcPs -> [LFamilyDecl GhcPs] -> [LTyFamDefltDecl GhcPs] -> [LDocDecl GhcPs] -> R ()


-- | Rendering of declarations.
module Ormolu.Printer.Meat.Declaration
p_hsDecls :: FamilyStyle -> [LHsDecl GhcPs] -> R ()

-- | Like <a>p_hsDecls</a> but respects user choices regarding grouping. If
--   the user omits newlines between declarations, we also omit them in
--   most cases, except when said declarations have associated Haddocks.
--   
--   Does some normalization (compress subsequent newlines into a single
--   one)
p_hsDeclsRespectGrouping :: FamilyStyle -> [LHsDecl GhcPs] -> R ()
instance GHC.Classes.Eq Ormolu.Printer.Meat.Declaration.UserGrouping
instance GHC.Internal.Show.Show Ormolu.Printer.Meat.Declaration.UserGrouping


-- | Rendering of modules.
module Ormolu.Printer.Meat.Module

-- | Render a module-like entity (either a regular module or a backpack
--   signature).
p_hsModule :: Maybe LComment -> [([LComment], Pragma)] -> HsModule GhcPs -> R ()


-- | A type for result of parsing.
module Ormolu.Parser.Result

-- | Either a <a>ParseResult</a>, or a raw snippet.
data SourceSnippet
RawSnippet :: Text -> SourceSnippet
ParsedSnippet :: ParseResult -> SourceSnippet

-- | A collection of data that represents a parsed module in Ormolu.
data ParseResult
ParseResult :: HsModule GhcPs -> SourceType -> Maybe LComment -> [([LComment], Pragma)] -> CommentStream -> EnumSet Extension -> ModuleFixityMap -> Int -> ParseResult

-- | Parsed module or signature
[prParsedSource] :: ParseResult -> HsModule GhcPs

-- | Either regular module or signature file
[prSourceType] :: ParseResult -> SourceType

-- | Stack header
[prStackHeader] :: ParseResult -> Maybe LComment

-- | Pragmas and the associated comments
[prPragmas] :: ParseResult -> [([LComment], Pragma)]

-- | Comment stream
[prCommentStream] :: ParseResult -> CommentStream

-- | Enabled extensions
[prExtensions] :: ParseResult -> EnumSet Extension

-- | Fixity map for operators
[prModuleFixityMap] :: ParseResult -> ModuleFixityMap

-- | Indentation level, can be non-zero in case of region formatting
[prIndent] :: ParseResult -> Int


-- | Pretty-printer for Haskell AST.
module Ormolu.Printer

-- | Render several source snippets.
printSnippets :: Bool -> [SourceSnippet] -> Text


-- | Parser for Haskell source code.
module Ormolu.Parser

-- | Parse a complete module from <a>Text</a>.
parseModule :: MonadIO m => Config RegionDeltas -> PackageFixityMap -> FilePath -> Text -> m (DriverMessages, Either (SrcSpan, String) [SourceSnippet])

-- | Extensions that are not enabled automatically and should be activated
--   by user.
manualExts :: [Extension]


-- | This module allows us to diff two <a>ParseResult</a>s.
module Ormolu.Diff.ParseResult

-- | Result of comparing two <a>ParseResult</a>s.
data ParseResultDiff

-- | Two parse results are the same
Same :: ParseResultDiff

-- | Two parse results differ
Different :: [RealSrcSpan] -> ParseResultDiff

-- | Return <tt>Diff</tt> of two <a>ParseResult</a>s.
diffParseResult :: ParseResult -> ParseResult -> ParseResultDiff
instance GHC.Internal.Base.Monoid Ormolu.Diff.ParseResult.ParseResultDiff
instance GHC.Internal.Base.Semigroup Ormolu.Diff.ParseResult.ParseResultDiff
instance GHC.Internal.Show.Show Ormolu.Diff.ParseResult.ParseResultDiff

module Ormolu.Utils.IO

-- | Find the path to the closest file higher in the file hierarchy that
--   satisfies a given predicate.
findClosestFileSatisfying :: MonadIO m => (FilePath -> Bool) -> FilePath -> m (Maybe FilePath)
data Cache k v
newCache :: Ord k => IO (Cache k v)

-- | Execute an <a>IO</a> action but only if the given key is not found in
--   the cache.
withCache :: Ord k => Cache k v -> k -> IO v -> IO v

module Ormolu.Utils.Fixity

-- | Attempt to locate and parse an <tt>.ormolu</tt> file. If it does not
--   exist, default fixity map and module reexports are returned. This
--   function maintains a cache of fixity overrides and module re-exports
--   where cabal file paths act as keys.
getDotOrmoluForSourceFile :: MonadIO m => FilePath -> m (FixityOverrides, ModuleReexports)

-- | A wrapper around <a>parseFixityDeclaration</a> for parsing individual
--   fixity definitions.
parseFixityDeclarationStr :: String -> Either String [(OpName, FixityInfo)]

-- | A wrapper around <a>parseModuleReexportDeclaration</a> for parsing a
--   individual module reexport.
parseModuleReexportDeclarationStr :: String -> Either String (ModuleName, NonEmpty (Maybe PackageName, ModuleName))

module Ormolu.Utils.Cabal

-- | The result of searching for a <tt>.cabal</tt> file.
data CabalSearchResult

-- | Cabal file could not be found
CabalNotFound :: CabalSearchResult

-- | Cabal file was found, but it did not mention the source file in
--   question
CabalDidNotMention :: CabalInfo -> CabalSearchResult

-- | Cabal file was found and it mentions the source file in question
CabalFound :: CabalInfo -> CabalSearchResult

-- | Cabal information of interest to Ormolu.
data CabalInfo
CabalInfo :: !PackageName -> ![DynOption] -> !Set PackageName -> !FilePath -> CabalInfo

-- | Package name
[ciPackageName] :: CabalInfo -> !PackageName

-- | Extension and language settings in the form of <a>DynOption</a>s
[ciDynOpts] :: CabalInfo -> ![DynOption]

-- | Direct dependencies
[ciDependencies] :: CabalInfo -> !Set PackageName

-- | Absolute path to the cabal file
[ciCabalFilePath] :: CabalInfo -> !FilePath

-- | This represents language extensions beyond a base <a>Language</a>
--   definition (such as <a>Haskell98</a>) that are supported by some
--   implementations, usually in some special mode.
--   
--   Where applicable, references are given to an implementation's official
--   documentation.
data Extension

-- | Enable a known extension
EnableExtension :: KnownExtension -> Extension

-- | Disable a known extension
DisableExtension :: KnownExtension -> Extension

-- | An unknown extension, identified by the name of its <tt>LANGUAGE</tt>
--   pragma.
UnknownExtension :: String -> Extension

-- | Locate a <tt>.cabal</tt> file corresponding to the given Haskell
--   source file and obtain <a>CabalInfo</a> from it.
getCabalInfoForSourceFile :: MonadIO m => FilePath -> m CabalSearchResult

-- | Find the path to an appropriate <tt>.cabal</tt> file for a Haskell
--   source file, if available.
findCabalFile :: MonadIO m => FilePath -> m (Maybe FilePath)

-- | Parse <a>CabalInfo</a> from a <tt>.cabal</tt> file at the given
--   <a>FilePath</a>.
parseCabalInfo :: MonadIO m => FilePath -> FilePath -> m (Bool, CabalInfo)
instance GHC.Classes.Eq Ormolu.Utils.Cabal.CabalInfo
instance GHC.Classes.Eq Ormolu.Utils.Cabal.CabalSearchResult
instance GHC.Internal.Show.Show Ormolu.Utils.Cabal.CabalInfo
instance GHC.Internal.Show.Show Ormolu.Utils.Cabal.CabalSearchResult
instance GHC.Internal.Show.Show Ormolu.Utils.Cabal.CachedCabalFile


-- | A formatter for Haskell source code. This module exposes the official
--   stable API, other modules may be not as reliable.
module Ormolu

-- | Format a <a>Text</a>.
--   
--   The function
--   
--   <ul>
--   <li>Needs <a>IO</a> because some functions from GHC that are necessary
--   to setup parsing context require <a>IO</a>. There should be no visible
--   side-effects though.</li>
--   <li>Takes file name just to use it in parse error messages.</li>
--   <li>Throws <a>OrmoluException</a>.</li>
--   </ul>
--   
--   <b>NOTE</b>: The caller is responsible for setting the appropriate
--   value in the <a>cfgSourceType</a> field. Autodetection of source type
--   won't happen here, see <a>detectSourceType</a>.
ormolu :: MonadIO m => Config RegionIndices -> FilePath -> Text -> m Text

-- | Load a file and format it. The file stays intact and the rendered
--   version is returned as <a>Text</a>.
--   
--   <b>NOTE</b>: The caller is responsible for setting the appropriate
--   value in the <a>cfgSourceType</a> field. Autodetection of source type
--   won't happen here, see <a>detectSourceType</a>.
ormoluFile :: MonadIO m => Config RegionIndices -> FilePath -> m Text

-- | Read input from stdin and format it.
--   
--   <b>NOTE</b>: The caller is responsible for setting the appropriate
--   value in the <a>cfgSourceType</a> field. Autodetection of source type
--   won't happen here, see <a>detectSourceType</a>.
ormoluStdin :: MonadIO m => Config RegionIndices -> m Text

-- | Ormolu configuration.
data Config region
Config :: ![DynOption] -> !FixityOverrides -> !ModuleReexports -> !Set PackageName -> !Bool -> !Bool -> !Bool -> !SourceType -> !ColorMode -> !region -> Config region

-- | Dynamic options to pass to GHC parser
[cfgDynOptions] :: Config region -> ![DynOption]

-- | Fixity overrides
[cfgFixityOverrides] :: Config region -> !FixityOverrides

-- | Module reexports to take into account when doing fixity resolution
[cfgModuleReexports] :: Config region -> !ModuleReexports

-- | Known dependencies, if any
[cfgDependencies] :: Config region -> !Set PackageName

-- | Do formatting faster but without automatic detection of defects
[cfgUnsafe] :: Config region -> !Bool

-- | Output information useful for debugging
[cfgDebug] :: Config region -> !Bool

-- | Checks if re-formatting the result is idempotent
[cfgCheckIdempotence] :: Config region -> !Bool

-- | How to parse the input (regular haskell module or Backpack file)
[cfgSourceType] :: Config region -> !SourceType

-- | Whether to use colors and other features of ANSI terminals
[cfgColorMode] :: Config region -> !ColorMode

-- | Region selection
[cfgRegion] :: Config region -> !region

-- | Whether to use colors and other features of ANSI terminals.
data ColorMode
Never :: ColorMode
Always :: ColorMode
Auto :: ColorMode

-- | Region selection as the combination of start and end line numbers.
data RegionIndices
RegionIndices :: !Maybe Int -> !Maybe Int -> RegionIndices

-- | Start line of the region to format
[regionStartLine] :: RegionIndices -> !Maybe Int

-- | End line of the region to format
[regionEndLine] :: RegionIndices -> !Maybe Int

-- | Type of sources that can be formatted by Ormolu.
data SourceType

-- | Consider the input as a regular Haskell module
ModuleSource :: SourceType

-- | Consider the input as a Backpack module signature
SignatureSource :: SourceType

-- | Default <tt><a>Config</a> <a>RegionIndices</a></tt>.
defaultConfig :: Config RegionIndices

-- | Detect <a>SourceType</a> based on the file extension.
detectSourceType :: FilePath -> SourceType

-- | Refine a <a>Config</a> by incorporating given <a>SourceType</a>,
--   <tt>CabalInfo</tt>, and fixity overrides <tt>FixityMap</tt>. You can
--   use <a>detectSourceType</a> to deduce <a>SourceType</a> based on the
--   file extension, <a>getCabalInfoForSourceFile</a> to obtain
--   <tt>CabalInfo</tt> and <tt>getFixityOverridesForSourceFile</tt> for
--   <tt>FixityMap</tt>.
refineConfig :: SourceType -> Maybe CabalInfo -> Maybe FixityOverrides -> Maybe ModuleReexports -> Config region -> Config region

-- | A wrapper for dynamic options.
newtype DynOption
DynOption :: String -> DynOption
[unDynOption] :: DynOption -> String

-- | The result of searching for a <tt>.cabal</tt> file.
data CabalSearchResult

-- | Cabal file could not be found
CabalNotFound :: CabalSearchResult

-- | Cabal file was found, but it did not mention the source file in
--   question
CabalDidNotMention :: CabalInfo -> CabalSearchResult

-- | Cabal file was found and it mentions the source file in question
CabalFound :: CabalInfo -> CabalSearchResult

-- | Cabal information of interest to Ormolu.
data CabalInfo
CabalInfo :: !PackageName -> ![DynOption] -> !Set PackageName -> !FilePath -> CabalInfo

-- | Package name
[ciPackageName] :: CabalInfo -> !PackageName

-- | Extension and language settings in the form of <a>DynOption</a>s
[ciDynOpts] :: CabalInfo -> ![DynOption]

-- | Direct dependencies
[ciDependencies] :: CabalInfo -> !Set PackageName

-- | Absolute path to the cabal file
[ciCabalFilePath] :: CabalInfo -> !FilePath

-- | Locate a <tt>.cabal</tt> file corresponding to the given Haskell
--   source file and obtain <a>CabalInfo</a> from it.
getCabalInfoForSourceFile :: MonadIO m => FilePath -> m CabalSearchResult

-- | Map from the operator name to its <a>FixityInfo</a>.
data FixityOverrides

-- | Fixity overrides to use by default.
defaultFixityOverrides :: FixityOverrides

-- | Module re-exports
data ModuleReexports

-- | Module re-exports to apply by default.
defaultModuleReexports :: ModuleReexports

-- | Attempt to locate and parse an <tt>.ormolu</tt> file. If it does not
--   exist, default fixity map and module reexports are returned. This
--   function maintains a cache of fixity overrides and module re-exports
--   where cabal file paths act as keys.
getDotOrmoluForSourceFile :: MonadIO m => FilePath -> m (FixityOverrides, ModuleReexports)

-- | Ormolu exception representing all cases when Ormolu can fail.
data OrmoluException

-- | Parsing of original source code failed
OrmoluParsingFailed :: SrcSpan -> String -> OrmoluException

-- | Parsing of formatted source code failed
OrmoluOutputParsingFailed :: SrcSpan -> String -> OrmoluException

-- | Original and resulting ASTs differ
OrmoluASTDiffers :: TextDiff -> [RealSrcSpan] -> OrmoluException

-- | Formatted source code is not idempotent
OrmoluNonIdempotentOutput :: TextDiff -> OrmoluException

-- | Some GHC options were not recognized
OrmoluUnrecognizedOpts :: NonEmpty String -> OrmoluException

-- | Cabal file parsing failed
OrmoluCabalFileParsingFailed :: FilePath -> NonEmpty PError -> OrmoluException

-- | Missing input file path when using stdin input and accounting for
--   .cabal files
OrmoluMissingStdinInputFile :: OrmoluException

-- | A parse error in a fixity overrides file
OrmoluFixityOverridesParseError :: ParseErrorBundle Text Void -> OrmoluException

-- | Inside this wrapper <a>OrmoluException</a> will be caught and
--   displayed nicely.
withPrettyOrmoluExceptions :: ColorMode -> IO ExitCode -> IO ExitCode
