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

-- | ExactPrint for GHC
--   
--   Using the API Annotations available from GHC 9.2.1, this library
--   provides a means to round trip any code that can be compiled by GHC,
--   currently excluding lhs files.
--   
--   Note: requires GHC 9.4.*. For earlier GHC versions see lower version
--   numbers.
@package ghc-exactprint
@version 1.6.1.3

module Language.Haskell.GHC.ExactPrint.Orphans
instance Data.Default.Class.Default GHC.Parser.Annotation.NameAnn
instance Data.Default.Class.Default GHC.Parser.Annotation.AnnList
instance Data.Default.Class.Default GHC.Parser.Annotation.AnnListItem
instance Data.Default.Class.Default GHC.Parser.Annotation.AnnPragma
instance GHC.Base.Semigroup GHC.Hs.ImpExp.EpAnnImportDecl
instance Data.Default.Class.Default GHC.Hs.ImpExp.EpAnnImportDecl
instance Data.Default.Class.Default GHC.Hs.Decls.HsRuleAnn
instance Data.Default.Class.Default GHC.Hs.Binds.AnnSig
instance Data.Default.Class.Default GHC.Hs.Expr.GrhsAnn
instance Data.Default.Class.Default GHC.Hs.Expr.EpAnnUnboundVar
instance Data.Default.Class.Default GHC.Parser.Annotation.NoEpAnns
instance Data.Default.Class.Default GHC.Parser.Annotation.AnnParen
instance Data.Default.Class.Default GHC.Hs.Expr.AnnExplicitSum
instance Data.Default.Class.Default GHC.Hs.Expr.EpAnnHsCase
instance Data.Default.Class.Default GHC.Hs.Expr.AnnsIf
instance Data.Default.Class.Default GHC.Hs.Expr.AnnProjection
instance Data.Default.Class.Default GHC.Hs.Expr.AnnFieldLabel
instance Data.Default.Class.Default GHC.Parser.Annotation.EpaLocation
instance Data.Default.Class.Default GHC.Parser.Annotation.AddEpAnn
instance Data.Default.Class.Default GHC.Parser.Annotation.AnnKeywordId
instance Data.Default.Class.Default GHC.Parser.Annotation.AnnContext
instance Data.Default.Class.Default GHC.Hs.Pat.EpAnnSumPat
instance Data.Default.Class.Default GHC.Hs.AnnsModule

module Language.Haskell.GHC.ExactPrint.Types
type Pos = (Int, Int)
data Rigidity
NormalLayout :: Rigidity
RigidLayout :: Rigidity

-- | A Haskell comment. The AnnKeywordId is present if it has been
--   converted from an AnnKeywordId because the annotation must be
--   interleaved into the stream and does not have a well-defined position
data Comment
Comment :: !String -> !Anchor -> !RealSrcSpan -> !Maybe AnnKeywordId -> Comment

-- | The contents of the comment including separators
[commentContents] :: Comment -> !String
[commentAnchor] :: Comment -> !Anchor
[commentPriorTok] :: Comment -> !RealSrcSpan

-- | We sometimes turn syntax into comments in order to process them
--   properly.
[commentOrigin] :: Comment -> !Maybe AnnKeywordId

-- | Marks the start column of a layout block.
newtype LayoutStartCol
LayoutStartCol :: Int -> LayoutStartCol
[getLayoutStartCol] :: LayoutStartCol -> Int
showGhc :: Outputable a => a -> String
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.Types.Rigidity
instance GHC.Classes.Ord Language.Haskell.GHC.ExactPrint.Types.Rigidity
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.Types.Rigidity
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.Types.Comment
instance Data.Data.Data Language.Haskell.GHC.ExactPrint.Types.Comment
instance GHC.Num.Num Language.Haskell.GHC.ExactPrint.Types.LayoutStartCol
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.Types.LayoutStartCol
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.Types.LayoutStartCol
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.Types.Comment
instance GHC.Classes.Ord Language.Haskell.GHC.ExactPrint.Types.Comment
instance GHC.Utils.Outputable.Outputable Language.Haskell.GHC.ExactPrint.Types.Comment

module Language.Haskell.GHC.ExactPrint.Lookup

-- | Maps AnnKeywordId to the corresponding String representation.
--   There is no specific mapping for the following constructors.
--   AnnOpen, AnnClose, AnnVal, AnnPackageName,
--   AnnHeader, AnnFunId, AnnInfix
keywordToString :: AnnKeywordId -> String

-- | Exact print annotations exist so that tools can perform source to
--   source conversions of Haskell code. They are used to keep track of the
--   various syntactic keywords that are not otherwise captured in the AST.
--   
--   The wiki page describing this feature is
--   https://gitlab.haskell.org/ghc/ghc/wikis/api-annotations
--   https://gitlab.haskell.org/ghc/ghc/-/wikis/implementing-trees-that-grow/in-tree-api-annotations
--   
--   Note: in general the names of these are taken from the corresponding
--   token, unless otherwise noted See Note [exact print annotations] above
--   for details of the usage
data () => AnnKeywordId
AnnAnyclass :: AnnKeywordId
AnnAs :: AnnKeywordId
AnnAt :: AnnKeywordId

-- | !
AnnBang :: AnnKeywordId

-- | '`'
AnnBackquote :: AnnKeywordId
AnnBy :: AnnKeywordId

-- | case or lambda case
AnnCase :: AnnKeywordId

-- | lambda cases
AnnCases :: AnnKeywordId
AnnClass :: AnnKeywordId

-- | '#)' or '#-}' etc
AnnClose :: AnnKeywordId

-- | '|)'
AnnCloseB :: AnnKeywordId

-- | '|)', unicode variant
AnnCloseBU :: AnnKeywordId

-- | '}'
AnnCloseC :: AnnKeywordId

-- | '|]'
AnnCloseQ :: AnnKeywordId

-- | '|]', unicode variant
AnnCloseQU :: AnnKeywordId

-- | ')'
AnnCloseP :: AnnKeywordId

-- | '#)'
AnnClosePH :: AnnKeywordId

-- | ']'
AnnCloseS :: AnnKeywordId
AnnColon :: AnnKeywordId

-- | as a list separator
AnnComma :: AnnKeywordId

-- | in a RdrName for a tuple
AnnCommaTuple :: AnnKeywordId

-- | '=>'
AnnDarrow :: AnnKeywordId

-- | '=>', unicode variant
AnnDarrowU :: AnnKeywordId
AnnData :: AnnKeywordId

-- | '::'
AnnDcolon :: AnnKeywordId

-- | '::', unicode variant
AnnDcolonU :: AnnKeywordId
AnnDefault :: AnnKeywordId
AnnDeriving :: AnnKeywordId
AnnDo :: AnnKeywordId

-- | .
AnnDot :: AnnKeywordId

-- | '..'
AnnDotdot :: AnnKeywordId
AnnElse :: AnnKeywordId
AnnEqual :: AnnKeywordId
AnnExport :: AnnKeywordId
AnnFamily :: AnnKeywordId
AnnForall :: AnnKeywordId

-- | Unicode variant
AnnForallU :: AnnKeywordId
AnnForeign :: AnnKeywordId

-- | for function name in matches where there are multiple equations for
--   the function.
AnnFunId :: AnnKeywordId
AnnGroup :: AnnKeywordId

-- | for CType
AnnHeader :: AnnKeywordId
AnnHiding :: AnnKeywordId
AnnIf :: AnnKeywordId
AnnImport :: AnnKeywordId
AnnIn :: AnnKeywordId

-- | 'infix' or 'infixl' or 'infixr'
AnnInfix :: AnnKeywordId
AnnInstance :: AnnKeywordId
AnnLam :: AnnKeywordId

-- | '<-'
AnnLarrow :: AnnKeywordId

-- | '<-', unicode variant
AnnLarrowU :: AnnKeywordId
AnnLet :: AnnKeywordId

-- | The ⊸ unicode arrow
AnnLollyU :: AnnKeywordId
AnnMdo :: AnnKeywordId

-- | -
AnnMinus :: AnnKeywordId
AnnModule :: AnnKeywordId
AnnNewtype :: AnnKeywordId

-- | where a name loses its location in the AST, this carries it
AnnName :: AnnKeywordId
AnnOf :: AnnKeywordId

-- | '{-# DEPRECATED' etc. Opening of pragmas where the capitalisation of
--   the string can be changed by the user. The actual text used is stored
--   in a SourceText on the relevant pragma item.
AnnOpen :: AnnKeywordId

-- | '(|'
AnnOpenB :: AnnKeywordId

-- | '(|', unicode variant
AnnOpenBU :: AnnKeywordId

-- | '{'
AnnOpenC :: AnnKeywordId

-- | '[e|' or '[e||'
AnnOpenE :: AnnKeywordId

-- | '[|'
AnnOpenEQ :: AnnKeywordId

-- | '[|', unicode variant
AnnOpenEQU :: AnnKeywordId

-- | '('
AnnOpenP :: AnnKeywordId

-- | '['
AnnOpenS :: AnnKeywordId

-- | '(#'
AnnOpenPH :: AnnKeywordId

-- | prefix $ -- TemplateHaskell
AnnDollar :: AnnKeywordId

-- | prefix $$ -- TemplateHaskell
AnnDollarDollar :: AnnKeywordId
AnnPackageName :: AnnKeywordId
AnnPattern :: AnnKeywordId

-- | % -- for HsExplicitMult
AnnPercent :: AnnKeywordId

-- | '%1' -- for HsLinearArrow
AnnPercentOne :: AnnKeywordId
AnnProc :: AnnKeywordId
AnnQualified :: AnnKeywordId

-- | ->
AnnRarrow :: AnnKeywordId

-- | ->, unicode variant
AnnRarrowU :: AnnKeywordId
AnnRec :: AnnKeywordId
AnnRole :: AnnKeywordId
AnnSafe :: AnnKeywordId

-- | ';'
AnnSemi :: AnnKeywordId

-- | '''
AnnSimpleQuote :: AnnKeywordId
AnnSignature :: AnnKeywordId

-- | static
AnnStatic :: AnnKeywordId
AnnStock :: AnnKeywordId
AnnThen :: AnnKeywordId

-- | double '''
AnnThTyQuote :: AnnKeywordId

-- | ~
AnnTilde :: AnnKeywordId
AnnType :: AnnKeywordId

-- | () for types
AnnUnit :: AnnKeywordId
AnnUsing :: AnnKeywordId

-- | e.g. INTEGER
AnnVal :: AnnKeywordId

-- | String value, will need quotes when output
AnnValStr :: AnnKeywordId

-- | '|'
AnnVbar :: AnnKeywordId

-- | via
AnnVia :: AnnKeywordId
AnnWhere :: AnnKeywordId

-- | -<
Annlarrowtail :: AnnKeywordId

-- | -<, unicode variant
AnnlarrowtailU :: AnnKeywordId

-- | ->
Annrarrowtail :: AnnKeywordId

-- | ->, unicode variant
AnnrarrowtailU :: AnnKeywordId

-- | -<<
AnnLarrowtail :: AnnKeywordId

-- | -<<, unicode variant
AnnLarrowtailU :: AnnKeywordId

-- | >>-
AnnRarrowtail :: AnnKeywordId

-- | >>-, unicode variant
AnnRarrowtailU :: AnnKeywordId

-- | A Haskell comment. The AnnKeywordId is present if it has been
--   converted from an AnnKeywordId because the annotation must be
--   interleaved into the stream and does not have a well-defined position
data Comment
Comment :: !String -> !Anchor -> !RealSrcSpan -> !Maybe AnnKeywordId -> Comment

-- | The contents of the comment including separators
[commentContents] :: Comment -> !String
[commentAnchor] :: Comment -> !Anchor
[commentPriorTok] :: Comment -> !RealSrcSpan

-- | We sometimes turn syntax into comments in order to process them
--   properly.
[commentOrigin] :: Comment -> !Maybe AnnKeywordId

module Language.Haskell.GHC.ExactPrint.Utils

-- | Global switch to enable debug tracing in ghc-exactprint Delta / Print
debugEnabledFlag :: Bool

-- | Provide a version of trace that comes at the end of the line, so it
--   can easily be commented out when debugging different things.
debug :: c -> String -> c
debugM :: Monad m => String -> m ()
warn :: c -> String -> c

-- | A good delta has no negative values.
isGoodDelta :: DeltaPos -> Bool

-- | Create a delta from the current position to the start of the given
--   RealSrcSpan.
ss2delta :: Pos -> RealSrcSpan -> DeltaPos

-- | create a delta from the end of a current span. The +1 is because the
--   stored position ends up one past the span, this is prior to that
--   adjustment
ss2deltaEnd :: RealSrcSpan -> RealSrcSpan -> DeltaPos

-- | create a delta from the start of a current span. The +1 is because the
--   stored position ends up one past the span, this is prior to that
--   adjustment
ss2deltaStart :: RealSrcSpan -> RealSrcSpan -> DeltaPos

-- | Convert the start of the second Pos to be an offset from the
--   first. The assumption is the reference starts before the second
--   Pos
pos2delta :: Pos -> Pos -> DeltaPos

-- | Apply the delta to the current position, taking into account the
--   current column offset if advancing to a new line
undelta :: Pos -> DeltaPos -> LayoutStartCol -> Pos
undeltaSpan :: RealSrcSpan -> AnnKeywordId -> DeltaPos -> AddEpAnn
adjustDeltaForOffset :: LayoutStartCol -> DeltaPos -> DeltaPos
ss2pos :: RealSrcSpan -> Pos
ss2posEnd :: RealSrcSpan -> Pos
ss2range :: SrcSpan -> (Pos, Pos)
rs2range :: RealSrcSpan -> (Pos, Pos)
rs :: SrcSpan -> RealSrcSpan
range2rs :: (Pos, Pos) -> RealSrcSpan
badRealSrcSpan :: RealSrcSpan
spanLength :: RealSrcSpan -> Int

-- | Checks whether a SrcSpan has zero length.
isPointSrcSpan :: RealSrcSpan -> Bool

-- | Given a list of items and a list of keys, returns a list of items
--   ordered by their position in the list of keys.
orderByKey :: [(RealSrcSpan, a)] -> [RealSrcSpan] -> [(RealSrcSpan, a)]
isGadt :: [LConDecl (GhcPass p)] -> Bool
insertCppComments :: ParsedSource -> [LEpaComment] -> ParsedSource
ghcCommentText :: LEpaComment -> String
tokComment :: LEpaComment -> [Comment]
hsDocStringComments :: Anchor -> RealSrcSpan -> HsDocString -> [Comment]
dedentDocChunk :: LHsDocStringChunk -> LHsDocStringChunk
dedentDocChunkBy :: Int -> LHsDocStringChunk -> LHsDocStringChunk
printDecorator :: HsDocStringDecorator -> String
mkEpaComments :: [Comment] -> [Comment] -> EpAnnComments
comment2LEpaComment :: Comment -> LEpaComment
mkLEpaComment :: String -> Anchor -> RealSrcSpan -> LEpaComment
mkComment :: String -> Anchor -> RealSrcSpan -> Comment
normaliseCommentText :: String -> String

-- | Must compare without span filenames, for CPP injected comments with
--   fake filename
cmpComments :: Comment -> Comment -> Ordering

-- | Sort, comparing without span filenames, for CPP injected comments with
--   fake filename
sortComments :: [Comment] -> [Comment]

-- | Sort, comparing without span filenames, for CPP injected comments with
--   fake filename
sortEpaComments :: [LEpaComment] -> [LEpaComment]

-- | Makes a comment which originates from a specific keyword.
mkKWComment :: AnnKeywordId -> EpaLocation -> Comment

-- | Detects a comment which originates from a specific keyword.
isKWComment :: Comment -> Bool
noKWComments :: [Comment] -> [Comment]
sortAnchorLocated :: [GenLocated Anchor a] -> [GenLocated Anchor a]

-- | Calculates the distance from the start of a string to the end of a
--   string.
dpFromString :: String -> DeltaPos
isSymbolRdrName :: RdrName -> Bool
rdrName2String :: RdrName -> String
name2String :: Name -> String
locatedAnAnchor :: LocatedAn a t -> RealSrcSpan
setAnchorAn :: Default an => LocatedAn an a -> Anchor -> EpAnnComments -> LocatedAn an a
setAnchorEpa :: Default an => EpAnn an -> Anchor -> EpAnnComments -> EpAnn an
setAnchorEpaL :: EpAnn AnnList -> Anchor -> EpAnnComments -> EpAnn AnnList
setAnchorHsModule :: HsModule -> Anchor -> EpAnnComments -> HsModule

-- | Version of l2l that preserves the anchor, immportant if it has an
--   updated AnchorOperation
moveAnchor :: Monoid b => SrcAnn a -> SrcAnn b
trailingAnnLoc :: TrailingAnn -> EpaLocation
setTrailingAnnLoc :: TrailingAnn -> EpaLocation -> TrailingAnn
addEpAnnLoc :: AddEpAnn -> EpaLocation
anchorToEpaLocation :: Anchor -> EpaLocation
hackSrcSpanToAnchor :: SrcSpan -> Anchor
hackAnchorToSrcSpan :: Anchor -> SrcSpan

-- | This module provides support for CPP, interpreter directives and line
--   pragmas.
module Language.Haskell.GHC.ExactPrint.Preprocess

-- | Remove GHC style line pragams ({-# LINE .. #-}) and convert
--   them into comments.
stripLinePragmas :: String -> (String, [LEpaComment])

-- | Replacement for original getRichTokenStream which will return
--   the tokens for a file processed by CPP. See bug
--   http://ghc.haskell.org/trac/ghc/ticket/8265
getCppTokensAsComments :: GhcMonad m => CppOptions -> FilePath -> m [LEpaComment]
getPreprocessedSrcDirect :: GhcMonad m => CppOptions -> FilePath -> m (String, DynFlags)
readFileGhc :: FilePath -> IO String
data CppOptions
CppOptions :: [String] -> [FilePath] -> [FilePath] -> CppOptions

-- | CPP #define macros
[cppDefine] :: CppOptions -> [String]

-- | CPP Includes directory
[cppInclude] :: CppOptions -> [FilePath]

-- | CPP pre-include file
[cppFile] :: CppOptions -> [FilePath]
defaultCppOptions :: CppOptions
showErrorMessages :: ErrorMessages -> String

-- | This module rexposes wrapped parsers from the GHC API. Along with
--   returning the parse result, the corresponding annotations are also
--   returned such that it is then easy to modify the annotations and print
--   the result.
module Language.Haskell.GHC.ExactPrint.Parsers
type Parser a = DynFlags -> FilePath -> String -> ParseResult a
type ParseResult a = Either ErrorMessages a

-- | Provides a safe way to consume a properly initialised set of
--   DynFlags.
--   
--   
--   myParser fname expr = withDynFlags (\d -> parseExpr d fname expr)
--   
withDynFlags :: LibDir -> (DynFlags -> a) -> IO a
data CppOptions
CppOptions :: [String] -> [FilePath] -> [FilePath] -> CppOptions

-- | CPP #define macros
[cppDefine] :: CppOptions -> [String]

-- | CPP Includes directory
[cppInclude] :: CppOptions -> [FilePath]

-- | CPP pre-include file
[cppFile] :: CppOptions -> [FilePath]
defaultCppOptions :: CppOptions
type LibDir = FilePath

-- | This entry point will also work out which language extensions are
--   required and perform CPP processing if necessary.
--   
--   
--   parseModule = parseModuleWithCpp defaultCppOptions
--   
--   
--   Note: ParsedSource is a synonym for Located
--   (HsModule GhcPs)
parseModule :: LibDir -> FilePath -> IO (ParseResult ParsedSource)

-- | This entry point will work out which language extensions are required
--   but will _not_ perform CPP processing. In contrast to
--   parseModoule the input source is read from the provided
--   string; the FilePath parameter solely exists to provide a name
--   in source location annotations.
parseModuleFromString :: LibDir -> FilePath -> String -> IO (ParseResult ParsedSource)
parseModuleWithOptions :: LibDir -> FilePath -> IO (ParseResult ParsedSource)

-- | Parse a module with specific instructions for the C pre-processor.
parseModuleWithCpp :: LibDir -> CppOptions -> FilePath -> IO (ParseResult ParsedSource)
parseExpr :: Parser (LHsExpr GhcPs)
parseImport :: Parser (LImportDecl GhcPs)
parseType :: Parser (LHsType GhcPs)
parseDecl :: Parser (LHsDecl GhcPs)
parsePattern :: Parser (LPat GhcPs)
parseStmt :: Parser (ExprLStmt GhcPs)

-- | Wrapper function which returns Annotations along with the parsed
--   element.
parseWith :: DynFlags -> FilePath -> P w -> String -> ParseResult w

-- | Internal function. Default runner of GHC.Ghc action in IO.
ghcWrapper :: LibDir -> Ghc a -> IO a

-- | Internal function. Initializes DynFlags value for parsing.
--   
--   Passes "-hide-all-packages" to the GHC API to prevent parsing of
--   package environment files. However this only works if there is no
--   invocation of setSessionDynFlags before calling
--   initDynFlags. See ghc tickets #15513, #15541.
initDynFlags :: GhcMonad m => FilePath -> m DynFlags

-- | Requires GhcMonad constraint because there is no pure variant of
--   parseDynamicFilePragma. Yet, in constrast to
--   initDynFlags, it does not (try to) read the file at filepath,
--   but solely depends on the module source in the input string.
--   
--   Passes "-hide-all-packages" to the GHC API to prevent parsing of
--   package environment files. However this only works if there is no
--   invocation of setSessionDynFlags before calling
--   initDynFlagsPure. See ghc tickets #15513, #15541.
initDynFlagsPure :: GhcMonad m => FilePath -> String -> m DynFlags

-- | Internal part of parseModuleFromString.
parseModuleFromStringInternal :: Parser ParsedSource

-- | Low level function which is used in the internal tests. It is advised
--   to use parseModule or parseModuleWithCpp instead of this
--   function.
parseModuleEpAnnsWithCpp :: LibDir -> CppOptions -> FilePath -> IO (Either ErrorMessages ([LEpaComment], DynFlags, ParsedSource))

-- | Internal function. Exposed if you want to muck with DynFlags before
--   parsing.
parseModuleEpAnnsWithCppInternal :: GhcMonad m => CppOptions -> DynFlags -> FilePath -> m (Either ErrorMessages ([LEpaComment], DynFlags, ParsedSource))

-- | Internal function. Exposed if you want to muck with DynFlags before
--   parsing. Or after parsing.
postParseTransform :: Either a ([LEpaComment], DynFlags, ParsedSource) -> Either a ParsedSource

module Language.Haskell.GHC.ExactPrint.Dump

-- | Show a GHC syntax tree. This parameterised because it is also used for
--   comparing ASTs in ppr roundtripping tests, where the SrcSpan's are
--   blanked out, to avoid comparing locations, only structure
showAstData :: Data a => BlankSrcSpan -> BlankEpAnnotations -> a -> SDoc
data BlankSrcSpan
BlankSrcSpan :: BlankSrcSpan
BlankSrcSpanFile :: BlankSrcSpan
NoBlankSrcSpan :: BlankSrcSpan
data BlankEpAnnotations
BlankEpAnnotations :: BlankEpAnnotations
NoBlankEpAnnotations :: BlankEpAnnotations
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.Dump.BlankSrcSpan
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.Dump.BlankSrcSpan
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.Dump.BlankEpAnnotations
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.Dump.BlankEpAnnotations

module Language.Haskell.GHC.ExactPrint.ExactPrint

-- | An AST fragment with an annotation must be able to return the
--   requirements for nesting another one, captured in an Entry, and
--   to be able to use the rest of the exactprint machinery to print the
--   element. In the analogy to Outputable, exact plays the role of
--   ppr.
class (Typeable a) => ExactPrint a
getAnnotationEntry :: ExactPrint a => a -> Entry
setAnnotationAnchor :: ExactPrint a => a -> Anchor -> EpAnnComments -> a
exact :: (ExactPrint a, Monad m, Monoid w) => a -> EP w m a
exactPrint :: ExactPrint ast => ast -> String

-- | The additional option to specify the rigidity and printing
--   configuration.
exactPrintWithOptions :: (ExactPrint ast, Monoid b, Monad m) => EPOptions m b -> ast -> m (ast, b)

-- | Transform concrete annotations into relative annotations which are
--   more useful when transforming an AST. This corresponds to the earlier
--   relativiseApiAnns.
makeDeltaAst :: ExactPrint ast => ast -> ast

-- | The R part of RWS. The environment. Updated via local as we
--   enter a new AST element, having a different anchor point.
data EPOptions m a

-- | Options which can be used to print as a normal String.
stringOptions :: EPOptions Identity String

-- | Helper to create a EPOptions
epOptions :: (forall ast. Data ast => Located ast -> a -> m a) -> (String -> m a) -> (String -> m a) -> Rigidity -> Bool -> EPOptions m a

-- | Options which can be used to simply update the AST to be in delta
--   form, without generating output
deltaOptions :: EPOptions Identity ()
showAst :: Data a => a -> String
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.ExactPrint.FlushComments
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.ExactPrint.FlushComments
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.ExactPrint.CanUpdateAnchor
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.ExactPrint.CanUpdateAnchor
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrintTVFlag ()
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrintTVFlag GHC.Types.Var.Specificity
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrintTVFlag flag => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsTyVarBndr flag GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrintTVFlag flag => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsOuterTyVarBndrs flag GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.InstDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint Language.Haskell.GHC.ExactPrint.ExactPrint.DataFamInstDeclWithContext
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Types.SrcLoc.Located a)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedA a)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns a)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint [a]
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Maybe.Maybe a)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Hs.HsModule
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Unit.Module.Name.ModuleName
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedP (GHC.Unit.Module.Warnings.WarningTxt GHC.Hs.Extension.GhcPs))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Hs.ImpExp.ImportDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Hs.DocString.HsDocString
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Hs.DocString.HsDocStringChunk
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Hs.Doc.WithHsDocIdentifiers a GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.HsDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.DerivDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.ForeignDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint Language.Haskell.Syntax.Decls.ForeignImport
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint Language.Haskell.Syntax.Decls.ForeignExport
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Types.ForeignCall.CExportSpec
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Types.ForeignCall.Safety
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Types.ForeignCall.CCallConv
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.WarnDecls GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.WarnDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Types.SourceText.StringLiteral
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Data.FastString.FastString
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.RuleDecls GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.RuleDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.SpliceDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.DocDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.RoleAnnotDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint GHC.Core.Coercion.Axiom.Role
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.RuleBndr GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint body => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.FamEqn GHC.Hs.Extension.GhcPs body)
instance (Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint tm, Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint ty, GHC.Utils.Outputable.Outputable tm, GHC.Utils.Outputable.Outputable ty) => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsArg tm ty)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.ClsInstDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.TyFamInstDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedP GHC.Types.Basic.OverlapMode)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.HsBind GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.PatSynBind GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.RecordPatSynField GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.Match GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsCmd GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.Match GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.GRHSs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.GRHSs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsCmd GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.HsLocalBinds GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.HsValBindsLR GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.HsIPBinds GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.IPBind GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint Language.Haskell.Syntax.Type.HsIPName
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Binds.Sig GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.StandaloneKindSig GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.DefaultDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.AnnDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Data.BooleanFormula.BooleanFormula (GHC.Parser.Annotation.LocatedN GHC.Types.Name.Reader.RdrName))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint body => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsWildCardBndrs GHC.Hs.Extension.GhcPs body)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.GRHS GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.GRHS GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsCmd GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.HsPragE GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.HsSplice GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.MatchGroup GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.MatchGroup GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsCmd GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint body => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Pat.HsRecFields GHC.Hs.Extension.GhcPs body)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint body => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Pat.HsFieldBind (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns (Language.Haskell.Syntax.Type.FieldOcc GHC.Hs.Extension.GhcPs)) body)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint body => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Pat.HsFieldBind (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns (Language.Haskell.Syntax.Expr.FieldLabelStrings GHC.Hs.Extension.GhcPs)) body)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedA body) => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Pat.HsFieldBind (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns (Language.Haskell.Syntax.Type.AmbiguousFieldOcc GHC.Hs.Extension.GhcPs)) (GHC.Parser.Annotation.LocatedA body))
instance (Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Pat.HsFieldBind (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns (a GHC.Hs.Extension.GhcPs)) body), Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Pat.HsFieldBind (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns (b GHC.Hs.Extension.GhcPs)) body)) => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Data.Either.Either [GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Pat.HsFieldBind (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns (a GHC.Hs.Extension.GhcPs)) body)] [GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Pat.HsFieldBind (GHC.Parser.Annotation.LocatedAn GHC.Parser.Annotation.NoEpAnns (b GHC.Hs.Extension.GhcPs)) body)])
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.FieldLabelStrings GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.DotFieldOcc GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.HsTupArg GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.HsCmdTop GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.HsCmd GHC.Hs.Extension.GhcPs)
instance (Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedA (body GHC.Hs.Extension.GhcPs)), Language.Haskell.Syntax.Extension.Anno (Language.Haskell.Syntax.Expr.StmtLR GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (body GHC.Hs.Extension.GhcPs))) GHC.Types.~ GHC.Parser.Annotation.SrcSpanAnnA, Language.Haskell.Syntax.Extension.Anno [GHC.Types.SrcLoc.GenLocated GHC.Parser.Annotation.SrcSpanAnnA (Language.Haskell.Syntax.Expr.StmtLR GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (body GHC.Hs.Extension.GhcPs)))] GHC.Types.~ GHC.Parser.Annotation.SrcSpanAnnL, Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedL [GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.StmtLR GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (body GHC.Hs.Extension.GhcPs)))])) => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.StmtLR GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (body GHC.Hs.Extension.GhcPs)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.ParStmtBlock GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.TyClDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.FunDep GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.FamilyDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.InjectivityAnn GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsType GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsForAllTelescope GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.HsDerivingClause GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.DerivStrategy GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedC a)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.DerivClauseTys GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsSigType GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedN GHC.Types.Name.Reader.RdrName)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Decls.ConDecl GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint Data.Void.Void
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.ConDeclField GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.FieldOcc GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.AmbiguousFieldOcc GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint a => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsScaled GHC.Hs.Extension.GhcPs a)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedP GHC.Types.ForeignCall.CType)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Types.SourceText.SourceText, GHC.Types.Basic.RuleName)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedL [GHC.Parser.Annotation.LocatedA (GHC.Hs.ImpExp.IE GHC.Hs.Extension.GhcPs)])
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Expr.Match GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA body)) => Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedL [GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.Match GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA body))])
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedL [GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.StmtLR GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs)))])
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedL [GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.StmtLR GHC.Hs.Extension.GhcPs GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsCmd GHC.Hs.Extension.GhcPs)))])
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedL [GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Type.ConDeclField GHC.Hs.Extension.GhcPs)])
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Parser.Annotation.LocatedL (GHC.Data.BooleanFormula.BooleanFormula (GHC.Parser.Annotation.LocatedN GHC.Types.Name.Reader.RdrName)))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Hs.ImpExp.IE GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (GHC.Hs.ImpExp.IEWrappedName GHC.Types.Name.Reader.RdrName)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Pat.Pat GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Type.HsPatSigType GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.ExactPrint (Language.Haskell.Syntax.Lit.HsOverLit GHC.Hs.Extension.GhcPs)
instance Language.Haskell.GHC.ExactPrint.ExactPrint.HasEntry (GHC.Parser.Annotation.SrcSpanAnn' (GHC.Parser.Annotation.EpAnn an))
instance Language.Haskell.GHC.ExactPrint.ExactPrint.HasEntry (GHC.Parser.Annotation.EpAnn a)
instance GHC.Base.Monoid w => GHC.Base.Semigroup (Language.Haskell.GHC.ExactPrint.ExactPrint.EPWriter w)
instance GHC.Base.Monoid w => GHC.Base.Monoid (Language.Haskell.GHC.ExactPrint.ExactPrint.EPWriter w)

-- | This module is currently under heavy development, and no promises are
--   made about API stability. Use with care.
--   
--   We welcome any feedback / contributions on this, as it is the main
--   point of the library.
module Language.Haskell.GHC.ExactPrint.Transform

-- | Monad type for updating the AST and managing the annotations at the
--   same time. The W state is used to generate logging information if
--   required.
type Transform = TransformT Identity

-- | Monad transformer version of Transform monad
newtype TransformT m a
TransformT :: RWST () [String] Int m a -> TransformT m a
[unTransformT] :: TransformT m a -> RWST () [String] Int m a

-- | Change inner monad of TransformT.
hoistTransform :: (forall x. m x -> n x) -> TransformT m a -> TransformT n a

-- | Run a transformation in the Transform monad, returning the
--   updated annotations and any logging generated via logTr
runTransform :: Transform a -> (a, Int, [String])
runTransformT :: TransformT m a -> m (a, Int, [String])

-- | Run a transformation in the Transform monad, returning the
--   updated annotations and any logging generated via logTr,
--   allocating any new SrcSpans from the provided initial value.
runTransformFrom :: Int -> Transform a -> (a, Int, [String])

-- | Run a monad transformer stack for the TransformT monad
--   transformer
runTransformFromT :: Int -> TransformT m a -> m (a, Int, [String])

-- | Log a string to the output of the Monad
logTr :: Monad m => String -> TransformT m ()

-- | Log a representation of the given AST with annotations to the output
--   of the Monad
logDataWithAnnsTr :: Monad m => Data a => String -> a -> TransformT m ()

-- | If we need to add new elements to the AST, they need their own
--   SrcSpan for this.
uniqueSrcSpanT :: Monad m => TransformT m SrcSpan

-- | Used to integrate a Transform into other Monad stacks
class (Monad m) => HasTransform m
liftT :: HasTransform m => Transform a -> m a

-- | Provide a means to get and process the immediate child declartions of
--   a given AST element.
class (Data t) => HasDecls t

-- | Return the HsDecls that are directly enclosed in the given
--   syntax phrase. They are always returned in the wrapped HsDecl
--   form, even if orginating in local decls. This is safe, as annotations
--   never attach to the wrapper, only to the wrapped item.
hsDecls :: (HasDecls t, Monad m) => t -> TransformT m [LHsDecl GhcPs]

-- | Replace the directly enclosed decl list by the given decl list. Runs
--   in the Transform monad to be able to update list order
--   annotations, and rebalance comments and other layout changes as
--   needed.
--   
--   For example, a call on replaceDecls for a wrapped FunBind
--   having no where clause will convert
--   
--   
--   -- |This is a function
--   foo = x -- comment1
--   
--   
--   in to
--   
--   
--   -- |This is a function
--   foo = x -- comment1
--     where
--       nn = 2
--   
replaceDecls :: (HasDecls t, Monad m) => t -> [LHsDecl GhcPs] -> TransformT m t

-- | Extract the immediate declarations for a PatBind. This cannot
--   be a member of HasDecls because a FunBind is not
--   idempotent for hsDecls / replaceDecls.
--   hsDeclsPatBind / replaceDeclsPatBind is idempotent.
hsDeclsPatBind :: Monad m => LHsBind GhcPs -> TransformT m [LHsDecl GhcPs]

-- | Extract the immediate declarations for a PatBind wrapped in a
--   ValD. This cannot be a member of HasDecls because a
--   FunBind is not idempotent for hsDecls /
--   replaceDecls. hsDeclsPatBindD /
--   replaceDeclsPatBindD is idempotent.
hsDeclsPatBindD :: Monad m => LHsDecl GhcPs -> TransformT m [LHsDecl GhcPs]

-- | Replace the immediate declarations for a PatBind. This cannot
--   be a member of HasDecls because a FunBind is not
--   idempotent for hsDecls / replaceDecls.
--   hsDeclsPatBind / replaceDeclsPatBind is idempotent.
replaceDeclsPatBind :: Monad m => LHsBind GhcPs -> [LHsDecl GhcPs] -> TransformT m (LHsBind GhcPs)

-- | Replace the immediate declarations for a PatBind wrapped in a
--   ValD. This cannot be a member of HasDecls because a
--   FunBind is not idempotent for hsDecls /
--   replaceDecls. hsDeclsPatBindD /
--   replaceDeclsPatBindD is idempotent.
replaceDeclsPatBindD :: Monad m => LHsDecl GhcPs -> [LHsDecl GhcPs] -> TransformT m (LHsDecl GhcPs)

-- | Apply a transformation to the decls contained in t
modifyDeclsT :: (HasDecls t, HasTransform m) => ([LHsDecl GhcPs] -> m [LHsDecl GhcPs]) -> t -> m t

-- | Modify a LHsBind wrapped in a ValD. For a PatBind
--   the declarations are extracted and returned after modification. For a
--   FunBind the supplied SrcSpan is used to identify the
--   specific Match to be transformed, for when there are multiple
--   of them.
modifyValD :: forall m t. HasTransform m => SrcSpan -> Decl -> (PMatch -> [Decl] -> m ([Decl], Maybe t)) -> m (Decl, Maybe t)
hsDeclsValBinds :: Monad m => HsLocalBinds GhcPs -> TransformT m [LHsDecl GhcPs]

-- | Utility function for returning decls to HsLocalBinds. Use with
--   care, as this does not manage the declaration order, the ordering
--   should be done by the calling function from the HsLocalBinds
--   context in the AST.
replaceDeclsValbinds :: Monad m => WithWhere -> HsLocalBinds GhcPs -> [LHsDecl GhcPs] -> TransformT m (HsLocalBinds GhcPs)
data WithWhere
WithWhere :: WithWhere
WithoutWhere :: WithWhere

-- | Create a SrcSpanAnn with a MovedAnchor operation
--   using the given DeltaPos.
noAnnSrcSpanDP :: Monoid ann => SrcSpan -> DeltaPos -> SrcSpanAnn' (EpAnn ann)
noAnnSrcSpanDP0 :: Monoid ann => SrcSpan -> SrcSpanAnn' (EpAnn ann)
noAnnSrcSpanDP1 :: Monoid ann => SrcSpan -> SrcSpanAnn' (EpAnn ann)
noAnnSrcSpanDPn :: Monoid ann => SrcSpan -> Int -> SrcSpanAnn' (EpAnn ann)
d0 :: EpaLocation
d1 :: EpaLocation
dn :: Int -> EpaLocation
m0 :: AnchorOperation
m1 :: AnchorOperation
mn :: Int -> AnchorOperation
addComma :: SrcSpanAnnA -> SrcSpanAnnA

-- | Insert a declaration into an AST element having sub-declarations
--   (HasDecls) according to the given location function.
insertAt :: HasDecls ast => (LHsDecl GhcPs -> [LHsDecl GhcPs] -> [LHsDecl GhcPs]) -> ast -> LHsDecl GhcPs -> Transform ast

-- | Insert a declaration at the beginning or end of the subdecls of the
--   given AST item
insertAtStart :: HasDecls ast => ast -> LHsDecl GhcPs -> Transform ast

-- | Insert a declaration at the beginning or end of the subdecls of the
--   given AST item
insertAtEnd :: HasDecls ast => ast -> LHsDecl GhcPs -> Transform ast

-- | Insert a declaration at a specific location in the subdecls of the
--   given AST item
insertAfter :: HasDecls (LocatedA ast) => LocatedA old -> LocatedA ast -> LHsDecl GhcPs -> Transform (LocatedA ast)

-- | Insert a declaration at a specific location in the subdecls of the
--   given AST item
insertBefore :: HasDecls (LocatedA ast) => LocatedA old -> LocatedA ast -> LHsDecl GhcPs -> Transform (LocatedA ast)

-- | The GHC parser puts all comments appearing between the end of one AST
--   item and the beginning of the next as annPriorComments for
--   the second one. This function takes two adjacent AST items and moves
--   any annPriorComments from the second one to the
--   annFollowingComments of the first if they belong to it
--   instead. This is typically required before deleting or duplicating
--   either of the AST elements.
balanceComments :: Monad m => LHsDecl GhcPs -> LHsDecl GhcPs -> TransformT m (LHsDecl GhcPs, LHsDecl GhcPs)
balanceCommentsList :: Monad m => [LHsDecl GhcPs] -> TransformT m [LHsDecl GhcPs]
balanceCommentsList' :: Monad m => [LocatedA a] -> TransformT m [LocatedA a]
anchorEof :: ParsedSource -> ParsedSource

-- | If a list has been re-ordered or had items added, capture the new
--   order in the appropriate AnnSortKey attached to the
--   Annotation for the list.
captureOrder :: [LocatedA b] -> AnnSortKey
captureLineSpacing :: Default t => [LocatedAn t e] -> [LocatedAn t e]
captureMatchLineSpacing :: LHsDecl GhcPs -> LHsDecl GhcPs
captureTypeSigSpacing :: LHsDecl GhcPs -> LHsDecl GhcPs

-- | Test whether a given SrcSpan was generated by
--   uniqueSrcSpanT
isUniqueSrcSpan :: SrcSpan -> Bool

-- | Set the true entry DeltaPos from the annotation for a given AST
--   element. This is the DeltaPos ignoring any comments.
setEntryDP :: Default t => LocatedAn t a -> DeltaPos -> LocatedAn t a
getEntryDP :: LocatedAn t a -> DeltaPos

-- | Take the annEntryDelta associated with the first item and associate it
--   with the second. Also transfer any comments occuring before it.
transferEntryDP :: (Monad m, Monoid t2, Typeable t1, Typeable t2) => LocatedAn t1 a -> LocatedAn t2 b -> TransformT m (LocatedAn t2 b)

-- | Take the annEntryDelta associated with the first item and associate it
--   with the second. Also transfer any comments occuring before it. TODO:
--   call transferEntryDP, and use pushDeclDP
transferEntryDP' :: Monad m => LHsDecl GhcPs -> LHsDecl GhcPs -> TransformT m (LHsDecl GhcPs)

-- | Convert a LSig into a LHsDecl
wrapSig :: LSig GhcPs -> LHsDecl GhcPs

-- | Convert a LHsBind into a LHsDecl
wrapDecl :: LHsBind GhcPs -> LHsDecl GhcPs

-- | Pure function to convert a LSig to a LHsBind. This does
--   nothing to any annotations that may be attached to either of the
--   elements. It is used as a utility function in replaceDecls
decl2Sig :: LHsDecl GhcPs -> [LSig GhcPs]

-- | Pure function to convert a LHsDecl to a LHsBind. This
--   does nothing to any annotations that may be attached to either of the
--   elements. It is used as a utility function in replaceDecls
decl2Bind :: LHsDecl GhcPs -> [LHsBind GhcPs]
instance Control.Monad.Trans.Class.MonadTrans Language.Haskell.GHC.ExactPrint.Transform.TransformT
instance GHC.Base.Monad m => Control.Monad.State.Class.MonadState GHC.Types.Int (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)
instance GHC.Base.Monad m => Control.Monad.Writer.Class.MonadWriter [GHC.Base.String] (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)
instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader () (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)
instance GHC.Base.Functor m => GHC.Base.Functor (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)
instance GHC.Base.Monad m => GHC.Base.Applicative (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)
instance GHC.Base.Monad m => GHC.Base.Monad (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)
instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.Transform.WithWhere
instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.Transform.WithWhere
instance GHC.Base.Monad m => Language.Haskell.GHC.ExactPrint.Transform.HasTransform (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)
instance Language.Haskell.GHC.ExactPrint.Transform.HasDecls (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.Match GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs))))
instance Language.Haskell.GHC.ExactPrint.Transform.HasDecls (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs))
instance Language.Haskell.GHC.ExactPrint.Transform.HasDecls (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.Stmt GHC.Hs.Extension.GhcPs (GHC.Parser.Annotation.LocatedA (Language.Haskell.Syntax.Expr.HsExpr GHC.Hs.Extension.GhcPs))))
instance Language.Haskell.GHC.ExactPrint.Transform.HasDecls GHC.ParsedSource
instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Language.Haskell.GHC.ExactPrint.Transform.TransformT m)

-- | ghc-exactprint is a library to manage manipulating Haskell
--   source files. There are four components.
module Language.Haskell.GHC.ExactPrint

-- | A Haskell comment. The AnnKeywordId is present if it has been
--   converted from an AnnKeywordId because the annotation must be
--   interleaved into the stream and does not have a well-defined position
data Comment

-- | This entry point will also work out which language extensions are
--   required and perform CPP processing if necessary.
--   
--   
--   parseModule = parseModuleWithCpp defaultCppOptions
--   
--   
--   Note: ParsedSource is a synonym for Located
--   (HsModule GhcPs)
parseModule :: LibDir -> FilePath -> IO (ParseResult ParsedSource)

-- | An AST fragment with an annotation must be able to return the
--   requirements for nesting another one, captured in an Entry, and
--   to be able to use the rest of the exactprint machinery to print the
--   element. In the analogy to Outputable, exact plays the role of
--   ppr.
class (Typeable a) => ExactPrint a
getAnnotationEntry :: ExactPrint a => a -> Entry
setAnnotationAnchor :: ExactPrint a => a -> Anchor -> EpAnnComments -> a
exact :: (ExactPrint a, Monad m, Monoid w) => a -> EP w m a
exactPrint :: ExactPrint ast => ast -> String

-- | Transform concrete annotations into relative annotations which are
--   more useful when transforming an AST. This corresponds to the earlier
--   relativiseApiAnns.
makeDeltaAst :: ExactPrint ast => ast -> ast
showAst :: Data a => a -> String

-- | Show a GHC syntax tree. This parameterised because it is also used for
--   comparing ASTs in ppr roundtripping tests, where the SrcSpan's are
--   blanked out, to avoid comparing locations, only structure
showAstData :: Data a => BlankSrcSpan -> BlankEpAnnotations -> a -> SDoc
data BlankSrcSpan
BlankSrcSpan :: BlankSrcSpan
BlankSrcSpanFile :: BlankSrcSpan
NoBlankSrcSpan :: BlankSrcSpan
data BlankEpAnnotations
BlankEpAnnotations :: BlankEpAnnotations
NoBlankEpAnnotations :: BlankEpAnnotations
