-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Trace the call graph of a program
--
-- A plugin that instruments a program so that running it produces a log
-- which can be processed into a visual graph using
-- graph-trace-viz.
--
-- See the README for details.
@package graph-trace
@version 0.1.0.2
module Graph.Trace.Internal.GhcFacade
-- | Monads having fixed points with a 'knot-tying' semantics. Instances of
-- MonadFix should satisfy the following laws:
--
--
-- - Purity mfix (return . h) = return
-- (fix h)
-- - Left shrinking (or Tightening) mfix (\x -> a
-- >>= \y -> f x y) = a >>= \y -> mfix (\x ->
-- f x y)
-- - Sliding mfix (liftM h . f) = liftM
-- h (mfix (f . h)), for strict h.
-- - Nesting mfix (\x -> mfix (\y -> f x
-- y)) = mfix (\x -> f x x)
--
--
-- This class is used in the translation of the recursive do
-- notation supported by GHC and Hugs.
class Monad m => MonadFix (m :: Type -> Type)
-- | The fixed point of a monadic computation. mfix f
-- executes the action f only once, with the eventual output fed
-- back as the input. Hence f should not be strict, for then
-- mfix f would diverge.
mfix :: MonadFix m => (a -> m a) -> m a
-- | A functor with application, providing operations to
--
--
-- - embed pure expressions (pure), and
-- - sequence computations and combine their results (<*>
-- and liftA2).
--
--
-- A minimal complete definition must include implementations of
-- pure and of either <*> or liftA2. If it
-- defines both, then they must behave the same as their default
-- definitions:
--
--
-- (<*>) = liftA2 id
--
--
--
-- liftA2 f x y = f <$> x <*> y
--
--
-- Further, any definition must satisfy the following:
--
--
--
-- The other methods have the following default definitions, which may be
-- overridden with equivalent specialized implementations:
--
--
--
-- As a consequence of these laws, the Functor instance for
-- f will satisfy
--
--
--
-- It may be useful to note that supposing
--
--
-- forall x y. p (q x y) = f x . g y
--
--
-- it follows from the above that
--
--
-- liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v
--
--
-- If f is also a Monad, it should satisfy
--
--
--
-- (which implies that pure and <*> satisfy the
-- applicative functor laws).
class Functor f => Applicative (f :: Type -> Type)
-- | Lift a value.
pure :: Applicative f => a -> f a
-- | Sequential application.
--
-- A few functors support an implementation of <*> that is
-- more efficient than the default one.
--
-- Example
--
-- Used in combination with (<$>),
-- (<*>) can be used to build a record.
--
--
-- >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
--
--
--
-- >>> produceFoo :: Applicative f => f Foo
--
--
--
-- >>> produceBar :: Applicative f => f Bar
--
-- >>> produceBaz :: Applicative f => f Baz
--
--
--
-- >>> mkState :: Applicative f => f MyState
--
-- >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
--
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
-- | Lift a binary function to actions.
--
-- Some functors support an implementation of liftA2 that is more
-- efficient than the default one. In particular, if fmap is an
-- expensive operation, it is likely better to use liftA2 than to
-- fmap over the structure and then use <*>.
--
-- This became a typeclass method in 4.10.0.0. Prior to that, it was a
-- function defined in terms of <*> and fmap.
--
-- Example
--
--
-- >>> liftA2 (,) (Just 3) (Just 5)
-- Just (3,5)
--
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
-- | Sequence actions, discarding the value of the first argument.
--
-- Examples
--
-- If used in conjunction with the Applicative instance for Maybe,
-- you can chain Maybe computations, with a possible "early return" in
-- case of Nothing.
--
--
-- >>> Just 2 *> Just 3
-- Just 3
--
--
--
-- >>> Nothing *> Just 3
-- Nothing
--
--
-- Of course a more interesting use case would be to have effectful
-- computations instead of just returning pure values.
--
--
-- >>> import Data.Char
--
-- >>> import Text.ParserCombinators.ReadP
--
-- >>> let p = string "my name is " *> munch1 isAlpha <* eof
--
-- >>> readP_to_S p "my name is Simon"
-- [("Simon","")]
--
(*>) :: Applicative f => f a -> f b -> f b
-- | Sequence actions, discarding the value of the second argument.
(<*) :: Applicative f => f a -> f b -> f a
infixl 4 <*
infixl 4 *>
infixl 4 <*>
-- | Plugin is the compiler plugin data type. Try to avoid
-- constructing one of these directly, and just modify some fields of
-- defaultPlugin instead: this is to try and preserve source-code
-- compatibility when we add fields to this.
--
-- Nonetheless, this API is preliminary and highly likely to change in
-- the future.
data Plugin
Plugin :: CorePlugin -> TcPlugin -> HoleFitPlugin -> ([CommandLineOption] -> HscEnv -> IO HscEnv) -> ([CommandLineOption] -> IO PluginRecompile) -> ([CommandLineOption] -> ModSummary -> HsParsedModule -> Hsc HsParsedModule) -> ([CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)) -> ([CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv) -> ([CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc)) -> (forall lcl. () => [CommandLineOption] -> ModIface -> IfM lcl ModIface) -> Plugin
-- | Modify the Core pipeline that will be used for compilation. This is
-- called as the Core pipeline is built for every module being compiled,
-- and plugins get the opportunity to modify the pipeline in a
-- nondeterministic order.
[installCoreToDos] :: Plugin -> CorePlugin
-- | An optional typechecker plugin, which may modify the behaviour of the
-- constraint solver.
[tcPlugin] :: Plugin -> TcPlugin
-- | An optional plugin to handle hole fits, which may re-order or change
-- the list of valid hole fits and refinement hole fits.
[holeFitPlugin] :: Plugin -> HoleFitPlugin
-- | An optional plugin to update HscEnv, right after plugin
-- loading. This can be used to register hooks or tweak any field of
-- DynFlags before doing actual work on a module.
[driverPlugin] :: Plugin -> [CommandLineOption] -> HscEnv -> IO HscEnv
-- | Specify how the plugin should affect recompilation.
[pluginRecompile] :: Plugin -> [CommandLineOption] -> IO PluginRecompile
-- | Modify the module when it is parsed. This is called by
-- GHC.Driver.Main when the parsing is successful.
[parsedResultAction] :: Plugin -> [CommandLineOption] -> ModSummary -> HsParsedModule -> Hsc HsParsedModule
-- | Modify each group after it is renamed. This is called after each
-- HsGroup has been renamed.
[renamedResultAction] :: Plugin -> [CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)
-- | Modify the module when it is type checked. This is called at the very
-- end of typechecking.
[typeCheckResultAction] :: Plugin -> [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv
-- | Modify the TH splice or quasiqoute before it is run.
[spliceRunAction] :: Plugin -> [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc)
-- | Modify an interface that have been loaded. This is called by
-- GHC.Iface.Load when an interface is successfully loaded. Not
-- applied to the loading of the plugin interface. Tools that rely on
-- information from modules other than the currently compiled one should
-- implement this function.
[interfaceLoadAction] :: Plugin -> forall lcl. () => [CommandLineOption] -> ModIface -> IfM lcl ModIface
data FrontendPlugin
FrontendPlugin :: FrontendPluginAction -> FrontendPlugin
[frontend] :: FrontendPlugin -> FrontendPluginAction
-- | Monads in which IO computations may be embedded. Any monad
-- built by applying a sequence of monad transformers to the IO
-- monad will be an instance of this class.
--
-- Instances should satisfy the following laws, which state that
-- liftIO is a transformer of monads:
--
--
class Monad m => MonadIO (m :: Type -> Type)
-- | Lift a computation from the IO monad. This allows us to run IO
-- computations in any monadic stack, so long as it supports these kinds
-- of operations (i.e. IO is the base monad for the stack).
--
-- Example
--
--
-- import Control.Monad.Trans.State -- from the "transformers" library
--
-- printState :: Show s => StateT s IO ()
-- printState = do
-- state <- get
-- liftIO $ print state
--
--
-- Had we omitted liftIO, we would have ended up with
-- this error:
--
--
-- • Couldn't match type ‘IO’ with ‘StateT s IO’
-- Expected type: StateT s IO ()
-- Actual type: IO ()
--
--
-- The important part here is the mismatch between StateT s IO
-- () and IO ().
--
-- Luckily, we know of a function that takes an IO a and
-- returns an (m a): liftIO, enabling us to run
-- the program and see the expected results:
--
--
-- > evalStateT printState "hello"
-- "hello"
--
-- > evalStateT printState 3
-- 3
--
liftIO :: MonadIO m => IO a -> m a
-- | The mapAndUnzipM function maps its first argument over a list,
-- returning the result as a pair of lists. This function is mainly used
-- with complicated data structures or a state monad.
mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
-- | A mutable variable in the IO monad
data IORef a
-- | Right-to-left monadic fold over the elements of a structure.
--
-- Given a structure t with elements (a, b, c, ..., x,
-- y), the result of a fold with an operator function f is
-- equivalent to:
--
--
-- foldrM f z t = do
-- yy <- f y z
-- xx <- f x yy
-- ...
-- bb <- f b cc
-- aa <- f a bb
-- return aa -- Just @return z@ when the structure is empty
--
--
-- For a Monad m, given two functions f1 :: a -> m b
-- and f2 :: b -> m c, their Kleisli composition (f1
-- >=> f2) :: a -> m c is defined by:
--
--
-- (f1 >=> f2) a = f1 a >>= f2
--
--
-- Another way of thinking about foldrM is that it amounts to an
-- application to z of a Kleisli composition:
--
--
-- foldrM f z t = f y >=> f x >=> ... >=> f b >=> f a $ z
--
--
-- The monadic effects of foldrM are sequenced from right to
-- left, and e.g. folds of infinite lists will diverge.
--
-- If at some step the bind operator (>>=)
-- short-circuits (as with, e.g., mzero in a MonadPlus),
-- the evaluated effects will be from a tail of the element sequence. If
-- you want to evaluate the monadic effects in left-to-right order, or
-- perhaps be able to short-circuit after an initial sequence of
-- elements, you'll need to use foldlM instead.
--
-- If the monadic effects don't short-circuit, the outermost application
-- of f is to the leftmost element a, so that, ignoring
-- effects, the result looks like a right fold:
--
--
-- a `f` (b `f` (c `f` (... (x `f` (y `f` z))))).
--
--
-- Examples
--
-- Basic usage:
--
--
-- >>> let f i acc = do { print i ; return $ i : acc }
--
-- >>> foldrM f [] [0..3]
-- 3
-- 2
-- 1
-- 0
-- [0,1,2,3]
--
foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b
-- | Left-to-right monadic fold over the elements of a structure.
--
-- Given a structure t with elements (a, b, ..., w, x,
-- y), the result of a fold with an operator function f is
-- equivalent to:
--
--
-- foldlM f z t = do
-- aa <- f z a
-- bb <- f aa b
-- ...
-- xx <- f ww x
-- yy <- f xx y
-- return yy -- Just @return z@ when the structure is empty
--
--
-- For a Monad m, given two functions f1 :: a -> m b
-- and f2 :: b -> m c, their Kleisli composition (f1
-- >=> f2) :: a -> m c is defined by:
--
--
-- (f1 >=> f2) a = f1 a >>= f2
--
--
-- Another way of thinking about foldlM is that it amounts to an
-- application to z of a Kleisli composition:
--
--
-- foldlM f z t =
-- flip f a >=> flip f b >=> ... >=> flip f x >=> flip f y $ z
--
--
-- The monadic effects of foldlM are sequenced from left to
-- right.
--
-- If at some step the bind operator (>>=)
-- short-circuits (as with, e.g., mzero in a MonadPlus),
-- the evaluated effects will be from an initial segment of the element
-- sequence. If you want to evaluate the monadic effects in right-to-left
-- order, or perhaps be able to short-circuit after processing a tail of
-- the sequence of elements, you'll need to use foldrM instead.
--
-- If the monadic effects don't short-circuit, the outermost application
-- of f is to the rightmost element y, so that,
-- ignoring effects, the result looks like a left fold:
--
--
-- ((((z `f` a) `f` b) ... `f` w) `f` x) `f` y
--
--
-- Examples
--
-- Basic usage:
--
--
-- >>> let f a e = do { print e ; return $ e : a }
--
-- >>> foldlM f [] [0..3]
-- 0
-- 1
-- 2
-- 3
-- [3,2,1,0]
--
foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
-- | An infix synonym for fmap.
--
-- The name of this operator is an allusion to $. Note the
-- similarities between their types:
--
--
-- ($) :: (a -> b) -> a -> b
-- (<$>) :: Functor f => (a -> b) -> f a -> f b
--
--
-- Whereas $ is function application, <$> is function
-- application lifted over a Functor.
--
-- Examples
--
-- Convert from a Maybe Int to a Maybe
-- String using show:
--
--
-- >>> show <$> Nothing
-- Nothing
--
-- >>> show <$> Just 3
-- Just "3"
--
--
-- Convert from an Either Int Int to an
-- Either Int String using show:
--
--
-- >>> show <$> Left 17
-- Left 17
--
-- >>> show <$> Right 17
-- Right "17"
--
--
-- Double each element of a list:
--
--
-- >>> (*2) <$> [1,2,3]
-- [2,4,6]
--
--
-- Apply even to the second element of a pair:
--
--
-- >>> even <$> (2,2)
-- (2,True)
--
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>
-- | The language extensions known to GHC.
--
-- Note that there is an orphan Binary instance for this type
-- supplied by the GHC.LanguageExtensions module provided by
-- ghc-boot. We can't provide here as this would require adding
-- transitive dependencies to the template-haskell package,
-- which must have a minimal dependency set.
data Extension
Cpp :: Extension
OverlappingInstances :: Extension
UndecidableInstances :: Extension
IncoherentInstances :: Extension
UndecidableSuperClasses :: Extension
MonomorphismRestriction :: Extension
MonoLocalBinds :: Extension
DeepSubsumption :: Extension
RelaxedPolyRec :: Extension
ExtendedDefaultRules :: Extension
ForeignFunctionInterface :: Extension
UnliftedFFITypes :: Extension
InterruptibleFFI :: Extension
CApiFFI :: Extension
GHCForeignImportPrim :: Extension
JavaScriptFFI :: Extension
ParallelArrays :: Extension
Arrows :: Extension
TemplateHaskell :: Extension
TemplateHaskellQuotes :: Extension
QualifiedDo :: Extension
QuasiQuotes :: Extension
ImplicitParams :: Extension
ImplicitPrelude :: Extension
ScopedTypeVariables :: Extension
AllowAmbiguousTypes :: Extension
UnboxedTuples :: Extension
UnboxedSums :: Extension
UnliftedNewtypes :: Extension
UnliftedDatatypes :: Extension
BangPatterns :: Extension
TypeFamilies :: Extension
TypeFamilyDependencies :: Extension
TypeInType :: Extension
OverloadedStrings :: Extension
OverloadedLists :: Extension
NumDecimals :: Extension
DisambiguateRecordFields :: Extension
RecordWildCards :: Extension
RecordPuns :: Extension
ViewPatterns :: Extension
GADTs :: Extension
GADTSyntax :: Extension
NPlusKPatterns :: Extension
DoAndIfThenElse :: Extension
BlockArguments :: Extension
RebindableSyntax :: Extension
ConstraintKinds :: Extension
PolyKinds :: Extension
DataKinds :: Extension
InstanceSigs :: Extension
ApplicativeDo :: Extension
LinearTypes :: Extension
StandaloneDeriving :: Extension
DeriveDataTypeable :: Extension
AutoDeriveTypeable :: Extension
DeriveFunctor :: Extension
DeriveTraversable :: Extension
DeriveFoldable :: Extension
DeriveGeneric :: Extension
DefaultSignatures :: Extension
DeriveAnyClass :: Extension
DeriveLift :: Extension
DerivingStrategies :: Extension
DerivingVia :: Extension
TypeSynonymInstances :: Extension
FlexibleContexts :: Extension
FlexibleInstances :: Extension
ConstrainedClassMethods :: Extension
MultiParamTypeClasses :: Extension
NullaryTypeClasses :: Extension
FunctionalDependencies :: Extension
ExistentialQuantification :: Extension
MagicHash :: Extension
EmptyDataDecls :: Extension
KindSignatures :: Extension
RoleAnnotations :: Extension
ParallelListComp :: Extension
TransformListComp :: Extension
MonadComprehensions :: Extension
GeneralizedNewtypeDeriving :: Extension
RecursiveDo :: Extension
PostfixOperators :: Extension
TupleSections :: Extension
PatternGuards :: Extension
LiberalTypeSynonyms :: Extension
RankNTypes :: Extension
ImpredicativeTypes :: Extension
TypeOperators :: Extension
ExplicitNamespaces :: Extension
PackageImports :: Extension
ExplicitForAll :: Extension
AlternativeLayoutRule :: Extension
AlternativeLayoutRuleTransitional :: Extension
DatatypeContexts :: Extension
NondecreasingIndentation :: Extension
RelaxedLayout :: Extension
TraditionalRecordSyntax :: Extension
LambdaCase :: Extension
MultiWayIf :: Extension
BinaryLiterals :: Extension
NegativeLiterals :: Extension
HexFloatLiterals :: Extension
DuplicateRecordFields :: Extension
OverloadedLabels :: Extension
EmptyCase :: Extension
PatternSynonyms :: Extension
PartialTypeSignatures :: Extension
NamedWildCards :: Extension
StaticPointers :: Extension
TypeApplications :: Extension
Strict :: Extension
StrictData :: Extension
EmptyDataDeriving :: Extension
NumericUnderscores :: Extension
QuantifiedConstraints :: Extension
StarIsType :: Extension
ImportQualifiedPost :: Extension
CUSKs :: Extension
StandaloneKindSignatures :: Extension
LexicalNegation :: Extension
FieldSelectors :: Extension
OverloadedRecordDot :: Extension
OverloadedRecordUpdate :: Extension
data PluginWithArgs
PluginWithArgs :: Plugin -> [CommandLineOption] -> PluginWithArgs
-- | the actual callable plugin
[paPlugin] :: PluginWithArgs -> Plugin
-- | command line arguments for the plugin
[paArguments] :: PluginWithArgs -> [CommandLineOption]
data PluginRecompile
ForceRecompile :: PluginRecompile
NoForceRecompile :: PluginRecompile
MaybeRecompile :: Fingerprint -> PluginRecompile
type FrontendPluginAction = [String] -> [(String, Maybe Phase)] -> Ghc ()
type CorePlugin = [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
-- | Command line options gathered from the -PModule.Name:stuff syntax are
-- given to you as this type
type CommandLineOption = String
-- | Perform a constant operation by using all of the plugins in turn.
withPlugins_ :: Monad m => HscEnv -> ConstPluginOperation m a -> a -> m ()
-- | Perform an operation by using all of the plugins in turn.
withPlugins :: Monad m => HscEnv -> PluginOperation m a -> a -> m a
purePlugin :: [CommandLineOption] -> IO PluginRecompile
plugins :: HscEnv -> [PluginWithArgs]
pluginRecompile' :: PluginWithArgs -> IO PluginRecompile
mapPlugins :: HscEnv -> (Plugin -> [CommandLineOption] -> a) -> [a]
lpModuleName :: LoadedPlugin -> ModuleName
-- | A renamer plugin which mades the renamed source available in a
-- typechecker plugin.
keepRenamedSource :: [CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)
impurePlugin :: [CommandLineOption] -> IO PluginRecompile
flagRecompile :: [CommandLineOption] -> IO PluginRecompile
-- | Default plugin: does nothing at all, except for marking that safe
-- inference has failed unless -fplugin-trustworthy is passed.
-- For compatibility reason you should base all your plugin definitions
-- on this default value.
defaultPlugin :: Plugin
defaultFrontendPlugin :: FrontendPlugin
thRdrNameGuesses :: Name -> [RdrName]
convertToPat :: Origin -> SrcSpan -> Pat -> Either SDoc (LPat GhcPs)
convertToHsType :: Origin -> SrcSpan -> Type -> Either SDoc (LHsType GhcPs)
convertToHsExpr :: Origin -> SrcSpan -> Exp -> Either SDoc (LHsExpr GhcPs)
convertToHsDecls :: Origin -> SrcSpan -> [Dec] -> Either SDoc [LHsDecl GhcPs]
type AnnoBody (body :: Type -> Type) = (Outputable body GhcPs, Anno StmtLR GhcPs GhcPs LocatedA body GhcPs ~ SrcSpanAnnA, Anno StmtLR GhcRn GhcPs LocatedA body GhcPs ~ SrcSpanAnnA, Anno StmtLR GhcRn GhcRn LocatedA body GhcRn ~ SrcSpanAnnA)
-- | Rename some Stmts
rnStmts :: AnnoBody body => HsStmtContext GhcRn -> (body GhcPs -> RnM (body GhcRn, FreeVars)) -> [LStmt GhcPs (LocatedA (body GhcPs))] -> ([Name] -> RnM (thing, FreeVars)) -> RnM (([LStmt GhcRn (LocatedA (body GhcRn))], thing), FreeVars)
rnLExpr :: LHsExpr GhcPs -> RnM (LHsExpr GhcRn, FreeVars)
rnExpr :: HsExpr GhcPs -> RnM (HsExpr GhcRn, FreeVars)
-- | HoleFitPluginR adds a TcRef to hole fit plugins so that plugins can
-- track internal state. Note the existential quantification, ensuring
-- that the state cannot be modified from outside the plugin.
data HoleFitPluginR
-- | A function that atomically updates the name cache given a modifier
-- function. The second result of the modifier function will be the
-- result of the IO action.
newtype NameCacheUpdater
NCU :: (forall c. () => (NameCache -> (NameCache, c)) -> IO c) -> NameCacheUpdater
[updateNameCache] :: NameCacheUpdater -> forall c. () => (NameCache -> (NameCache, c)) -> IO c
updNameCacheTc :: Module -> OccName -> (NameCache -> (NameCache, c)) -> TcRnIf a b c
updNameCache :: IORef NameCache -> (NameCache -> (NameCache, c)) -> IO c
tcIfaceTyVar :: FastString -> IfL TyVar
tcIfaceLclId :: FastString -> IfL Id
-- | Set the Module of a Name.
setNameModule :: Maybe Module -> Name -> TcRnIf m n Name
newInteractiveBinder :: HscEnv -> OccName -> SrcSpan -> IO Name
newIfaceNames :: [OccName] -> IfL [Name]
newIfaceName :: OccName -> IfL Name
newGlobalBinder :: Module -> OccName -> SrcSpan -> TcRnIf a b Name
mkNameCacheUpdater :: TcRnIf a b NameCacheUpdater
lookupOrigIO :: HscEnv -> Module -> OccName -> IO Name
-- | Look up the Name for a given Module and OccName.
-- Consider alternatively using lookupIfaceTop if you're in the
-- IfL monad and Module is simply that of the
-- ModIface_ you are typechecking.
lookupOrig :: Module -> OccName -> TcRnIf a b Name
lookupIfaceVar :: IfaceBndr -> IfL (Maybe TyCoVar)
lookupIfaceTyVar :: IfaceTvBndr -> IfL (Maybe TyVar)
-- | Look up a top-level name from the current Iface module
lookupIfaceTop :: OccName -> IfL Name
ifaceExportNames :: [IfaceExport] -> TcRnIf gbl lcl [AvailInfo]
externaliseName :: Module -> Name -> TcRnIf m n Name
extendIfaceTyVarEnv :: [TyVar] -> IfL a -> IfL a
extendIfaceIdEnv :: [Id] -> IfL a -> IfL a
extendIfaceEnvs :: [TyCoVar] -> IfL a -> IfL a
allocateGlobalBinder :: NameCache -> Module -> OccName -> SrcSpan -> (NameCache, Name)
data IsExtraConstraint
YesExtraConstraint :: IsExtraConstraint
NoExtraConstraint :: IsExtraConstraint
xoptM :: Extension -> TcRnIf gbl lcl Bool
writeTcRef :: TcRef a -> a -> TcRnIf gbl lcl ()
wrapLocSndMA :: (a -> TcM (b, c)) -> LocatedA a -> TcM (b, LocatedA c)
wrapLocSndM :: (a -> TcM (b, c)) -> Located a -> TcM (b, Located c)
wrapLocM_ :: (a -> TcM ()) -> Located a -> TcM ()
wrapLocMA_ :: (a -> TcM ()) -> LocatedA a -> TcM ()
wrapLocMA :: (a -> TcM b) -> GenLocated (SrcSpanAnn' ann) a -> TcRn (GenLocated (SrcSpanAnn' ann) b)
wrapLocM :: (a -> TcM b) -> Located a -> TcM (Located b)
wrapLocFstMA :: (a -> TcM (b, c)) -> LocatedA a -> TcM (LocatedA b, c)
wrapLocFstM :: (a -> TcM (b, c)) -> Located a -> TcM (Located b, c)
wrapLocAM :: (a -> TcM b) -> LocatedAn an a -> TcM (Located b)
woptM :: WarningFlag -> TcRnIf gbl lcl Bool
withoutDynamicNow :: TcRnIf gbl lcl a -> TcRnIf gbl lcl a
-- | A convenient wrapper for taking a MaybeErr SDoc a and
-- throwing an exception if it is an error.
withException :: TcRnIf gbl lcl (MaybeErr SDoc a) -> TcRnIf gbl lcl a
withDynamicNow :: TcRnIf gbl lcl a -> TcRnIf gbl lcl a
whenXOptM :: Extension -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
whenWOptM :: WarningFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
whenNoErrs :: TcM () -> TcM ()
whenGOptM :: GeneralFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
-- | Do it flag is true
whenDOptM :: DumpFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
-- | Display a warning if a condition is met.
warnTcM :: WarnReason -> Bool -> (TidyEnv, SDoc) -> TcM ()
-- | Display a warning if a condition is met.
warnTc :: WarnReason -> Bool -> SDoc -> TcM ()
-- | Display a warning if a condition is met, and the warning is enabled
warnIfFlag :: WarningFlag -> Bool -> SDoc -> TcRn ()
-- | Display a warning if a condition is met.
warnIf :: Bool -> SDoc -> TcRn ()
-- | Update the external package state.
--
-- This is an atomic operation and forces evaluation of the modified EPS
-- in order to avoid space leaks.
updateEps_ :: (ExternalPackageState -> ExternalPackageState) -> TcRnIf gbl lcl ()
-- | Update the external package state. Returns the second result of the
-- modifier function.
--
-- This is an atomic operation and forces evaluation of the modified EPS
-- in order to avoid space leaks.
updateEps :: (ExternalPackageState -> (ExternalPackageState, a)) -> TcRnIf gbl lcl a
updTopEnv :: (HscEnv -> HscEnv) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
updTcRef :: TcRef a -> (a -> a) -> TcRnIf gbl lcl ()
updLclEnv :: (lcl -> lcl) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
updGblEnv :: (gbl -> gbl) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
unsetXOptM :: Extension -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
unsetGOptM :: GeneralFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
unlessXOptM :: Extension -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
tryTcDiscardingErrs :: TcM r -> TcM r -> TcM r
tryTc :: TcRn a -> TcRn (Maybe a, Messages DecoratedSDoc)
tryCaptureConstraints :: TcM a -> TcM (Maybe a, WantedConstraints)
traceTcConstraints :: String -> TcM ()
traceTc :: String -> SDoc -> TcRn ()
traceRn :: String -> SDoc -> TcRn ()
traceOptTcRn :: DumpFlag -> SDoc -> TcRn ()
traceOptIf :: DumpFlag -> SDoc -> TcRnIf m n ()
traceIf :: SDoc -> TcRnIf m n ()
traceHiDiffs :: SDoc -> TcRnIf m n ()
tcSelfBootInfo :: TcRn SelfBootInfo
-- | tcScalingUsage mult thing_inside runs thing_inside
-- and scales all the usage information by mult.
tcScalingUsage :: Mult -> TcM a -> TcM a
tcIsHsig :: TcRn Bool
tcIsHsBootOrSig :: TcRn Bool
tcEmitBindingUsage :: UsageEnv -> TcM ()
-- | tcCollectingUsage thing_inside runs thing_inside and
-- returns the usage information which was collected as part of the
-- execution of thing_inside. Careful: tcCollectingUsage
-- thing_inside itself does not report any usage information, it's
-- up to the caller to incorporate the returned usage information into
-- the larger context appropriately.
tcCollectingUsage :: TcM a -> TcM (UsageEnv, a)
setXOptM :: Extension -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
setTcLevel :: TcLevel -> TcM a -> TcM a
setTcEvBindsMap :: EvBindsVar -> EvBindMap -> TcM ()
setStage :: ThStage -> TcM a -> TcRn a
setSrcSpanA :: SrcSpanAnn' ann -> TcRn a -> TcRn a
setSrcSpan :: SrcSpan -> TcRn a -> TcRn a
setLocalRdrEnv :: LocalRdrEnv -> RnM a -> RnM a
setLclTypeEnv :: TcLclEnv -> TcM a -> TcM a
setLclEnv :: lcl' -> TcRnIf gbl lcl' a -> TcRnIf gbl lcl a
setImplicitEnvM :: TypeEnv -> IfL a -> IfL a
setGblEnv :: gbl -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
setErrsVar :: TcRef (Messages DecoratedSDoc) -> TcRn a -> TcRn a
setErrCtxt :: [ErrCtxt] -> TcM a -> TcM a
setEnvs :: (gbl', lcl') -> TcRnIf gbl' lcl' a -> TcRnIf gbl lcl a
setCtLocM :: CtLoc -> TcM a -> TcM a
setConstraintVar :: TcRef WantedConstraints -> TcM a -> TcM a
reportWarning :: WarnReason -> MsgEnvelope DecoratedSDoc -> TcRn ()
reportErrors :: [MsgEnvelope DecoratedSDoc] -> TcM ()
reportError :: MsgEnvelope DecoratedSDoc -> TcRn ()
recoverM :: TcRn r -> TcRn r -> TcRn r
-- | Mark that safe inference has failed See Note [Safe Haskell Overlapping
-- Instances Implementation] although this is used for more than just
-- that failure case.
recordUnsafeInfer :: WarningMessages -> TcM ()
recordThUse :: TcM ()
recordThSpliceUse :: TcM ()
readTcRef :: TcRef a -> TcRnIf gbl lcl a
pushTcLevelsM :: Int -> TcM a -> TcM (a, TcLevel)
pushTcLevelM_ :: TcM a -> TcM a
pushTcLevelM :: TcM a -> TcM (TcLevel, a)
-- | The name says it all. The returned TcLevel is the *inner* TcLevel.
pushLevelAndCaptureConstraints :: TcM a -> TcM (TcLevel, WantedConstraints, a)
-- | Like logInfoTcRn, but for user consumption
printForUserTcRn :: SDoc -> TcRn ()
popErrCtxt :: TcM a -> TcM a
newUniqueSupply :: TcRnIf gbl lcl UniqSupply
newUnique :: TcRnIf gbl lcl Unique
newTcRef :: a -> TcRnIf gbl lcl (TcRef a)
newTcEvBinds :: TcM EvBindsVar
newSysName :: OccName -> TcRnIf gbl lcl Name
newSysLocalIds :: FastString -> [Scaled TcType] -> TcRnIf gbl lcl [TcId]
newSysLocalId :: FastString -> Mult -> TcType -> TcRnIf gbl lcl TcId
-- | Creates an EvBindsVar incapable of holding any bindings. It still
-- tracks covar usages (see comments on ebv_tcvs in
-- GHC.Tc.Types.Evidence), thus must be made monadically
newNoTcEvBinds :: TcM EvBindsVar
newNameAt :: OccName -> SrcSpan -> TcM Name
newName :: OccName -> TcM Name
newArrowScope :: TcM a -> TcM a
mkLongErrAt :: SrcSpan -> SDoc -> SDoc -> TcRn (MsgEnvelope DecoratedSDoc)
mkIfLclEnv :: Module -> SDoc -> IsBootInterface -> IfLclEnv
mkErrInfo :: TidyEnv -> [ErrCtxt] -> TcM SDoc
mkDecoratedSDocAt :: SrcSpan -> SDoc -> SDoc -> SDoc -> TcRn (MsgEnvelope DecoratedSDoc)
-- | Apply the function to all elements on the input list If all succeed,
-- return the list of results Otherwise fail, propagating all errors
mapAndReportM :: (a -> TcRn b) -> [a] -> TcRn [b]
-- | Drop elements of the input that fail, so the result list can be
-- shorter than the argument list
mapAndRecoverM :: (a -> TcRn b) -> [a] -> TcRn [b]
keepAlive :: Name -> TcRn ()
isTouchableTcM :: TcTyVar -> TcM Bool
-- | Run a TcM action in the context of an existing GblEnv.
initTcWithGbl :: HscEnv -> TcGblEnv -> RealSrcSpan -> TcM r -> IO (Messages DecoratedSDoc, Maybe r)
initTcRnIf :: Char -> HscEnv -> gbl -> lcl -> TcRnIf gbl lcl a -> IO a
initTcInteractive :: HscEnv -> TcM a -> IO (Messages DecoratedSDoc, Maybe a)
-- | Setup the initial typechecking environment
initTc :: HscEnv -> HscSource -> Bool -> Module -> RealSrcSpan -> TcM r -> IO (Messages DecoratedSDoc, Maybe r)
-- | Run an IfG (top-level interface monad) computation inside an
-- existing TcRn (typecheck-renaming monad) computation by
-- initializing an IfGblEnv based on TcGblEnv.
initIfaceTcRn :: IfG a -> TcRn a
initIfaceLoad :: HscEnv -> IfG a -> IO a
-- | Initialize interface typechecking, but with a NameShape to
-- apply when typechecking top-level OccNames (see
-- lookupIfaceTop)
initIfaceLclWithSubst :: Module -> SDoc -> IsBootInterface -> NameShape -> IfL a -> IfM lcl a
initIfaceLcl :: Module -> SDoc -> IsBootInterface -> IfL a -> IfM lcl a
initIfaceCheck :: SDoc -> HscEnv -> IfG a -> IO a
inGeneratedCode :: TcRn Bool
ifErrsM :: TcRn r -> TcRn r -> TcRn r
goptM :: GeneralFlag -> TcRnIf gbl lcl Bool
getTopEnv :: TcRnIf gbl lcl HscEnv
getTcLevel :: TcM TcLevel
getTcEvTyCoVars :: EvBindsVar -> TcM TyCoVarSet
getTcEvBindsMap :: EvBindsVar -> TcM EvBindMap
getStageAndBindLevel :: Name -> TcRn (Maybe (TopLevelFlag, ThLevel, ThStage))
getStage :: TcM ThStage
getSrcSpanM :: TcRn SrcSpan
getRecFieldEnv :: TcRn RecFieldEnv
getRdrEnvs :: TcRn (GlobalRdrEnv, LocalRdrEnv)
getPrintUnqualified :: TcRn PrintUnqualified
getLocalRdrEnv :: RnM LocalRdrEnv
getLclTypeEnv :: TcM TcTypeEnv
getLclEnv :: TcRnIf gbl lcl lcl
getIsGHCi :: TcRn Bool
getInteractivePrintName :: TcRn Name
getImports :: TcRn ImportAvails
getIfModule :: IfL Module
getHpt :: TcRnIf gbl lcl HomePackageTable
getGlobalRdrEnv :: TcRn GlobalRdrEnv
getGhcMode :: TcRnIf gbl lcl GhcMode
getGblEnv :: TcRnIf gbl lcl gbl
getGHCiMonad :: TcRn Name
getFixityEnv :: TcRn FixityEnv
getErrsVar :: TcRn (TcRef (Messages DecoratedSDoc))
getErrCtxt :: TcM [ErrCtxt]
getEpsVar :: TcRnIf gbl lcl (TcRef ExternalPackageState)
getEpsAndHpt :: TcRnIf gbl lcl (ExternalPackageState, HomePackageTable)
getEps :: TcRnIf gbl lcl ExternalPackageState
getEnvs :: TcRnIf gbl lcl (gbl, lcl)
getDeclaredDefaultTys :: TcRn (Maybe [Type])
getCtLocM :: CtOrigin -> Maybe TypeOrKind -> TcM CtLoc
getConstraintVar :: TcM (TcRef WantedConstraints)
-- | See getCCIndexM.
getCCIndexTcM :: FastString -> TcM CostCentreIndex
-- | Get the next cost centre index associated with a given name.
getCCIndexM :: (gbl -> TcRef CostCentreState) -> FastString -> TcRnIf gbl lcl CostCentreIndex
-- | Run thing_inside in an interleaved thread. It shares everything with
-- the parent thread, so this is DANGEROUS.
--
-- It returns Nothing if the computation fails
--
-- It's used for lazily type-checking interface signatures, which is
-- pretty benign.
--
-- See Note [Masking exceptions in forkM_maybe]
forkM_maybe :: SDoc -> IfL a -> IfL (Maybe a)
forkM :: SDoc -> IfL a -> IfL a
-- | The accumulator is not updated if the action fails
foldAndRecoverM :: (b -> a -> TcRn b) -> b -> [a] -> TcRn b
-- | Switch instances to safe instances if we're in Safe mode.
fixSafeInstances :: SafeHaskellMode -> [ClsInst] -> [ClsInst]
-- | Figure out the final correct safe haskell mode
finalSafeMode :: DynFlags -> TcGblEnv -> IO SafeHaskellMode
failWithTcM :: (TidyEnv, SDoc) -> TcM a
failWithTc :: SDoc -> TcM a
failWith :: SDoc -> TcRn a
failIfTcM :: Bool -> (TidyEnv, SDoc) -> TcM ()
failIfTc :: Bool -> SDoc -> TcM ()
failIfM :: SDoc -> IfL a
failIfErrsM :: TcRn ()
failAt :: SrcSpan -> SDoc -> TcRn a
extendFixityEnv :: [(Name, FixItem)] -> RnM a -> RnM a
escapeArrowScope :: TcM a -> TcM a
emitStaticConstraints :: WantedConstraints -> TcM ()
emitSimples :: Cts -> TcM ()
emitSimple :: Ct -> TcM ()
emitNamedTypeHole :: (Name, TcTyVar) -> TcM ()
emitInsoluble :: Ct -> TcM ()
emitImplications :: Bag Implication -> TcM ()
emitImplication :: Implication -> TcM ()
emitHoles :: Bag Hole -> TcM ()
emitHole :: Hole -> TcM ()
emitConstraints :: WantedConstraints -> TcM ()
emitAnonTypeHole :: IsExtraConstraint -> TcTyVar -> TcM ()
-- | Unconditionally dump some trace output
--
-- Certain tests (T3017, Roles3, T12763 etc.) expect part of the output
-- generated by `-ddump-types` to be in PprUser style. However,
-- generally we want all other debugging output to use PprDump
-- style. We PprUser style if useUserStyle is True.
dumpTcRn :: Bool -> DumpFlag -> String -> DumpFormat -> SDoc -> TcRn ()
-- | Dump if the given DumpFlag is set.
dumpOptTcRn :: DumpFlag -> String -> DumpFormat -> SDoc -> TcRn ()
doptM :: DumpFlag -> TcRnIf gbl lcl Bool
discardWarnings :: TcRn a -> TcRn a
discardResult :: TcM a -> TcM ()
discardErrs :: TcRn a -> TcRn a
-- | Throw out any constraints emitted by the thing_inside
discardConstraints :: TcM a -> TcM a
debugTc :: TcM () -> TcM ()
cloneLocalName :: Name -> TcM Name
cloneEvBindsVar :: EvBindsVar -> TcM EvBindsVar
chooseUniqueOccTc :: (OccSet -> OccName) -> TcM OccName
checkTcM :: Bool -> (TidyEnv, SDoc) -> TcM ()
checkTc :: Bool -> SDoc -> TcM ()
checkNoErrs :: TcM r -> TcM r
checkErr :: Bool -> SDoc -> TcRn ()
captureConstraints :: TcM a -> TcM (a, WantedConstraints)
attemptM :: TcRn r -> TcRn (Maybe r)
askNoErrs :: TcRn a -> TcRn (a, Bool)
-- | Display a warning, with an optional flag, for the current source
-- location.
add_warn :: WarnReason -> SDoc -> SDoc -> TcRn ()
-- | Display a warning in a given context.
addWarnTcM :: WarnReason -> (TidyEnv, SDoc) -> TcM ()
-- | Display a warning in the current context.
addWarnTc :: WarnReason -> SDoc -> TcM ()
-- | Display a warning for a given source location.
addWarnAt :: WarnReason -> SrcSpan -> SDoc -> TcRn ()
-- | Display a warning for the current source location.
addWarn :: WarnReason -> SDoc -> TcRn ()
addTopEvBinds :: Bag EvBind -> TcM a -> TcM a
addTcEvBind :: EvBindsVar -> EvBind -> TcM ()
-- | Adds the given modFinalizers to the global environment and set them to
-- use the current local environment.
addModFinalizersWithLclEnv :: ThModFinalizers -> TcM ()
addMessages :: Messages DecoratedSDoc -> TcRn ()
addLongErrAt :: SrcSpan -> SDoc -> SDoc -> TcRn ()
addLocMA :: (a -> TcM b) -> GenLocated (SrcSpanAnn' ann) a -> TcM b
addLocM :: (a -> TcM b) -> Located a -> TcM b
-- | Variant of addLandmarkErrCtxt that allows for monadic
-- operations and tidying.
addLandmarkErrCtxtM :: (TidyEnv -> TcM (TidyEnv, SDoc)) -> TcM a -> TcM a
-- | Add a fixed landmark message to the error context. A landmark message
-- is always sure to be reported, even if there is a lot of context. It
-- also doesn't count toward the maximum number of contexts reported.
addLandmarkErrCtxt :: SDoc -> TcM a -> TcM a
addErrs :: [(SrcSpan, SDoc)] -> TcRn ()
addErrTcM :: (TidyEnv, SDoc) -> TcM ()
addErrTc :: SDoc -> TcM ()
-- | Add a message to the error context. This message may do tidying.
addErrCtxtM :: (TidyEnv -> TcM (TidyEnv, SDoc)) -> TcM a -> TcM a
-- | Add a fixed message to the error context. This message should not do
-- any tidying.
addErrCtxt :: SDoc -> TcM a -> TcM a
addErrAt :: SrcSpan -> SDoc -> TcRn ()
addErr :: SDoc -> TcRn ()
addDependentFiles :: [FilePath] -> TcRn ()
data WhereFrom
ImportByUser :: IsBootInterface -> WhereFrom
ImportBySystem :: WhereFrom
ImportByPlugin :: WhereFrom
data ThStage
Splice :: SpliceType -> ThStage
RunSplice :: TcRef [ForeignRef (Q ())] -> ThStage
Comp :: ThStage
Brack :: ThStage -> PendingStuff -> ThStage
type ThLevel = Int
type TcTypeEnv = NameEnv TcTyThing
-- | A typecheckable thing available in a local context. Could be
-- AGlobal TyThing, but also lexically scoped variables,
-- etc. See GHC.Tc.Utils.Env for how to retrieve a TyThing
-- given a Name.
data TcTyThing
AGlobal :: TyThing -> TcTyThing
ATcId :: TcId -> IdBindingInfo -> TcTyThing
[tct_id] :: TcTyThing -> TcId
[tct_info] :: TcTyThing -> IdBindingInfo
ATyVar :: Name -> TcTyVar -> TcTyThing
ATcTyCon :: TyCon -> TcTyThing
APromotionErr :: PromotionErr -> TcTyThing
data TcSigInfo
TcIdSig :: TcIdSigInfo -> TcSigInfo
TcPatSynSig :: TcPatSynInfo -> TcSigInfo
type TcSigFun = Name -> Maybe TcSigInfo
type TcRnIf a b = IOEnv Env a b
type TcRn = TcRnIf TcGblEnv TcLclEnv
-- | Type alias for IORef; the convention is we'll use this for
-- mutable bits of data in TcGblEnv which are updated during
-- typechecking and returned at the end.
type TcRef a = IORef a
type TcPluginSolver = [Ct] -> [Ct] -> [Ct] -> TcPluginM TcPluginResult
data TcPluginResult
-- | The plugin found a contradiction. The returned constraints are removed
-- from the inert set, and recorded as insoluble.
TcPluginContradiction :: [Ct] -> TcPluginResult
-- | The first field is for constraints that were solved. These are removed
-- from the inert set, and the evidence for them is recorded. The second
-- field contains new work, that should be processed by the constraint
-- solver.
TcPluginOk :: [(EvTerm, Ct)] -> [Ct] -> TcPluginResult
data TcPluginM a
data TcPlugin
TcPlugin :: TcPluginM s -> (s -> TcPluginSolver) -> (s -> TcPluginM ()) -> TcPlugin
-- | Initialize plugin, when entering type-checker.
[tcPluginInit] :: TcPlugin -> TcPluginM s
-- | Solve some constraints. TODO: WRITE MORE DETAILS ON HOW THIS WORKS.
[tcPluginSolve] :: TcPlugin -> s -> TcPluginSolver
-- | Clean up after the plugin, when exiting the type-checker.
[tcPluginStop] :: TcPlugin -> s -> TcPluginM ()
data TcPatSynInfo
TPSI :: Name -> [InvisTVBinder] -> [InvisTVBinder] -> TcThetaType -> [InvisTVBinder] -> TcThetaType -> TcSigmaType -> TcPatSynInfo
[patsig_name] :: TcPatSynInfo -> Name
[patsig_implicit_bndrs] :: TcPatSynInfo -> [InvisTVBinder]
[patsig_univ_bndrs] :: TcPatSynInfo -> [InvisTVBinder]
[patsig_req] :: TcPatSynInfo -> TcThetaType
[patsig_ex_bndrs] :: TcPatSynInfo -> [InvisTVBinder]
[patsig_prov] :: TcPatSynInfo -> TcThetaType
[patsig_body_ty] :: TcPatSynInfo -> TcSigmaType
-- | Historical "type-checking monad" (now it's just TcRn).
type TcM = TcRn
data TcIdSigInst
TISI :: TcIdSigInfo -> [(Name, InvisTVBinder)] -> TcThetaType -> TcSigmaType -> [(Name, TcTyVar)] -> Maybe TcType -> TcIdSigInst
[sig_inst_sig] :: TcIdSigInst -> TcIdSigInfo
[sig_inst_skols] :: TcIdSigInst -> [(Name, InvisTVBinder)]
[sig_inst_theta] :: TcIdSigInst -> TcThetaType
[sig_inst_tau] :: TcIdSigInst -> TcSigmaType
[sig_inst_wcs] :: TcIdSigInst -> [(Name, TcTyVar)]
[sig_inst_wcx] :: TcIdSigInst -> Maybe TcType
data TcIdSigInfo
CompleteSig :: TcId -> UserTypeCtxt -> SrcSpan -> TcIdSigInfo
[sig_bndr] :: TcIdSigInfo -> TcId
[sig_ctxt] :: TcIdSigInfo -> UserTypeCtxt
[sig_loc] :: TcIdSigInfo -> SrcSpan
PartialSig :: Name -> LHsSigWcType GhcRn -> UserTypeCtxt -> SrcSpan -> TcIdSigInfo
[psig_name] :: TcIdSigInfo -> Name
[psig_hs_ty] :: TcIdSigInfo -> LHsSigWcType GhcRn
[sig_ctxt] :: TcIdSigInfo -> UserTypeCtxt
[sig_loc] :: TcIdSigInfo -> SrcSpan
type TcIdSet = IdSet
type TcId = Id
-- | TcGblEnv describes the top-level of the module at the point at
-- which the typechecker is finished work. It is this structure that is
-- handed on to the desugarer For state that needs to be updated during
-- the typechecking phase and returned at end, use a TcRef (=
-- IORef).
data TcGblEnv
TcGblEnv :: Module -> Module -> HscSource -> GlobalRdrEnv -> Maybe [Type] -> FixityEnv -> RecFieldEnv -> TypeEnv -> TcRef TypeEnv -> !InstEnv -> !FamInstEnv -> AnnEnv -> [AvailInfo] -> ImportAvails -> DefUses -> TcRef [GlobalRdrElt] -> TcRef NameSet -> TcRef Bool -> TcRef Bool -> TcRef OccSet -> [(Module, Fingerprint)] -> Maybe [(LIE GhcRn, Avails)] -> [LImportDecl GhcRn] -> Maybe (HsGroup GhcRn) -> TcRef [FilePath] -> TcRef [LHsDecl GhcPs] -> TcRef [(ForeignSrcLang, FilePath)] -> TcRef NameSet -> TcRef [(TcLclEnv, ThModFinalizers)] -> TcRef [String] -> TcRef (Map TypeRep Dynamic) -> TcRef (Maybe (ForeignRef (IORef QState))) -> TcRef THDocs -> Bag EvBind -> Maybe Id -> LHsBinds GhcTc -> NameSet -> [LTcSpecPrag] -> Warnings -> [Annotation] -> [TyCon] -> NameSet -> [ClsInst] -> [FamInst] -> [LRuleDecl GhcTc] -> [LForeignDecl GhcTc] -> [PatSyn] -> Maybe LHsDocString -> !AnyHpcUsage -> SelfBootInfo -> Maybe Name -> TcRef (Bool, WarningMessages) -> [TcPluginSolver] -> [HoleFitPlugin] -> RealSrcSpan -> TcRef WantedConstraints -> !CompleteMatches -> TcRef CostCentreState -> TcGblEnv
-- | Module being compiled
[tcg_mod] :: TcGblEnv -> Module
-- | If a signature, the backing module See also Note [Identity versus
-- semantic module]
[tcg_semantic_mod] :: TcGblEnv -> Module
-- | What kind of module (regular Haskell, hs-boot, hsig)
[tcg_src] :: TcGblEnv -> HscSource
-- | Top level envt; used during renaming
[tcg_rdr_env] :: TcGblEnv -> GlobalRdrEnv
-- | Types used for defaulting. Nothing => no default
-- decl
[tcg_default] :: TcGblEnv -> Maybe [Type]
-- | Just for things in this module
[tcg_fix_env] :: TcGblEnv -> FixityEnv
-- | Just for things in this module See Note [The interactive package] in
-- GHC.Runtime.Context
[tcg_field_env] :: TcGblEnv -> RecFieldEnv
-- | Global type env for the module we are compiling now. All TyCons and
-- Classes (for this module) end up in here right away, along with their
-- derived constructors, selectors.
--
-- (Ids defined in this module start in the local envt, though they move
-- to the global envt during zonking)
--
-- NB: for what "things in this module" means, see Note [The interactive
-- package] in GHC.Runtime.Context
[tcg_type_env] :: TcGblEnv -> TypeEnv
[tcg_type_env_var] :: TcGblEnv -> TcRef TypeEnv
-- | Instance envt for all home-package modules; Includes the dfuns
-- in tcg_insts NB. BangPattern is to fix a leak, see #15111
[tcg_inst_env] :: TcGblEnv -> !InstEnv
-- | Ditto for family instances NB. BangPattern is to fix a leak, see
-- #15111
[tcg_fam_inst_env] :: TcGblEnv -> !FamInstEnv
-- | And for annotations
[tcg_ann_env] :: TcGblEnv -> AnnEnv
-- | What is exported
[tcg_exports] :: TcGblEnv -> [AvailInfo]
-- | Information about what was imported from where, including things bound
-- in this module. Also store Safe Haskell info here about transitive
-- trusted package requirements.
--
-- There are not many uses of this field, so you can grep for all them.
--
-- The ImportAvails records information about the following things:
--
--
-- - All of the modules you directly imported (tcRnImports)
-- - The orphans (only!) of all imported modules in a GHCi session
-- (runTcInteractive)
-- - The module that instantiated a signature
-- - Each of the signatures that merged in
--
--
-- It is used in the following ways: - imp_orphs is used to determine
-- what orphan modules should be visible in the context
-- (tcVisibleOrphanMods) - imp_finsts is used to determine what family
-- instances should be visible (tcExtendLocalFamInstEnv) - To resolve the
-- meaning of the export list of a module (tcRnExports) - imp_mods is
-- used to compute usage info (mkIfaceTc, deSugar) - imp_trust_own_pkg is
-- used for Safe Haskell in interfaces (mkIfaceTc, as well as in
-- GHC.Driver.Main) - To create the Dependencies field in
-- interface (mkDependencies)
[tcg_imports] :: TcGblEnv -> ImportAvails
[tcg_dus] :: TcGblEnv -> DefUses
[tcg_used_gres] :: TcGblEnv -> TcRef [GlobalRdrElt]
[tcg_keep] :: TcGblEnv -> TcRef NameSet
-- | True <=> Template Haskell syntax used.
--
-- We need this so that we can generate a dependency on the Template
-- Haskell package, because the desugarer is going to emit loads of
-- references to TH symbols. The reference is implicit rather than
-- explicit, so we have to zap a mutable variable.
[tcg_th_used] :: TcGblEnv -> TcRef Bool
-- | True <=> A Template Haskell splice was used.
--
-- Splices disable recompilation avoidance (see #481)
[tcg_th_splice_used] :: TcGblEnv -> TcRef Bool
-- | Allows us to choose unique DFun names.
[tcg_dfun_n] :: TcGblEnv -> TcRef OccSet
-- | The requirements we merged with; we always have to recompile if any of
-- these changed.
[tcg_merged] :: TcGblEnv -> [(Module, Fingerprint)]
[tcg_rn_exports] :: TcGblEnv -> Maybe [(LIE GhcRn, Avails)]
[tcg_rn_imports] :: TcGblEnv -> [LImportDecl GhcRn]
-- | Renamed decls, maybe. Nothing <=> Don't retain renamed
-- decls.
[tcg_rn_decls] :: TcGblEnv -> Maybe (HsGroup GhcRn)
-- | dependencies from addDependentFile
[tcg_dependent_files] :: TcGblEnv -> TcRef [FilePath]
-- | Top-level declarations from addTopDecls
[tcg_th_topdecls] :: TcGblEnv -> TcRef [LHsDecl GhcPs]
-- | Foreign files emitted from TH.
[tcg_th_foreign_files] :: TcGblEnv -> TcRef [(ForeignSrcLang, FilePath)]
-- | Exact names bound in top-level declarations in tcg_th_topdecls
[tcg_th_topnames] :: TcGblEnv -> TcRef NameSet
-- | Template Haskell module finalizers.
--
-- They can use particular local environments.
[tcg_th_modfinalizers] :: TcGblEnv -> TcRef [(TcLclEnv, ThModFinalizers)]
-- | Core plugins added by Template Haskell code.
[tcg_th_coreplugins] :: TcGblEnv -> TcRef [String]
[tcg_th_state] :: TcGblEnv -> TcRef (Map TypeRep Dynamic)
-- | Template Haskell state
[tcg_th_remote_state] :: TcGblEnv -> TcRef (Maybe (ForeignRef (IORef QState)))
-- | Docs added in Template Haskell via putDoc.
[tcg_th_docs] :: TcGblEnv -> TcRef THDocs
[tcg_ev_binds] :: TcGblEnv -> Bag EvBind
[tcg_tr_module] :: TcGblEnv -> Maybe Id
[tcg_binds] :: TcGblEnv -> LHsBinds GhcTc
[tcg_sigs] :: TcGblEnv -> NameSet
[tcg_imp_specs] :: TcGblEnv -> [LTcSpecPrag]
[tcg_warns] :: TcGblEnv -> Warnings
[tcg_anns] :: TcGblEnv -> [Annotation]
[tcg_tcs] :: TcGblEnv -> [TyCon]
[tcg_ksigs] :: TcGblEnv -> NameSet
[tcg_insts] :: TcGblEnv -> [ClsInst]
[tcg_fam_insts] :: TcGblEnv -> [FamInst]
[tcg_rules] :: TcGblEnv -> [LRuleDecl GhcTc]
[tcg_fords] :: TcGblEnv -> [LForeignDecl GhcTc]
[tcg_patsyns] :: TcGblEnv -> [PatSyn]
-- | Maybe Haddock header docs
[tcg_doc_hdr] :: TcGblEnv -> Maybe LHsDocString
-- | True if any part of the prog uses hpc instrumentation. NB.
-- BangPattern is to fix a leak, see #15111
[tcg_hpc] :: TcGblEnv -> !AnyHpcUsage
-- | Whether this module has a corresponding hi-boot file
[tcg_self_boot] :: TcGblEnv -> SelfBootInfo
-- | The Name of the main function, if this module is the main module.
[tcg_main] :: TcGblEnv -> Maybe Name
-- | Has the typechecker inferred this module as -XSafe (Safe Haskell) See
-- Note [Safe Haskell Overlapping Instances Implementation], although
-- this is used for more than just that failure case.
[tcg_safeInfer] :: TcGblEnv -> TcRef (Bool, WarningMessages)
-- | A list of user-defined plugins for the constraint solver.
[tcg_tc_plugins] :: TcGblEnv -> [TcPluginSolver]
-- | A list of user-defined plugins for hole fit suggestions.
[tcg_hf_plugins] :: TcGblEnv -> [HoleFitPlugin]
-- | The RealSrcSpan this module came from
[tcg_top_loc] :: TcGblEnv -> RealSrcSpan
-- | Wanted constraints of static forms. See Note [Constraints in static
-- forms].
[tcg_static_wc] :: TcGblEnv -> TcRef WantedConstraints
-- | Tracking indices for cost centre annotations
[tcg_complete_matches] :: TcGblEnv -> !CompleteMatches
[tcg_cc_st] :: TcGblEnv -> TcRef CostCentreState
type TcBinderStack = [TcBinder]
data TcBinder
TcIdBndr :: TcId -> TopLevelFlag -> TcBinder
TcIdBndr_ExpType :: Name -> ExpType -> TopLevelFlag -> TcBinder
TcTvBndr :: Name -> TyVar -> TcBinder
-- | The current collection of docs that Template Haskell has built up via
-- putDoc.
type THDocs = Map DocLoc String
data SpliceType
Typed :: SpliceType
Untyped :: SpliceType
data SelfBootInfo
NoSelfBoot :: SelfBootInfo
SelfBoot :: ModDetails -> NameSet -> SelfBootInfo
[sb_mds] :: SelfBootInfo -> ModDetails
[sb_tcs] :: SelfBootInfo -> NameSet
type RoleAnnotEnv = NameEnv LRoleAnnotDecl GhcRn
-- | Historical "renaming monad" (now it's just TcRn).
type RnM = TcRn
type RhsNames = NameSet
type RecFieldEnv = NameEnv [FieldLabel]
data PromotionErr
TyConPE :: PromotionErr
ClassPE :: PromotionErr
FamDataConPE :: PromotionErr
ConstrainedDataConPE :: PredType -> PromotionErr
PatSynPE :: PromotionErr
RecDataConPE :: PromotionErr
NoDataKindsTC :: PromotionErr
NoDataKindsDC :: PromotionErr
data PendingStuff
RnPendingUntyped :: TcRef [PendingRnSplice] -> PendingStuff
RnPendingTyped :: PendingStuff
TcPending :: TcRef [PendingTcSplice] -> TcRef WantedConstraints -> QuoteWrapper -> PendingStuff
-- | A NameShape is a substitution on Names that can be used
-- to refine the identities of a hole while we are renaming interfaces
-- (see GHC.Iface.Rename). Specifically, a NameShape for
-- ns_module_name A, defines a mapping from
-- {A.T} (for some OccName T) to some arbitrary
-- other Name.
--
-- The most intruiging thing about a NameShape, however, is how
-- it's constructed. A NameShape is *implied* by the exported
-- AvailInfos of the implementor of an interface: if an
-- implementor of signature <H> exports M.T, you
-- implicitly define a substitution from {H.T} to M.T.
-- So a NameShape is computed from the list of AvailInfos
-- that are exported by the implementation of a module, or successively
-- merged together by the export lists of signatures which are joining
-- together.
--
-- It's not the most obvious way to go about doing this, but it does seem
-- to work!
--
-- NB: Can't boot this and put it in NameShape because then we start
-- pulling in too many DynFlags things.
data NameShape
NameShape :: ModuleName -> [AvailInfo] -> OccEnv Name -> NameShape
[ns_mod_name] :: NameShape -> ModuleName
[ns_exports] :: NameShape -> [AvailInfo]
[ns_map] :: NameShape -> OccEnv Name
-- | IsGroupClosed describes a group of mutually-recursive bindings
data IsGroupClosed
IsGroupClosed :: NameEnv RhsNames -> ClosedTypeId -> IsGroupClosed
-- | ImportAvails summarises what was imported from where,
-- irrespective of whether the imported things are actually used or not.
-- It is used:
--
--
-- - when processing the export list,
-- - when constructing usage info for the interface file,
-- - to identify the list of directly imported modules for
-- initialisation purposes and for optimised overlap checking of family
-- instances,
-- - when figuring out what things are really unused
--
data ImportAvails
ImportAvails :: ImportedMods -> ModuleNameEnv ModuleNameWithIsBoot -> Set UnitId -> Set UnitId -> Bool -> [Module] -> [Module] -> ImportAvails
-- | Domain is all directly-imported modules
--
-- See the documentation on ImportedModsVal in
-- GHC.Unit.Module.Imported for the meaning of the fields.
--
-- We need a full ModuleEnv rather than a ModuleNameEnv here, because we
-- might be importing modules of the same name from different packages.
-- (currently not the case, but might be in the future).
[imp_mods] :: ImportAvails -> ImportedMods
-- | Home-package modules needed by the module being compiled
--
-- It doesn't matter whether any of these dependencies are actually
-- used when compiling the module; they are listed if they are
-- below it at all. For example, suppose M imports A which imports X.
-- Then compiling M might not need to consult X.hi, but X is still listed
-- in M's dependencies.
[imp_dep_mods] :: ImportAvails -> ModuleNameEnv ModuleNameWithIsBoot
-- | Packages needed by the module being compiled, whether directly, or via
-- other modules in this package, or via modules imported from other
-- packages.
[imp_dep_pkgs] :: ImportAvails -> Set UnitId
-- | This is strictly a subset of imp_dep_pkgs and records the packages the
-- current module needs to trust for Safe Haskell compilation to succeed.
-- A package is required to be trusted if we are dependent on a
-- trustworthy module in that package. While perhaps making imp_dep_pkgs
-- a tuple of (UnitId, Bool) where True for the bool indicates the
-- package is required to be trusted is the more logical design, doing so
-- complicates a lot of code not concerned with Safe Haskell. See Note
-- [Tracking Trust Transitively] in GHC.Rename.Names
[imp_trust_pkgs] :: ImportAvails -> Set UnitId
-- | Do we require that our own package is trusted? This is to handle
-- efficiently the case where a Safe module imports a Trustworthy module
-- that resides in the same package as it. See Note [Trust Own Package]
-- in GHC.Rename.Names
[imp_trust_own_pkg] :: ImportAvails -> Bool
-- | Orphan modules below us in the import tree (and maybe including us for
-- imported modules)
[imp_orphs] :: ImportAvails -> [Module]
-- | Family instance modules below us in the import tree (and maybe
-- including us for imported modules)
[imp_finsts] :: ImportAvails -> [Module]
type IfM lcl = TcRnIf IfGblEnv lcl
data IfLclEnv
IfLclEnv :: Module -> IsBootInterface -> SDoc -> Maybe NameShape -> Maybe TypeEnv -> FastStringEnv TyVar -> FastStringEnv Id -> IfLclEnv
[if_mod] :: IfLclEnv -> Module
[if_boot] :: IfLclEnv -> IsBootInterface
[if_loc] :: IfLclEnv -> SDoc
[if_nsubst] :: IfLclEnv -> Maybe NameShape
[if_implicits_env] :: IfLclEnv -> Maybe TypeEnv
[if_tv_env] :: IfLclEnv -> FastStringEnv TyVar
[if_id_env] :: IfLclEnv -> FastStringEnv Id
type IfL = IfM IfLclEnv
data IfGblEnv
IfGblEnv :: SDoc -> Maybe (Module, IfG TypeEnv) -> IfGblEnv
[if_doc] :: IfGblEnv -> SDoc
[if_rec_types] :: IfGblEnv -> Maybe (Module, IfG TypeEnv)
type IfG = IfM ()
-- | IdBindingInfo describes how an Id is bound.
--
-- It is used for the following purposes: a) for static forms in
-- checkClosedInStaticForm and b) to figure out when a nested
-- binding can be generalised, in decideGeneralisationPlan.
data IdBindingInfo
NotLetBound :: IdBindingInfo
ClosedLet :: IdBindingInfo
NonClosedLet :: RhsNames -> ClosedTypeId -> IdBindingInfo
-- | FrontendResult describes the result of running the frontend of
-- a Haskell module. Currently one always gets a
-- FrontendTypecheck, since running the frontend involves
-- typechecking a program. hs-sig merges are not handled here.
--
-- This data type really should be in GHC.Driver.Env, but it needs to
-- have a TcGblEnv which is only defined here.
data FrontendResult
FrontendTypecheck :: TcGblEnv -> FrontendResult
type ErrCtxt = (Bool, TidyEnv -> TcM (TidyEnv, SDoc))
data Env gbl lcl
Env :: !HscEnv -> !Char -> gbl -> lcl -> Env gbl lcl
[env_top] :: Env gbl lcl -> !HscEnv
[env_um] :: Env gbl lcl -> !Char
[env_gbl] :: Env gbl lcl -> gbl
[env_lcl] :: Env gbl lcl -> lcl
-- | This is a mirror of Template Haskell's DocLoc, but the TH names are
-- resolved to GHC names.
data DocLoc
DeclDoc :: Name -> DocLoc
ArgDoc :: Name -> Int -> DocLoc
InstDoc :: Name -> DocLoc
ModuleDoc :: DocLoc
type ClosedTypeId = Bool
data ArrowCtxt
NoArrowCtxt :: ArrowCtxt
ArrowCtxt :: LocalRdrEnv -> TcRef WantedConstraints -> ArrowCtxt
-- | This function provides an escape for direct access to the TcM
-- monad. It should not be used lightly, and the provided
-- TcPluginM API should be favoured instead.
unsafeTcPluginTcM :: TcM a -> TcPluginM a
topStage :: ThStage
topSpliceStage :: ThStage
topAnnStage :: ThStage
thLevel :: ThStage -> ThLevel
tcVisibleOrphanMods :: TcGblEnv -> ModuleSet
tcTyThingCategory :: TcTyThing -> String
runTcPluginM :: TcPluginM a -> EvBindsVar -> TcM a
removeBindingShadowing :: HasOccName a => [a] -> [a]
pushErrCtxtSameOrigin :: ErrCtxt -> CtLoc -> CtLoc
pushErrCtxt :: CtOrigin -> ErrCtxt -> CtLoc -> CtLoc
pprTcTyThingCategory :: TcTyThing -> SDoc
pprPECategory :: PromotionErr -> SDoc
-- | Union two ImportAvails
--
-- This function is a key part of Import handling, basically for each
-- import we create a separate ImportAvails structure and then union them
-- all together with this function.
plusImportAvails :: ImportAvails -> ImportAvails -> ImportAvails
peCategory :: PromotionErr -> String
outerLevel :: ThLevel
modDepsElts :: ModuleNameEnv ModuleNameWithIsBoot -> [ModuleNameWithIsBoot]
mkRoleAnnotEnv :: [LRoleAnnotDecl GhcRn] -> RoleAnnotEnv
mkModDeps :: [ModuleNameWithIsBoot] -> ModuleNameEnv ModuleNameWithIsBoot
lookupRoleAnnot :: RoleAnnotEnv -> Name -> Maybe (LRoleAnnotDecl GhcRn)
-- | Check the TcGblEnv for consistency. Currently, only checks
-- axioms, but should check other aspects, too.
lintGblEnv :: Logger -> DynFlags -> TcGblEnv -> TcM ()
isPartialSig :: TcIdSigInst -> Bool
impLevel :: ThLevel
-- | No signature or a partial signature
hasCompleteSig :: TcSigFun -> Name -> Bool
getRoleAnnots :: [Name] -> RoleAnnotEnv -> [LRoleAnnotDecl GhcRn]
-- | Get target platform
getPlatform :: TcM Platform
-- | Access the EvBindsVar carried by the TcPluginM during
-- constraint solving. Returns Nothing if invoked during
-- tcPluginInit or tcPluginStop.
getEvBindsTcPluginM :: TcPluginM EvBindsVar
emptyRoleAnnotEnv :: RoleAnnotEnv
emptyImportAvails :: ImportAvails
uncacheModule :: HscEnv -> ModuleName -> IO ()
mkStubPaths :: DynFlags -> ModuleName -> ModLocation -> FilePath
-- | Constructs the filename of a .o file for a given source file. Does
-- not check whether the .o file exists
mkObjPath :: DynFlags -> FilePath -> String -> FilePath
mkHomeModLocation2 :: DynFlags -> ModuleName -> FilePath -> String -> IO ModLocation
mkHomeModLocation :: DynFlags -> ModuleName -> FilePath -> IO ModLocation
-- | Constructs the filename of a .hi file for a given source file. Does
-- not check whether the .hi file exists
mkHiPath :: DynFlags -> FilePath -> String -> FilePath
mkHiOnlyModLocation :: DynFlags -> Suffix -> FilePath -> String -> IO ModLocation
flushFinderCaches :: HscEnv -> IO ()
-- | Locate a plugin module requested by the user, for a compiler plugin.
-- This consults the same set of exposed packages as
-- findImportedModule, unless -hide-all-plugin-packages
-- or -plugin-package are specified.
findPluginModule :: HscEnv -> ModuleName -> IO FindResult
findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable)
findObjectLinkable :: Module -> FilePath -> UTCTime -> IO Linkable
-- | Locate a module that was imported by the user. We have the module's
-- name, and possibly a package name. Without a package name, this
-- function will use the search path and the known exposed packages to
-- find the module, if a package is specified then only that package is
-- searched for the module.
findImportedModule :: HscEnv -> ModuleName -> Maybe FastString -> IO FindResult
findHomeModule :: HscEnv -> ModuleName -> IO FindResult
findExposedPackageModule :: HscEnv -> ModuleName -> Maybe FastString -> IO FindResult
-- | Locate a specific Module. The purpose of this function is to
-- create a ModLocation for a given Module, that is to find
-- out where the files associated with this module live. It is used when
-- reading the interface for a module mentioned by another interface, for
-- example (a "system import").
findExactModule :: HscEnv -> InstalledModule -> IO InstalledFindResult
addHomeModuleToFinder :: HscEnv -> ModuleName -> ModLocation -> IO Module
-- | A Xi-type is one that has been fully rewritten with respect to
-- the inert set; that is, it has been rewritten by the algorithm in
-- GHC.Tc.Solver.Rewrite. (Historical note: Xi, for years and
-- years, meant that a type was type-family-free. It does *not* mean this
-- any more.)
type Xi = TcType
data WantedConstraints
WC :: Cts -> Bag Implication -> Bag Hole -> WantedConstraints
[wc_simple] :: WantedConstraints -> Cts
[wc_impl] :: WantedConstraints -> Bag Implication
[wc_holes] :: WantedConstraints -> Bag Hole
-- | A place for type-checking evidence to go after it is generated. Wanted
-- equalities are always HoleDest; other wanteds are always EvVarDest.
data TcEvDest
-- | bind this var to the evidence EvVarDest is always used for
-- non-type-equalities e.g. class constraints
EvVarDest :: EvVar -> TcEvDest
-- | fill in this hole with the evidence HoleDest is always used for
-- type-equalities See Note [Coercion holes] in GHC.Core.TyCo.Rep
HoleDest :: CoercionHole -> TcEvDest
-- | See Note [SubGoalDepth]
data SubGoalDepth
data ShadowInfo
WDeriv :: ShadowInfo
WOnly :: ShadowInfo
data QCInst
QCI :: CtEvidence -> [TcTyVar] -> TcPredType -> Bool -> QCInst
[qci_ev] :: QCInst -> CtEvidence
[qci_tvs] :: QCInst -> [TcTyVar]
[qci_pred] :: QCInst -> TcPredType
[qci_pend_sc] :: QCInst -> Bool
data Implication
Implic :: TcLevel -> [TcTyVar] -> SkolemInfo -> [EvVar] -> HasGivenEqs -> Bool -> TcLclEnv -> WantedConstraints -> EvBindsVar -> VarSet -> VarSet -> ImplicStatus -> Implication
[ic_tclvl] :: Implication -> TcLevel
[ic_skols] :: Implication -> [TcTyVar]
[ic_info] :: Implication -> SkolemInfo
[ic_given] :: Implication -> [EvVar]
[ic_given_eqs] :: Implication -> HasGivenEqs
[ic_warn_inaccessible] :: Implication -> Bool
[ic_env] :: Implication -> TcLclEnv
[ic_wanted] :: Implication -> WantedConstraints
[ic_binds] :: Implication -> EvBindsVar
[ic_need_inner] :: Implication -> VarSet
[ic_need_outer] :: Implication -> VarSet
[ic_status] :: Implication -> ImplicStatus
data ImplicStatus
IC_Solved :: [EvVar] -> ImplicStatus
[ics_dead] :: ImplicStatus -> [EvVar]
IC_Insoluble :: ImplicStatus
IC_BadTelescope :: ImplicStatus
IC_Unsolved :: ImplicStatus
-- | Used to indicate which sort of hole we have.
data HoleSort
-- | Either an out-of-scope variable or a "true" hole in an expression
-- (TypedHoles). The HoleExprRef says where to write the the erroring
-- expression for -fdefer-type-errors.
ExprHole :: HoleExprRef -> HoleSort
-- | A hole in a type (PartialTypeSignatures)
TypeHole :: HoleSort
-- | A hole in a constraint, like @f :: (_, Eq a) => ... Differentiated
-- from TypeHole because a ConstraintHole is simplified differently. See
-- Note [Do not simplify ConstraintHoles] in GHC.Tc.Solver.
ConstraintHole :: HoleSort
-- | A hole stores the information needed to report diagnostics about holes
-- in terms (unbound identifiers or underscores) or in types (also called
-- wildcards, as used in partial type signatures). See Note [Holes].
data Hole
Hole :: HoleSort -> OccName -> TcType -> CtLoc -> Hole
-- | What flavour of hole is this?
[hole_sort] :: Hole -> HoleSort
-- | The name of this hole
[hole_occ] :: Hole -> OccName
-- | Type to be printed to the user For expression holes: type of expr For
-- type holes: the missing type
[hole_ty] :: Hole -> TcType
-- | Where hole was written
[hole_loc] :: Hole -> CtLoc
data HasGivenEqs
NoGivenEqs :: HasGivenEqs
LocalGivenEqs :: HasGivenEqs
MaybeGivenEqs :: HasGivenEqs
type Cts = Bag Ct
data CtLoc
CtLoc :: CtOrigin -> TcLclEnv -> Maybe TypeOrKind -> !SubGoalDepth -> CtLoc
[ctl_origin] :: CtLoc -> CtOrigin
[ctl_env] :: CtLoc -> TcLclEnv
[ctl_t_or_k] :: CtLoc -> Maybe TypeOrKind
[ctl_depth] :: CtLoc -> !SubGoalDepth
-- | Used to indicate extra information about why a CIrredCan is
-- irreducible
data CtIrredReason
-- | this constraint has a non-canonical shape (e.g. c Int, for a
-- variable c)
IrredShapeReason :: CtIrredReason
-- | this constraint is blocked on the coercion hole(s) listed See Note
-- [Equalities with incompatible kinds] in GHC.Tc.Solver.Canonical
-- Wrinkle (4a). Why store the HoleSet? See Wrinkle (2) of that same
-- Note. INVARIANT: A HoleBlockerReason constraint is a homogeneous
-- equality whose left hand side can fit in a CanEqLHS.
HoleBlockerReason :: HoleSet -> CtIrredReason
-- | an equality where some invariant other than (TyEq:H) of CEqCan
-- is not satisfied; the CheckTyEqResult states exactly why
-- INVARIANT: the CheckTyEqResult has some bit set other than
-- cteHoleBlocker
NonCanonicalReason :: CheckTyEqResult -> CtIrredReason
-- | an equality that cannot be decomposed because it is representational.
-- Example: a b ~R# Int. These might still be solved later.
-- INVARIANT: The constraint is a representational equality constraint
ReprEqReason :: CtIrredReason
-- | a nominal equality that relates two wholly different types, like
-- Int ~# Bool or a b ~# 3. INVARIANT: The constraint
-- is a nominal equality constraint
ShapeMismatchReason :: CtIrredReason
-- | an equality like T a b c ~ Q d e where either T or
-- Q is an abstract type constructor. See Note [Skolem abstract
-- data] in GHC.Core.TyCon. INVARIANT: The constraint is an equality
-- constraint between two TyConApps
AbstractTyConReason :: CtIrredReason
-- | Whether or not one Ct can rewrite another is determined by its
-- flavour and its equality relation. See also Note [Flavours with roles]
-- in GHC.Tc.Solver.Monad
type CtFlavourRole = (CtFlavour, EqRel)
data CtFlavour
Given :: CtFlavour
Wanted :: ShadowInfo -> CtFlavour
Derived :: CtFlavour
data CtEvidence
CtGiven :: TcPredType -> EvVar -> CtLoc -> CtEvidence
[ctev_pred] :: CtEvidence -> TcPredType
[ctev_evar] :: CtEvidence -> EvVar
[ctev_loc] :: CtEvidence -> CtLoc
CtWanted :: TcPredType -> TcEvDest -> ShadowInfo -> CtLoc -> CtEvidence
[ctev_pred] :: CtEvidence -> TcPredType
[ctev_dest] :: CtEvidence -> TcEvDest
[ctev_nosh] :: CtEvidence -> ShadowInfo
[ctev_loc] :: CtEvidence -> CtLoc
CtDerived :: TcPredType -> CtLoc -> CtEvidence
[ctev_pred] :: CtEvidence -> TcPredType
[ctev_loc] :: CtEvidence -> CtLoc
data Ct
CDictCan :: CtEvidence -> Class -> [Xi] -> Bool -> Ct
[cc_ev] :: Ct -> CtEvidence
[cc_class] :: Ct -> Class
[cc_tyargs] :: Ct -> [Xi]
[cc_pend_sc] :: Ct -> Bool
CIrredCan :: CtEvidence -> CtIrredReason -> Ct
[cc_ev] :: Ct -> CtEvidence
[cc_reason] :: Ct -> CtIrredReason
CEqCan :: CtEvidence -> CanEqLHS -> Xi -> EqRel -> Ct
[cc_ev] :: Ct -> CtEvidence
[cc_lhs] :: Ct -> CanEqLHS
[cc_rhs] :: Ct -> Xi
[cc_eq_rel] :: Ct -> EqRel
CNonCanonical :: CtEvidence -> Ct
[cc_ev] :: Ct -> CtEvidence
CQuantCan :: QCInst -> Ct
-- | A set of problems in checking the validity of a type equality. See
-- checkTypeEq.
data CheckTyEqResult
-- | An individual problem that might be logged in a CheckTyEqResult
data CheckTyEqProblem
-- | A CanEqLHS is a type that can appear on the left of a canonical
-- equality: a type variable or exactly-saturated type family
-- application.
data CanEqLHS
TyVarLHS :: TcTyVar -> CanEqLHS
TyFamLHS :: TyCon -> [Xi] -> CanEqLHS
wrapType :: Type -> [TyVar] -> [PredType] -> Type
updateCtLocOrigin :: CtLoc -> (CtOrigin -> CtOrigin) -> CtLoc
unionsWC :: [WantedConstraints] -> WantedConstraints
-- | Returns free variables of WantedConstraints as a deterministically
-- ordered list. See Note [Deterministic FV] in GHC.Utils.FV.
tyCoVarsOfWCList :: WantedConstraints -> [TyCoVar]
-- | Returns free variables of WantedConstraints as a non-deterministic
-- set. See Note [Deterministic FV] in GHC.Utils.FV.
tyCoVarsOfWC :: WantedConstraints -> TyCoVarSet
-- | Returns free variables of a bag of constraints as a deterministically
-- ordered list. See Note [Deterministic FV] in GHC.Utils.FV.
tyCoVarsOfCtsList :: Cts -> [TcTyCoVar]
-- | Returns free variables of a bag of constraints as a non-deterministic
-- set. See Note [Deterministic FV] in GHC.Utils.FV.
tyCoVarsOfCts :: Cts -> TcTyCoVarSet
-- | Returns free variables of constraints as a deterministically ordered.
-- list. See Note [Deterministic FV] in GHC.Utils.FV.
tyCoVarsOfCtList :: Ct -> [TcTyCoVar]
-- | Returns free variables of constraints as a non-deterministic set
tyCoVarsOfCt :: Ct -> TcTyCoVarSet
-- | Take a CtLoc and moves it to the kind level
toKindLoc :: CtLoc -> CtLoc
-- | True if taking superclasses of givens, or of wanteds (to perhaps
-- expose more equalities or functional dependencies) might help to solve
-- this constraint. See Note [When superclasses help]
superClassesMightHelp :: WantedConstraints -> Bool
subGoalDepthExceeded :: DynFlags -> SubGoalDepth -> Bool
snocCts :: Cts -> Ct -> Cts
singleCt :: Ct -> Cts
setCtLocSpan :: CtLoc -> RealSrcSpan -> CtLoc
setCtLocOrigin :: CtLoc -> CtOrigin -> CtLoc
setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc
setCtLoc :: Ct -> CtLoc -> Ct
pprEvVars :: [EvVar] -> SDoc
pprEvVarWithType :: EvVar -> SDoc
pprEvVarTheta :: [EvVar] -> SDoc
pprCts :: Cts -> SDoc
pprCtLoc :: CtLoc -> SDoc
-- | Makes a new equality predicate with the same role as the given
-- evidence.
mkTcEqPredLikeEv :: CtEvidence -> TcType -> TcType -> TcType
mkSimpleWC :: [CtEvidence] -> WantedConstraints
mkNonCanonicalCt :: Ct -> Ct
mkNonCanonical :: CtEvidence -> Ct
mkKindLoc :: TcType -> TcType -> CtLoc -> CtLoc
mkIrredCt :: CtIrredReason -> CtEvidence -> Ct
mkImplicWC :: Bag Implication -> WantedConstraints
mkGivens :: CtLoc -> [EvId] -> [Ct]
mkGivenLoc :: TcLevel -> SkolemInfo -> TcLclEnv -> CtLoc
maxSubGoalDepth :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth
listToCts :: [Ct] -> Cts
isWantedCt :: Ct -> Bool
isWanted :: CtEvidence -> Bool
isUserTypeErrorCt :: Ct -> Bool
-- | Checks whether a the given wanted constraints are solved, i.e. that
-- there are no simple constraints left and all the implications are
-- solved.
isSolvedWC :: WantedConstraints -> Bool
isSolvedStatus :: ImplicStatus -> Bool
isPendingScInst :: QCInst -> Maybe QCInst
isPendingScDict :: Ct -> Maybe Ct
-- | Does this hole represent an "out of scope" error? See Note [Insoluble
-- holes]
isOutOfScopeHole :: Hole -> Bool
isInsolubleStatus :: ImplicStatus -> Bool
-- | Are we sure that more solving will never solve this constraint?
isInsolubleReason :: CtIrredReason -> Bool
isGivenLoc :: CtLoc -> Bool
isGivenCt :: Ct -> Bool
isGiven :: CtEvidence -> Bool
isEmptyWC :: WantedConstraints -> Bool
isEmptyCts :: Cts -> Bool
isDroppableCt :: Ct -> Bool
isDerivedCt :: Ct -> Bool
isDerived :: CtEvidence -> Bool
insolubleWC :: WantedConstraints -> Bool
insolubleImplic :: Implication -> Bool
insolubleEqCt :: Ct -> Bool
insolubleCt :: Ct -> Bool
initialSubGoalDepth :: SubGoalDepth
implicationPrototype :: Implication
-- | A constraint is considered to be a custom type error, if it contains
-- custom type errors anywhere in it. See Note [Custom type errors in
-- constraints]
getUserTypeErrorMsg :: Ct -> Maybe Type
getPendingWantedScs :: Cts -> ([Ct], Cts)
extendCtsList :: Cts -> [Ct] -> Cts
eqMayRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool
eqCanRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool
eqCanRewrite :: EqRel -> EqRel -> Bool
-- | Are two CanEqLHSs equal?
eqCanEqLHS :: CanEqLHS -> CanEqLHS -> Bool
eqCanDischargeFR :: CtFlavourRole -> CtFlavourRole -> Bool
emptyWC :: WantedConstraints
emptyCts :: Cts
dropMisleading :: WantedConstraints -> WantedConstraints
dropDerivedWC :: WantedConstraints -> WantedConstraints
dropDerivedSimples :: Cts -> Cts
ctsElts :: Cts -> [Ct]
-- | Mark a CheckTyEqResult as not having an insoluble occurs-check:
-- any occurs check under a type family or in a representation equality
-- is soluble.
cterSetOccursCheckSoluble :: CheckTyEqResult -> CheckTyEqResult
cterRemoveProblem :: CheckTyEqResult -> CheckTyEqProblem -> CheckTyEqResult
-- | Check whether a CheckTyEqResult has a CheckTyEqProblem
cterHasProblem :: CheckTyEqResult -> CheckTyEqProblem -> Bool
-- | Check whether a CheckTyEqResult has one CheckTyEqProblem
-- and no other
cterHasOnlyProblem :: CheckTyEqResult -> CheckTyEqProblem -> Bool
cterHasOccursCheck :: CheckTyEqResult -> Bool
-- | Check whether a CheckTyEqResult is marked successful.
cterHasNoProblem :: CheckTyEqResult -> Bool
-- | Retain only information about occurs-check failures, because only that
-- matters after recurring into a kind.
cterFromKind :: CheckTyEqResult -> CheckTyEqResult
cterClearOccursCheck :: CheckTyEqResult -> CheckTyEqResult
cteTypeFamily :: CheckTyEqProblem
cteSolubleOccurs :: CheckTyEqProblem
cteProblem :: CheckTyEqProblem -> CheckTyEqResult
-- | No problems in checking the validity of a type equality.
cteOK :: CheckTyEqResult
cteInsolubleOccurs :: CheckTyEqProblem
cteImpredicative :: CheckTyEqProblem
cteHoleBlocker :: CheckTyEqProblem
ctPred :: Ct -> PredType
ctOrigin :: Ct -> CtOrigin
ctLocTypeOrKind_maybe :: CtLoc -> Maybe TypeOrKind
ctLocSpan :: CtLoc -> RealSrcSpan
ctLocOrigin :: CtLoc -> CtOrigin
ctLocLevel :: CtLoc -> TcLevel
ctLocEnv :: CtLoc -> TcLclEnv
ctLocDepth :: CtLoc -> SubGoalDepth
ctLoc :: Ct -> CtLoc
-- | Extract the flavour and role from a Ct
ctFlavourRole :: Ct -> CtFlavourRole
-- | Does this CtFlavour subsumed Derived? True of
-- [WD] and [D].
ctFlavourContainsDerived :: CtFlavour -> Bool
-- | Get the flavour of the given Ct
ctFlavour :: Ct -> CtFlavour
ctEvidence :: Ct -> CtEvidence
ctEvTerm :: CtEvidence -> EvTerm
-- | Get the role relevant for a CtEvidence
ctEvRole :: CtEvidence -> Role
ctEvPred :: CtEvidence -> TcPredType
ctEvOrigin :: CtEvidence -> CtOrigin
ctEvLoc :: CtEvidence -> CtLoc
ctEvId :: Ct -> EvVar
-- | Extract the flavour, role, and boxity from a CtEvidence
ctEvFlavourRole :: CtEvidence -> CtFlavourRole
ctEvFlavour :: CtEvidence -> CtFlavour
ctEvExpr :: CtEvidence -> EvExpr
ctEvEvId :: CtEvidence -> EvVar
-- | Get the equality relation relevant for a CtEvidence
ctEvEqRel :: CtEvidence -> EqRel
ctEvCoercion :: HasDebugCallStack => CtEvidence -> TcCoercion
-- | Get the equality relation for the given Ct
ctEqRel :: Ct -> EqRel
consCts :: Ct -> Cts -> Cts
checkTelescopeSkol :: SkolemInfo -> Bool
-- | Is a type a canonical LHS? That is, is it a tyvar or an
-- exactly-saturated type family application? Does not look through type
-- synonyms.
canEqLHS_maybe :: Xi -> Maybe CanEqLHS
-- | Convert a CanEqLHS back into a Expr
canEqLHSType :: CanEqLHS -> TcType
-- | Retrieve the kind of a CanEqLHS
canEqLHSKind :: CanEqLHS -> TcKind
bumpSubGoalDepth :: SubGoalDepth -> SubGoalDepth
bumpCtLocDepth :: CtLoc -> CtLoc
arisesFromGivens :: Ct -> Bool
andWC :: WantedConstraints -> WantedConstraints -> WantedConstraints
andManyCts :: [Cts] -> Cts
andCts :: Cts -> Cts -> Cts
addSimples :: WantedConstraints -> Bag Ct -> WantedConstraints
addInsols :: WantedConstraints -> Bag Ct -> WantedConstraints
addImplics :: WantedConstraints -> Bag Implication -> WantedConstraints
addHoles :: WantedConstraints -> Bag Hole -> WantedConstraints
-- | UserTypeCtxt describes the origin of the polymorphic type in the
-- places where we need an expression to have that type
data UserTypeCtxt
FunSigCtxt :: Name -> Bool -> UserTypeCtxt
InfSigCtxt :: Name -> UserTypeCtxt
ExprSigCtxt :: UserTypeCtxt
KindSigCtxt :: UserTypeCtxt
StandaloneKindSigCtxt :: Name -> UserTypeCtxt
TypeAppCtxt :: UserTypeCtxt
ConArgCtxt :: Name -> UserTypeCtxt
TySynCtxt :: Name -> UserTypeCtxt
PatSynCtxt :: Name -> UserTypeCtxt
PatSigCtxt :: UserTypeCtxt
RuleSigCtxt :: Name -> UserTypeCtxt
ForSigCtxt :: Name -> UserTypeCtxt
DefaultDeclCtxt :: UserTypeCtxt
InstDeclCtxt :: Bool -> UserTypeCtxt
SpecInstCtxt :: UserTypeCtxt
GenSigCtxt :: UserTypeCtxt
GhciCtxt :: Bool -> UserTypeCtxt
ClassSCCtxt :: Name -> UserTypeCtxt
SigmaCtxt :: UserTypeCtxt
DataTyCtxt :: Name -> UserTypeCtxt
DerivClauseCtxt :: UserTypeCtxt
TyVarBndrKindCtxt :: Name -> UserTypeCtxt
DataKindCtxt :: Name -> UserTypeCtxt
TySynKindCtxt :: Name -> UserTypeCtxt
TyFamResKindCtxt :: Name -> UserTypeCtxt
data SkolemInfo
SigSkol :: UserTypeCtxt -> TcType -> [(Name, TcTyVar)] -> SkolemInfo
SigTypeSkol :: UserTypeCtxt -> SkolemInfo
ForAllSkol :: SDoc -> SkolemInfo
DerivSkol :: Type -> SkolemInfo
InstSkol :: SkolemInfo
FamInstSkol :: SkolemInfo
PatSkol :: ConLike -> HsMatchContext GhcRn -> SkolemInfo
ArrowSkol :: SkolemInfo
IPSkol :: [HsIPName] -> SkolemInfo
RuleSkol :: RuleName -> SkolemInfo
InferSkol :: [(Name, TcType)] -> SkolemInfo
BracketSkol :: SkolemInfo
UnifyForAllSkol :: TcType -> SkolemInfo
TyConSkol :: TyConFlavour -> Name -> SkolemInfo
DataConSkol :: Name -> SkolemInfo
ReifySkol :: SkolemInfo
QuantCtxtSkol :: SkolemInfo
RuntimeUnkSkol :: SkolemInfo
UnkSkol :: SkolemInfo
data CtOrigin
-- | A given constraint from a user-written type signature. The
-- SkolemInfo inside gives more information.
GivenOrigin :: SkolemInfo -> CtOrigin
-- | InstSCOrigin is used for a Given constraint obtained by
-- superclass selection from the context of an instance declaration. E.g.
-- instance (Foo a, Bar a) => C [a] where ... When
-- typechecking the instance decl itself, including producing evidence
-- for the superclasses of C, the superclasses of (Foo
-- a) and (Bar a) will have InstSCOrigin origin.
InstSCOrigin :: ScDepth -> TypeSize -> CtOrigin
-- | OtherSCOrigin is used for a Given constraint obtained by
-- superclass selection from a constraint other than the context
-- of an instance declaration. (For the latter we use
-- InstSCOrigin.) E.g. f :: Foo a => blah f = e When
-- typechecking body of f, the superclasses of the Given (Foo a)
-- will have OtherSCOrigin. Needed for Note [Replacement vs
-- keeping] and Note [Use only the best local instance], both in
-- GHC.Tc.Solver.Interact.
OtherSCOrigin :: ScDepth -> SkolemInfo -> CtOrigin
OccurrenceOf :: Name -> CtOrigin
OccurrenceOfRecSel :: RdrName -> CtOrigin
AppOrigin :: CtOrigin
SpecPragOrigin :: UserTypeCtxt -> CtOrigin
TypeEqOrigin :: TcType -> TcType -> Maybe SDoc -> Bool -> CtOrigin
[uo_actual] :: CtOrigin -> TcType
[uo_expected] :: CtOrigin -> TcType
-- | The thing that has type "actual"
[uo_thing] :: CtOrigin -> Maybe SDoc
-- | Is at least one of the three elements above visible? (Errors from the
-- polymorphic subsumption check are considered visible.) Only used for
-- prioritizing error messages.
[uo_visible] :: CtOrigin -> Bool
KindEqOrigin :: TcType -> TcType -> CtOrigin -> Maybe TypeOrKind -> CtOrigin
IPOccOrigin :: HsIPName -> CtOrigin
OverLabelOrigin :: FastString -> CtOrigin
LiteralOrigin :: HsOverLit GhcRn -> CtOrigin
NegateOrigin :: CtOrigin
ArithSeqOrigin :: ArithSeqInfo GhcRn -> CtOrigin
AssocFamPatOrigin :: CtOrigin
SectionOrigin :: CtOrigin
HasFieldOrigin :: FastString -> CtOrigin
TupleOrigin :: CtOrigin
ExprSigOrigin :: CtOrigin
PatSigOrigin :: CtOrigin
PatOrigin :: CtOrigin
ProvCtxtOrigin :: PatSynBind GhcRn GhcRn -> CtOrigin
RecordUpdOrigin :: CtOrigin
ViewPatOrigin :: CtOrigin
-- | ScOrigin is used only for the Wanted constraints for the
-- superclasses of an instance declaration. If the instance head is C
-- ty1 .. tyn then TypeSize = sizeTypes [ty1, .., tyn] See
-- Note [Solving superclass constraints] in GHC.Tc.TyCl.Instance
ScOrigin :: TypeSize -> CtOrigin
DerivClauseOrigin :: CtOrigin
DerivOriginDC :: DataCon -> Int -> Bool -> CtOrigin
DerivOriginCoerce :: Id -> Type -> Type -> Bool -> CtOrigin
StandAloneDerivOrigin :: CtOrigin
DefaultOrigin :: CtOrigin
DoOrigin :: CtOrigin
DoPatOrigin :: LPat GhcRn -> CtOrigin
MCompOrigin :: CtOrigin
MCompPatOrigin :: LPat GhcRn -> CtOrigin
IfOrigin :: CtOrigin
ProcOrigin :: CtOrigin
AnnOrigin :: CtOrigin
FunDepOrigin1 :: PredType -> CtOrigin -> RealSrcSpan -> PredType -> CtOrigin -> RealSrcSpan -> CtOrigin
FunDepOrigin2 :: PredType -> CtOrigin -> PredType -> SrcSpan -> CtOrigin
ExprHoleOrigin :: Maybe OccName -> CtOrigin
TypeHoleOrigin :: OccName -> CtOrigin
PatCheckOrigin :: CtOrigin
ListOrigin :: CtOrigin
BracketOrigin :: CtOrigin
StaticOrigin :: CtOrigin
Shouldn'tHappenOrigin :: String -> CtOrigin
InstProvidedOrigin :: Module -> ClsInst -> CtOrigin
NonLinearPatternOrigin :: CtOrigin
UsageEnvironmentOf :: Name -> CtOrigin
CycleBreakerOrigin :: CtOrigin -> CtOrigin
InstanceSigOrigin :: Name -> Type -> Type -> CtOrigin
AmbiguityCheckOrigin :: UserTypeCtxt -> CtOrigin
GhcBug20076 :: CtOrigin
toInvisibleOrigin :: CtOrigin -> CtOrigin
pprUserTypeCtxt :: UserTypeCtxt -> SDoc
pprSkolInfo :: SkolemInfo -> SDoc
pprSigSkolInfo :: UserTypeCtxt -> TcType -> SDoc
pprCtOrigin :: CtOrigin -> SDoc
-- | Extract a suitable CtOrigin from a MatchGroup
matchesCtOrigin :: MatchGroup GhcRn (LHsExpr GhcRn) -> CtOrigin
-- | Extract a suitable CtOrigin from a HsExpr
lexprCtOrigin :: LHsExpr GhcRn -> CtOrigin
isVisibleOrigin :: CtOrigin -> Bool
isSigMaybe :: UserTypeCtxt -> Maybe Name
isGivenOrigin :: CtOrigin -> Bool
-- | Extract a suitable CtOrigin from guarded RHSs
grhssCtOrigin :: GRHSs GhcRn (LHsExpr GhcRn) -> CtOrigin
exprCtOrigin :: HsExpr GhcRn -> CtOrigin
data HsParsedModule
HsParsedModule :: Located HsModule -> [FilePath] -> HsParsedModule
[hpm_module] :: HsParsedModule -> Located HsModule
-- | extra source files (e.g. from #includes). The lexer collects these
-- from '# file line' pragmas, which the C preprocessor
-- leaves behind. These files and their timestamps are stored in the .hi
-- file, so that we can force recompilation if any of them change (#3589)
[hpm_src_files] :: HsParsedModule -> [FilePath]
-- | Haskell Module
--
-- All we actually declare here is the top-level structure for a module.
data HsModule
HsModule :: EpAnn AnnsModule -> LayoutInfo -> Maybe (LocatedA ModuleName) -> Maybe (LocatedL [LIE GhcPs]) -> [LImportDecl GhcPs] -> [LHsDecl GhcPs] -> Maybe (LocatedP WarningTxt) -> Maybe LHsDocString -> HsModule
[hsmodAnn] :: HsModule -> EpAnn AnnsModule
-- | Layout info for the module. For incomplete modules (e.g. the output of
-- parseHeader), it is NoLayoutInfo.
[hsmodLayout] :: HsModule -> LayoutInfo
-- | Nothing: "module X where" is omitted (in which case the next
-- field is Nothing too)
[hsmodName] :: HsModule -> Maybe (LocatedA ModuleName)
-- | Export list
--
--
-- - Nothing: export list omitted, so export everything
-- - Just []: export nothing
-- - Just [...]: as you would expect...
-- - AnnKeywordIds : AnnOpen ,AnnClose
--
[hsmodExports] :: HsModule -> Maybe (LocatedL [LIE GhcPs])
-- | We snaffle interesting stuff out of the imported interfaces early on,
-- adding that info to TyDecls/etc; so this list is often empty,
-- downstream.
[hsmodImports] :: HsModule -> [LImportDecl GhcPs]
-- | Type, class, value, and interface signature decls
[hsmodDecls] :: HsModule -> [LHsDecl GhcPs]
-- | reason/explanation for warning/deprecation of this module
--
--
[hsmodDeprecMessage] :: HsModule -> Maybe (LocatedP WarningTxt)
-- | Haddock module info and description, unparsed
--
--
[hsmodHaddockModHeader] :: HsModule -> Maybe LHsDocString
data AnnsModule
AnnsModule :: [AddEpAnn] -> AnnList -> AnnsModule
[am_main] :: AnnsModule -> [AddEpAnn]
[am_decls] :: AnnsModule -> AnnList
data FloatBind
FloatLet :: CoreBind -> FloatBind
FloatCase :: CoreExpr -> Id -> AltCon -> [Var] -> FloatBind
-- | Applies the floats from right to left. That is wrapFloats [b1, b2,
-- …, bn] u = let b1 in let b2 in … in let bn in u
wrapFloats :: [FloatBind] -> CoreExpr -> CoreExpr
wrapFloat :: FloatBind -> CoreExpr -> CoreExpr
-- | The unit expression
unitExpr :: CoreExpr
tYPE_ERROR_ID :: Id
sortQuantVars :: [Var] -> [Var]
rUNTIME_ERROR_ID :: Id
rEC_SEL_ERROR_ID :: Id
rEC_CON_ERROR_ID :: Id
pAT_ERROR_ID :: Id
nO_METHOD_BINDING_ERROR_ID :: Id
nON_EXHAUSTIVE_GUARDS_ERROR_ID :: Id
-- | Create a CoreExpr which will evaluate to the a Word
-- with the given value
mkWordExpr :: Platform -> Integer -> CoreExpr
-- | Make a wildcard binder. This is typically used when you need a
-- binder that you expect to use only at a *binding* site. Do not use it
-- at occurrence sites because it has a single, fixed unique, and it's
-- very easy to get into difficulties with shadowing. That's why it is
-- used so little. See Note [WildCard binders] in
-- GHC.Core.Opt.Simplify.Env
mkWildValBinder :: Mult -> Type -> Id
mkWildEvBinder :: PredType -> EvVar
mkWildCase :: CoreExpr -> Scaled Type -> Type -> [CoreAlt] -> CoreExpr
-- | Create a CoreExpr which will evaluate to the given
-- Int. Don't check that the number is in the range of the
-- target platform Int
mkUncheckedIntExpr :: Integer -> CoreExpr
-- | Builds a selector which scrutises the given expression and extracts
-- the one name from the list given. If you want the no-shadowing rule to
-- apply, the caller is responsible for making sure that none of these
-- names are in scope.
--
-- If there is just one Id in the tuple, then the selector is just
-- the identity.
--
-- If necessary, we pattern match on a "big" tuple.
--
-- A tuple selector is not linear in its argument. Consequently, the case
-- expression built by mkTupleSelector must consume its scrutinee
-- Many times. And all the argument variables must have
-- multiplicity Many.
mkTupleSelector1 :: [Id] -> Id -> Id -> CoreExpr -> CoreExpr
-- | mkTupleSelector1 is like mkTupleSelector but one-tuples
-- are NOT flattened (see Note [Flattening one-tuples])
--
-- Builds a selector which scrutises the given expression and extracts
-- the one name from the list given. If you want the no-shadowing rule to
-- apply, the caller is responsible for making sure that none of these
-- names are in scope.
--
-- If there is just one Id in the tuple, then the selector is just
-- the identity.
--
-- If necessary, we pattern match on a "big" tuple.
--
-- A tuple selector is not linear in its argument. Consequently, the case
-- expression built by mkTupleSelector must consume its scrutinee
-- Many times. And all the argument variables must have
-- multiplicity Many.
mkTupleSelector :: [Id] -> Id -> Id -> CoreExpr -> CoreExpr
-- | A generalization of mkTupleSelector, allowing the body of the
-- case to be an arbitrary expression.
--
-- To avoid shadowing, we use uniques to invent new variables.
--
-- If necessary we pattern match on a "big" tuple.
mkTupleCase :: UniqSupply -> [Id] -> CoreExpr -> Id -> CoreExpr -> CoreExpr
mkStringExprFSWith :: Monad m => (Name -> m Id) -> FastString -> m CoreExpr
-- | Create a CoreExpr which will evaluate to a string morally
-- equivalent to the given FastString
mkStringExprFS :: MonadThings m => FastString -> m CoreExpr
-- | Create a CoreExpr which will evaluate to the given
-- String
mkStringExpr :: MonadThings m => String -> m CoreExpr
-- | mkSmallTupleSelector1 is like mkSmallTupleSelector but
-- one-tuples are NOT flattened (see Note [Flattening one-tuples])
--
-- Like mkTupleSelector but for tuples that are guaranteed never
-- to be "big".
--
--
-- mkSmallTupleSelector [x] x v e = [| e |]
-- mkSmallTupleSelector [x,y,z] x v e = [| case e of v { (x,y,z) -> x } |]
--
mkSmallTupleSelector :: [Id] -> Id -> Id -> CoreExpr -> CoreExpr
-- | As mkTupleCase, but for a tuple that is small enough to be
-- guaranteed not to need nesting.
mkSmallTupleCase :: [Id] -> CoreExpr -> Id -> CoreExpr -> CoreExpr
mkRuntimeErrorApp :: Id -> Type -> String -> CoreExpr
-- | Makes a Nothing for the specified type
mkNothingExpr :: Type -> CoreExpr
mkNonEmptyListExpr :: Type -> CoreExpr -> [CoreExpr] -> CoreExpr
-- | Makes a list [] for lists of the specified type
mkNilExpr :: Type -> CoreExpr
-- | Create a CoreExpr which will evaluate to the given
-- Natural
mkNaturalExpr :: Integer -> CoreExpr
-- | Make a list containing the given expressions, where the list has the
-- given type
mkListExpr :: Type -> [CoreExpr] -> CoreExpr
-- | Makes a Just from a value of the specified type
mkJustExpr :: Type -> CoreExpr -> CoreExpr
-- | Create a CoreExpr which will evaluate to the given
-- Integer
mkIntegerExpr :: Integer -> CoreExpr
-- | Create a CoreExpr which will evaluate to the given Int
mkIntExprInt :: Platform -> Int -> CoreExpr
-- | Create a CoreExpr which will evaluate to the given Int
mkIntExpr :: Platform -> Integer -> CoreExpr
mkImpossibleExpr :: Type -> CoreExpr
mkIfThenElse :: CoreExpr -> CoreExpr -> CoreExpr -> CoreExpr
-- | Make a fully applied foldr expression
mkFoldrExpr :: MonadThings m => Type -> Type -> CoreExpr -> CoreExpr -> CoreExpr -> m CoreExpr
-- | Create a CoreExpr which will evaluate to the given
-- Float
mkFloatExpr :: Float -> CoreExpr
-- | Create a CoreExpr which will evaluate to the given
-- Double
mkDoubleExpr :: Double -> CoreExpr
-- | Build the type of a small tuple that holds the specified variables
-- One-tuples are flattened; see Note [Flattening one-tuples]
mkCoreVarTupTy :: [Id] -> Type
-- | Build a small unboxed tuple holding the specified expressions, with
-- the given types. The types must be the types of the expressions. Do
-- not include the RuntimeRep specifiers; this function calculates them
-- for you. Does not flatten one-tuples; see Note [Flattening
-- one-tuples]
mkCoreUbxTup :: [Type] -> [CoreExpr] -> CoreExpr
-- | Build an unboxed sum.
--
-- Alternative number ("alt") starts from 1.
mkCoreUbxSum :: Int -> Int -> [Type] -> CoreExpr -> CoreExpr
-- | Make a core tuple of the given boxity; don't flatten 1-tuples
mkCoreTupBoxity :: Boxity -> [CoreExpr] -> CoreExpr
-- | Build a small tuple holding the specified expressions One-tuples are
-- flattened; see Note [Flattening one-tuples]
mkCoreTup :: [CoreExpr] -> CoreExpr
-- | Bind a list of binding groups over an expression. The leftmost binding
-- group becomes the outermost group in the resulting expression
mkCoreLets :: [CoreBind] -> CoreExpr -> CoreExpr
-- | Bind a binding group over an expression, using a let or
-- case as appropriate (see GHC.Core#let_app_invariant)
mkCoreLet :: CoreBind -> CoreExpr -> CoreExpr
-- | Create a lambda where the given expression has a number of variables
-- bound over it. The leftmost binder is that bound by the outermost
-- lambda in the result
mkCoreLams :: [CoreBndr] -> CoreExpr -> CoreExpr
-- | Construct an expression which represents the application of a number
-- of expressions to that of a data constructor expression. The leftmost
-- expression in the list is applied first
mkCoreConApps :: DataCon -> [CoreExpr] -> CoreExpr
-- | Construct an expression which represents the application of a number
-- of expressions to another. The leftmost expression in the list is
-- applied first Respects the let/app invariant by building a case
-- expression where necessary See Note [Core let/app invariant] in
-- GHC.Core
mkCoreApps :: CoreExpr -> [CoreExpr] -> CoreExpr
infixl 4 `mkCoreApps`
-- | Construct an expression which represents the application of one
-- expression to the other Respects the let/app invariant by building a
-- case expression where necessary See Note [Core let/app invariant] in
-- GHC.Core
mkCoreApp :: SDoc -> CoreExpr -> CoreExpr -> CoreExpr
infixl 4 `mkCoreApp`
-- | Makes a list (:) for lists of the specified type
mkConsExpr :: Type -> CoreExpr -> CoreExpr -> CoreExpr
-- | Create a CoreExpr which will evaluate to the given
-- Char
mkCharExpr :: Char -> CoreExpr
-- | Make a build expression applied to a locally-bound worker
-- function
mkBuildExpr :: (MonadFail m, MonadThings m, MonadUnique m) => Type -> ((Id, Type) -> (Id, Type) -> m CoreExpr) -> m CoreExpr
-- | Build the type of a big tuple that holds the specified variables
-- One-tuples are flattened; see Note [Flattening one-tuples]
mkBigCoreVarTupTy :: [Id] -> Type
mkBigCoreVarTup1 :: [Id] -> CoreExpr
-- | Build a big tuple holding the specified variables One-tuples are
-- flattened; see Note [Flattening one-tuples]
mkBigCoreVarTup :: [Id] -> CoreExpr
-- | Build the type of a big tuple that holds the specified type of thing
-- One-tuples are flattened; see Note [Flattening one-tuples]
mkBigCoreTupTy :: [Type] -> Type
-- | Build a big tuple holding the specified expressions One-tuples are
-- flattened; see Note [Flattening one-tuples]
mkBigCoreTup :: [CoreExpr] -> CoreExpr
mkAbsentErrorApp :: Type -> String -> CoreExpr
floatBindings :: FloatBind -> [Var]
errorIds :: [Id]
castBottomExpr :: CoreExpr -> Type -> CoreExpr
aBSENT_SUM_FIELD_ERROR_ID :: Id
aBSENT_ERROR_ID :: Id
-- | This class specifies how to collect variable identifiers from
-- extension patterns in the given pass. Consumers of the GHC API that
-- define their own passes should feel free to implement instances in
-- order to make use of functions which depend on it.
--
-- In particular, Haddock already makes use of this, with an instance for
-- its DocNameI pass so that it can reuse the code in GHC for
-- collecting binders.
class UnXRec p => CollectPass p
collectXXPat :: CollectPass p => Proxy p -> CollectFlag p -> XXPat p -> [IdP p] -> [IdP p]
-- | Indicate if evidence binders have to be collected.
--
-- This type is used as a boolean (should we collect evidence binders or
-- not?) but also to pass an evidence that the AST has been typechecked
-- when we do want to collect evidence binders, otherwise these binders
-- are not available.
--
-- See Note [Dictionary binders in ConPatOut]
data CollectFlag p
-- | Don't collect evidence binders
[CollNoDictBinders] :: forall p. CollectFlag p
-- | Collect evidence binders
[CollWithDictBinders] :: CollectFlag (GhcPass 'Typechecked)
unitRecStmtTc :: RecStmtTc
unguardedRHS :: forall (p :: Pass) body. Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpan => EpAnn GrhsAnn -> SrcSpan -> LocatedA (body (GhcPass p)) -> [LGRHS (GhcPass p) (LocatedA (body (GhcPass p)))]
unguardedGRHSs :: forall (p :: Pass) body. Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpan => SrcSpan -> LocatedA (body (GhcPass p)) -> EpAnn GrhsAnn -> GRHSs (GhcPass p) (LocatedA (body (GhcPass p)))
-- | Return the SrcSpan encompassing the contents of any enclosed
-- binds
spanHsLocaLBinds :: forall (p :: Pass). Data (HsLocalBinds (GhcPass p)) => HsLocalBinds (GhcPass p) -> SrcSpan
nl_HsVar :: forall (p :: Pass) a. IsSrcSpanAnn p a => IdP (GhcPass p) -> HsExpr (GhcPass p)
-- | Wildcard pattern - after renaming
nlWildPatName :: LPat GhcRn
-- | Wildcard pattern - after parsing
nlWildPat :: LPat GhcPs
nlWildConPat :: DataCon -> LPat GhcPs
nlVarPat :: forall (p :: Pass) a. IsSrcSpanAnn p a => IdP (GhcPass p) -> LPat (GhcPass p)
nlTuplePat :: [LPat GhcPs] -> Boxity -> LPat GhcPs
nlParPat :: forall (name :: Pass). LPat (GhcPass name) -> LPat (GhcPass name)
nlNullaryConPat :: RdrName -> LPat GhcPs
nlLitPat :: HsLit GhcPs -> LPat GhcPs
nlList :: [LHsExpr GhcPs] -> LHsExpr GhcPs
nlInfixConPat :: RdrName -> LPat GhcPs -> LPat GhcPs -> LPat GhcPs
nlHsVarApps :: forall (p :: Pass) a. IsSrcSpanAnn p a => IdP (GhcPass p) -> [IdP (GhcPass p)] -> LHsExpr (GhcPass p)
nlHsVar :: forall (p :: Pass) a. IsSrcSpanAnn p a => IdP (GhcPass p) -> LHsExpr (GhcPass p)
nlHsTyVar :: forall (p :: Pass) a. IsSrcSpanAnn p a => IdP (GhcPass p) -> LHsType (GhcPass p)
nlHsTyConApp :: forall (p :: Pass) a. IsSrcSpanAnn p a => LexicalFixity -> IdP (GhcPass p) -> [LHsTypeArg (GhcPass p)] -> LHsType (GhcPass p)
nlHsTyApps :: Id -> [Type] -> [LHsExpr GhcTc] -> LHsExpr GhcTc
nlHsTyApp :: Id -> [Type] -> LHsExpr GhcTc
nlHsSyntaxApps :: SyntaxExprTc -> [LHsExpr GhcTc] -> LHsExpr GhcTc
nlHsParTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p)
nlHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
nlHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs
nlHsLit :: forall (p :: Pass). HsLit (GhcPass p) -> LHsExpr (GhcPass p)
nlHsLam :: LMatch GhcPs (LHsExpr GhcPs) -> LHsExpr GhcPs
nlHsIntLit :: forall (p :: Pass). Integer -> LHsExpr (GhcPass p)
nlHsIf :: LHsExpr GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs
nlHsFunTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
nlHsDo :: HsStmtContext GhcRn -> [LStmt GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs
-- | NB: Only for LHsExpr Id.
nlHsDataCon :: DataCon -> LHsExpr GhcTc
nlHsCase :: LHsExpr GhcPs -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs
nlHsApps :: forall (p :: Pass) a. IsSrcSpanAnn p a => IdP (GhcPass p) -> [LHsExpr (GhcPass p)] -> LHsExpr (GhcPass p)
nlHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
nlHsAppKindTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsKind (GhcPass p) -> LHsType (GhcPass p)
nlHsApp :: forall (id :: Pass). IsPass id => LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
nlConVarPatName :: Name -> [Name] -> LPat GhcRn
nlConVarPat :: RdrName -> [RdrName] -> LPat GhcPs
nlConPatName :: Name -> [LPat GhcRn] -> LPat GhcRn
nlConPat :: RdrName -> [LPat GhcPs] -> LPat GhcPs
mkVarBind :: forall (p :: Pass). IdP (GhcPass p) -> LHsExpr (GhcPass p) -> LHsBind (GhcPass p)
mkUntypedSplice :: EpAnn [AddEpAnn] -> SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs
mkTypedSplice :: EpAnn [AddEpAnn] -> SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs
mkTransformStmt :: EpAnn [AddEpAnn] -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
mkTransformByStmt :: EpAnn [AddEpAnn] -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
-- | In Name-land, with empty bind_fvs
mkTopFunBind :: Origin -> LocatedN Name -> [LMatch GhcRn (LHsExpr GhcRn)] -> HsBind GhcRn
mkTcBindStmt :: LPat GhcTc -> LocatedA (bodyR GhcTc) -> StmtLR GhcTc GhcTc (LocatedA (bodyR GhcTc))
mkSimpleMatch :: forall (p :: Pass) body. (Anno (Match (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpanAnnA, Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpan) => HsMatchContext (NoGhcTc (GhcPass p)) -> [LPat (GhcPass p)] -> LocatedA (body (GhcPass p)) -> LMatch (GhcPass p) (LocatedA (body (GhcPass p)))
-- | Convenience function using mkFunBind. This is for generated
-- bindings only, do not use for user-written code.
mkSimpleGeneratedFunBind :: SrcSpan -> RdrName -> [LPat GhcPs] -> LHsExpr GhcPs -> LHsBind GhcPs
mkRnBindStmt :: LPat GhcRn -> LocatedA (bodyR GhcRn) -> StmtLR GhcRn GhcRn (LocatedA (bodyR GhcRn))
mkRecStmt :: forall (idL :: Pass) bodyR. Anno [GenLocated (Anno (StmtLR (GhcPass idL) GhcPs bodyR)) (StmtLR (GhcPass idL) GhcPs bodyR)] ~ SrcSpanAnnL => EpAnn AnnList -> LocatedL [LStmtLR (GhcPass idL) GhcPs bodyR] -> StmtLR (GhcPass idL) GhcPs bodyR
mkPsBindStmt :: EpAnn [AddEpAnn] -> LPat GhcPs -> LocatedA (bodyR GhcPs) -> StmtLR GhcPs GhcPs (LocatedA (bodyR GhcPs))
-- | Make a prefix, non-strict function HsMatchContext
mkPrefixFunRhs :: LIdP p -> HsMatchContext p
mkPatSynBind :: LocatedN RdrName -> HsPatSynDetails GhcPs -> LPat GhcPs -> HsPatSynDir GhcPs -> EpAnn [AddEpAnn] -> HsBind GhcPs
mkParPat :: forall (p :: Pass). IsPass p => LPat (GhcPass p) -> LPat (GhcPass p)
mkNPlusKPat :: LocatedN RdrName -> Located (HsOverLit GhcPs) -> EpAnn EpaLocation -> Pat GhcPs
mkNPat :: Located (HsOverLit GhcPs) -> Maybe (SyntaxExpr GhcPs) -> EpAnn [AddEpAnn] -> Pat GhcPs
mkMatchGroup :: forall (p :: Pass) body. AnnoBody p body => Origin -> LocatedL [LocatedA (Match (GhcPass p) (LocatedA (body (GhcPass p))))] -> MatchGroup (GhcPass p) (LocatedA (body (GhcPass p)))
mkMatch :: forall (p :: Pass). IsPass p => HsMatchContext (NoGhcTc (GhcPass p)) -> [LPat (GhcPass p)] -> LHsExpr (GhcPass p) -> HsLocalBinds (GhcPass p) -> LMatch (GhcPass p) (LHsExpr (GhcPass p))
mkLocatedList :: Semigroup a => [GenLocated (SrcAnn a) e2] -> LocatedAn an [GenLocated (SrcAnn a) e2]
mkLetStmt :: EpAnn [AddEpAnn] -> HsLocalBinds GhcPs -> StmtLR GhcPs GhcPs (LocatedA b)
mkLastStmt :: forall (idR :: Pass) bodyR (idL :: Pass). IsPass idR => LocatedA (bodyR (GhcPass idR)) -> StmtLR (GhcPass idL) (GhcPass idR) (LocatedA (bodyR (GhcPass idR)))
mkLHsWrapCo :: TcCoercionN -> LHsExpr GhcTc -> LHsExpr GhcTc
mkLHsWrap :: HsWrapper -> LHsExpr GhcTc -> LHsExpr GhcTc
mkLHsVarTuple :: forall (p :: Pass) a. IsSrcSpanAnn p a => [IdP (GhcPass p)] -> XExplicitTuple (GhcPass p) -> LHsExpr (GhcPass p)
mkLHsTupleExpr :: forall (p :: Pass). [LHsExpr (GhcPass p)] -> XExplicitTuple (GhcPass p) -> LHsExpr (GhcPass p)
-- | Wrap in parens if hsExprNeedsParens appPrec says it
-- needs them So f x becomes (f x), but 3
-- stays as 3.
mkLHsPar :: forall (id :: Pass). IsPass id => LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
mkLHsCmdWrap :: HsWrapper -> LHsCmd GhcTc -> LHsCmd GhcTc
mkHsWrapPatCo :: TcCoercionN -> Pat GhcTc -> Type -> Pat GhcTc
mkHsWrapPat :: HsWrapper -> Pat GhcTc -> Type -> Pat GhcTc
mkHsWrapCoR :: TcCoercionR -> HsExpr GhcTc -> HsExpr GhcTc
mkHsWrapCo :: TcCoercionN -> HsExpr GhcTc -> HsExpr GhcTc
-- | Avoid HsWrap co1 (HsWrap co2 _) and
-- HsWrap co1 (HsPar _ _) See Note [Detecting
-- forced eta expansion] in GHC.HsToCore.Expr
mkHsWrap :: HsWrapper -> HsExpr GhcTc -> HsExpr GhcTc
mkHsVarBind :: SrcSpan -> RdrName -> LHsExpr GhcPs -> LHsBind GhcPs
mkHsStringPrimLit :: forall (p :: Pass). FastString -> HsLit (GhcPass p)
mkHsString :: forall (p :: Pass). String -> HsLit (GhcPass p)
mkHsSigEnv :: (LSig GhcRn -> Maybe ([LocatedN Name], a)) -> [LSig GhcRn] -> NameEnv a
mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs
-- |
-- e => (e)
--
mkHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
-- | A useful function for building OpApps. The operator is always
-- a variable, and we don't know the fixity yet.
mkHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs
mkHsLams :: [TyVar] -> [EvVar] -> LHsExpr GhcTc -> LHsExpr GhcTc
mkHsLam :: forall (p :: Pass). (IsPass p, XMG (GhcPass p) (LHsExpr (GhcPass p)) ~ NoExtField) => [LPat (GhcPass p)] -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
mkHsIsString :: SourceText -> FastString -> HsOverLit GhcPs
mkHsIntegral :: IntegralLit -> HsOverLit GhcPs
mkHsIf :: LHsExpr GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs -> EpAnn AnnsIf -> HsExpr GhcPs
mkHsFractional :: FractionalLit -> HsOverLit GhcPs
mkHsDoAnns :: HsStmtContext GhcRn -> LocatedL [ExprLStmt GhcPs] -> EpAnn AnnList -> HsExpr GhcPs
mkHsDo :: HsStmtContext GhcRn -> LocatedL [ExprLStmt GhcPs] -> HsExpr GhcPs
mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
mkHsCompAnns :: HsStmtContext GhcRn -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> EpAnn AnnList -> HsExpr GhcPs
mkHsComp :: HsStmtContext GhcRn -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> HsExpr GhcPs
mkHsCmdWrap :: HsWrapper -> HsCmd GhcTc -> HsCmd GhcTc
mkHsCmdIf :: LHsExpr GhcPs -> LHsCmd GhcPs -> LHsCmd GhcPs -> EpAnn AnnsIf -> HsCmd GhcPs
mkHsCharPrimLit :: forall (p :: Pass). Char -> HsLit (GhcPass p)
-- | A simple case alternative with a single pattern, no binds, no guards;
-- pre-typechecking
mkHsCaseAlt :: forall (p :: Pass) body. (Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpan, Anno (Match (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpanAnnA) => LPat (GhcPass p) -> LocatedA (body (GhcPass p)) -> LMatch (GhcPass p) (LocatedA (body (GhcPass p)))
mkHsAppsWith :: forall (id :: Pass). (LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> HsExpr (GhcPass id) -> LHsExpr (GhcPass id)) -> LHsExpr (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
mkHsApps :: forall (id :: Pass). LHsExpr (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
mkHsAppWith :: forall (id :: Pass). (LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> HsExpr (GhcPass id) -> LHsExpr (GhcPass id)) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
mkHsAppTypes :: LHsExpr GhcRn -> [LHsWcType GhcRn] -> LHsExpr GhcRn
mkHsAppType :: LHsExpr GhcRn -> LHsWcType GhcRn -> LHsExpr GhcRn
mkHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
mkGroupUsingStmt :: EpAnn [AddEpAnn] -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
mkGroupByUsingStmt :: EpAnn [AddEpAnn] -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
-- | Not infix, with place holders for coercion and free vars
mkFunBind :: Origin -> LocatedN RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> HsBind GhcPs
-- | Convert TypeSig to ClassOpSig. The former is what is
-- parsed, but the latter is what we need in class/instance declarations
mkClassOpSigs :: [LSig GhcPs] -> [LSig GhcPs]
-- | Lifts a "small" constructor into a "big" constructor by recursive
-- decomposition
mkChunkified :: ([a] -> a) -> [a] -> a
mkBodyStmt :: forall bodyR (idL :: Pass). LocatedA (bodyR GhcPs) -> StmtLR (GhcPass idL) GhcPs (LocatedA (bodyR GhcPs))
-- | The Big equivalents for the source tuple expressions
mkBigLHsVarTup :: forall (p :: Pass) a. IsSrcSpanAnn p a => [IdP (GhcPass p)] -> XExplicitTuple (GhcPass p) -> LHsExpr (GhcPass p)
-- | The Big equivalents for the source tuple patterns
mkBigLHsVarPatTup :: [IdP GhcRn] -> LPat GhcRn
mkBigLHsTup :: forall (id :: Pass). [LHsExpr (GhcPass id)] -> XExplicitTuple (GhcPass id) -> LHsExpr (GhcPass id)
mkBigLHsPatTup :: [LPat GhcRn] -> LPat GhcRn
missingTupArg :: EpAnn EpaLocation -> HsTupArg GhcPs
lStmtsImplicits :: forall (idR :: Pass) (body :: Type -> Type). [LStmtLR GhcRn (GhcPass idR) (LocatedA (body (GhcPass idR)))] -> [(SrcSpan, [Name])]
lPatImplicits :: LPat GhcRn -> [(SrcSpan, [Name])]
-- | Should we treat this as an unlifted bind? This will be true for any
-- bind that binds an unlifted variable, but we must be careful around
-- AbsBinds. See Note [Unlifted id check in isUnliftedHsBind]. For usage
-- information, see Note [Strict binds checks] is GHC.HsToCore.Binds.
isUnliftedHsBind :: HsBind GhcTc -> Bool
-- | If any of the matches in the FunBind are infix, the
-- FunBind is considered infix.
isInfixFunBind :: forall id1 id2. UnXRec id2 => HsBindLR id1 id2 -> Bool
-- | Is a binding a strict variable or pattern bind (e.g. !x =
-- ...)?
isBangedHsBind :: HsBind GhcTc -> Bool
hsValBindsImplicits :: forall (idR :: Pass). HsValBindsLR GhcRn (GhcPass idR) -> [(SrcSpan, [Name])]
-- | Convert an LHsType to an LHsSigWcType.
hsTypeToHsSigWcType :: LHsType GhcPs -> LHsSigWcType GhcPs
-- | Convert an LHsType to an LHsSigType.
hsTypeToHsSigType :: LHsType GhcPs -> LHsSigType GhcPs
hsTyClForeignBinders :: [TyClGroup GhcRn] -> [LForeignDecl GhcRn] -> [Name]
-- | Collects record pattern-synonym selectors only; the pattern synonym
-- names are collected by collectHsValBinders.
hsPatSynSelectors :: forall (p :: Pass). IsPass p => HsValBinds (GhcPass p) -> [FieldOcc (GhcPass p)]
-- | Returns all the binding names of the decl. The first one is
-- guaranteed to be the name of the decl. The first component represents
-- all binding names except record fields; the second represents field
-- occurrences. For record fields mentioned in multiple constructors, the
-- SrcLoc will be from the first occurrence.
--
-- Each returned (Located name) has a SrcSpan for the whole
-- declaration. See Note [SrcSpan for binders]
hsLTyClDeclBinders :: forall (p :: Pass). IsPass p => LocatedA (TyClDecl (GhcPass p)) -> ([LocatedA (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
hsGroupBinders :: HsGroup GhcRn -> [Name]
-- | See Note [SrcSpan for binders]
hsForeignDeclsBinders :: forall (p :: Pass) a. (UnXRec (GhcPass p), IsSrcSpanAnn p a) => [LForeignDecl (GhcPass p)] -> [LIdP (GhcPass p)]
-- | the SrcLoc returned are for the whole declarations, not just
-- the names
hsDataFamInstBinders :: forall (p :: Pass). IsPass p => DataFamInstDecl (GhcPass p) -> ([LocatedA (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
getPatSynBinds :: UnXRec id => [(RecFlag, LHsBinds id)] -> [PatSynBind id id]
emptyTransStmt :: EpAnn [AddEpAnn] -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
emptyRecStmtName :: Anno [GenLocated (Anno (StmtLR GhcRn GhcRn bodyR)) (StmtLR GhcRn GhcRn bodyR)] ~ SrcSpanAnnL => StmtLR GhcRn GhcRn bodyR
emptyRecStmtId :: Stmt GhcTc (LocatedA (HsCmd GhcTc))
emptyRecStmt :: forall (idL :: Pass) bodyR. Anno [GenLocated (Anno (StmtLR (GhcPass idL) GhcPs bodyR)) (StmtLR (GhcPass idL) GhcPs bodyR)] ~ SrcSpanAnnL => StmtLR (GhcPass idL) GhcPs bodyR
collectStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. CollectPass (GhcPass idL) => CollectFlag (GhcPass idL) -> [StmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]
collectStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. CollectPass (GhcPass idL) => CollectFlag (GhcPass idL) -> StmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
collectPatsBinders :: CollectPass p => CollectFlag p -> [LPat p] -> [IdP p]
collectPatBinders :: CollectPass p => CollectFlag p -> LPat p -> [IdP p]
-- | Used exclusively for the bindings of an instance decl which are all
-- FunBinds
collectMethodBinders :: UnXRec idL => LHsBindsLR idL idR -> [LIdP idL]
collectLocalBinders :: forall (idL :: Pass) (idR :: Pass). CollectPass (GhcPass idL) => CollectFlag (GhcPass idL) -> HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
collectLStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. CollectPass (GhcPass idL) => CollectFlag (GhcPass idL) -> [LStmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]
collectLStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. CollectPass (GhcPass idL) => CollectFlag (GhcPass idL) -> LStmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
collectHsValBinders :: forall (idL :: Pass) (idR :: Pass). CollectPass (GhcPass idL) => CollectFlag (GhcPass idL) -> HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
-- | Collect Id binders only, or Ids + pattern synonyms,
-- respectively
collectHsIdBinders :: forall (idL :: Pass) (idR :: Pass). CollectPass (GhcPass idL) => CollectFlag (GhcPass idL) -> HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
collectHsBindsBinders :: CollectPass p => CollectFlag p -> LHsBindsLR p idR -> [IdP p]
-- | Same as collectHsBindsBinders, but works over a list of
-- bindings
collectHsBindListBinders :: CollectPass p => CollectFlag p -> [LHsBindLR p idR] -> [IdP p]
-- | Collect both Ids and pattern-synonym binders
collectHsBindBinders :: CollectPass p => CollectFlag p -> HsBindLR p idR -> [IdP p]
-- | Split a list into lists that are small enough to have a corresponding
-- tuple arity. The sub-lists of the result all have length <=
-- mAX_TUPLE_SIZE But there may be more than mAX_TUPLE_SIZE
-- sub-lists
chunkify :: [a] -> [[a]]
data XXExprGhcTc
WrapExpr :: {-# UNPACK #-} !HsWrap HsExpr -> XXExprGhcTc
ExpansionExpr :: {-# UNPACK #-} !HsExpansion (HsExpr GhcRn) (HsExpr GhcTc) -> XXExprGhcTc
data XBindStmtTc
XBindStmtTc :: SyntaxExpr GhcTc -> Type -> Mult -> FailOperator GhcTc -> XBindStmtTc
[xbstc_bindOp] :: XBindStmtTc -> SyntaxExpr GhcTc
[xbstc_boundResultType] :: XBindStmtTc -> Type
[xbstc_boundResultMult] :: XBindStmtTc -> Mult
[xbstc_failOp] :: XBindStmtTc -> FailOperator GhcTc
data XBindStmtRn
XBindStmtRn :: SyntaxExpr GhcRn -> FailOperator GhcRn -> XBindStmtRn
[xbsrn_bindOp] :: XBindStmtRn -> SyntaxExpr GhcRn
[xbsrn_failOp] :: XBindStmtRn -> FailOperator GhcRn
-- | An expression with wrappers, used for rebindable syntax
--
-- This should desugar to
--
--
-- syn_res_wrap $ syn_expr (syn_arg_wraps[0] arg0)
-- (syn_arg_wraps[1] arg1) ...
--
--
-- where the actual arguments come from elsewhere in the AST.
data SyntaxExprTc
SyntaxExprTc :: HsExpr GhcTc -> [HsWrapper] -> HsWrapper -> SyntaxExprTc
[syn_expr] :: SyntaxExprTc -> HsExpr GhcTc
[syn_arg_wraps] :: SyntaxExprTc -> [HsWrapper]
[syn_res_wrap] :: SyntaxExprTc -> HsWrapper
NoSyntaxExprTc :: SyntaxExprTc
-- | The function to use in rebindable syntax. See Note [NoSyntaxExpr].
data SyntaxExprRn
SyntaxExprRn :: HsExpr GhcRn -> SyntaxExprRn
NoSyntaxExprRn :: SyntaxExprRn
type family SyntaxExprGhc (p :: Pass) = (r :: Type) | r -> p
-- | Extra data fields for a RecordUpd, added by the type checker
data RecordUpdTc
RecordUpdTc :: [ConLike] -> [Type] -> [Type] -> HsWrapper -> RecordUpdTc
[rupd_cons] :: RecordUpdTc -> [ConLike]
[rupd_in_tys] :: RecordUpdTc -> [Type]
[rupd_out_tys] :: RecordUpdTc -> [Type]
[rupd_wrap] :: RecordUpdTc -> HsWrapper
data RecStmtTc
RecStmtTc :: Type -> [PostTcExpr] -> [PostTcExpr] -> Type -> RecStmtTc
[recS_bind_ty] :: RecStmtTc -> Type
[recS_later_rets] :: RecStmtTc -> [PostTcExpr]
[recS_rec_rets] :: RecStmtTc -> [PostTcExpr]
[recS_ret_ty] :: RecStmtTc -> Type
-- | Post-Type checking Table
--
-- We use a PostTcTable where there are a bunch of pieces of evidence,
-- more than is convenient to keep individually.
type PostTcTable = [(Name, PostTcExpr)]
-- | Post-Type checking Expression
--
-- PostTcExpr is an evidence expression attached to the syntax tree by
-- the type checker (c.f. postTcType).
type PostTcExpr = HsExpr GhcTc
-- | Pending Type-checker Splice
data PendingTcSplice
PendingTcSplice :: SplicePointName -> LHsExpr GhcTc -> PendingTcSplice
-- | Pending Renamer Splice
data PendingRnSplice
PendingRnSplice :: UntypedSpliceFlavour -> SplicePointName -> LHsExpr GhcRn -> PendingRnSplice
-- | HsWrap appears only in typechecker output Invariant: The contained
-- Expr is *NOT* itself an HsWrap. See Note [Detecting forced eta
-- expansion] in GHC.HsToCore.Expr. This invariant is maintained
-- by mkHsWrap. hs_syn is something like HsExpr or HsCmd
data HsWrap (hs_syn :: Type -> Type)
HsWrap :: HsWrapper -> hs_syn GhcTc -> HsWrap (hs_syn :: Type -> Type)
newtype HsSplicedT
HsSplicedT :: DelayedSplice -> HsSplicedT
data HsExpansion a b
HsExpanded :: a -> b -> HsExpansion a b
data GrhsAnn
GrhsAnn :: Maybe EpaLocation -> AddEpAnn -> GrhsAnn
[ga_vbar] :: GrhsAnn -> Maybe EpaLocation
-- | Match separator location
[ga_sep] :: GrhsAnn -> AddEpAnn
data EpAnnUnboundVar
EpAnnUnboundVar :: (EpaLocation, EpaLocation) -> EpaLocation -> EpAnnUnboundVar
[hsUnboundBackquotes] :: EpAnnUnboundVar -> (EpaLocation, EpaLocation)
[hsUnboundHole] :: EpAnnUnboundVar -> EpaLocation
data EpAnnHsCase
EpAnnHsCase :: EpaLocation -> EpaLocation -> [AddEpAnn] -> EpAnnHsCase
[hsCaseAnnCase] :: EpAnnHsCase -> EpaLocation
[hsCaseAnnOf] :: EpAnnHsCase -> EpaLocation
[hsCaseAnnsRest] :: EpAnnHsCase -> [AddEpAnn]
data DelayedSplice
DelayedSplice :: TcLclEnv -> LHsExpr GhcRn -> TcType -> LHsExpr GhcTc -> DelayedSplice
data CmdTopTc
CmdTopTc :: Type -> Type -> CmdSyntaxTable GhcTc -> CmdTopTc
data AnnsLet
AnnsLet :: EpaLocation -> EpaLocation -> AnnsLet
[alLet] :: AnnsLet -> EpaLocation
[alIn] :: AnnsLet -> EpaLocation
data AnnsIf
AnnsIf :: EpaLocation -> EpaLocation -> EpaLocation -> Maybe EpaLocation -> Maybe EpaLocation -> AnnsIf
[aiIf] :: AnnsIf -> EpaLocation
[aiThen] :: AnnsIf -> EpaLocation
[aiElse] :: AnnsIf -> EpaLocation
[aiThenSemi] :: AnnsIf -> Maybe EpaLocation
[aiElseSemi] :: AnnsIf -> Maybe EpaLocation
data AnnProjection
AnnProjection :: EpaLocation -> EpaLocation -> AnnProjection
-- | '('
[apOpen] :: AnnProjection -> EpaLocation
-- | ')'
[apClose] :: AnnProjection -> EpaLocation
data AnnFieldLabel
AnnFieldLabel :: Maybe EpaLocation -> AnnFieldLabel
[afDot] :: AnnFieldLabel -> Maybe EpaLocation
data AnnExplicitSum
AnnExplicitSum :: EpaLocation -> [EpaLocation] -> [EpaLocation] -> EpaLocation -> AnnExplicitSum
[aesOpen] :: AnnExplicitSum -> EpaLocation
[aesBarsBefore] :: AnnExplicitSum -> [EpaLocation]
[aesBarsAfter] :: AnnExplicitSum -> [EpaLocation]
[aesClose] :: AnnExplicitSum -> EpaLocation
tupArgPresent :: forall (p :: Pass). HsTupArg (GhcPass p) -> Bool
thTyBrackets :: SDoc -> SDoc
thBrackets :: SDoc -> SDoc -> SDoc
stripParensLHsExpr :: forall (p :: Pass). LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
stripParensHsExpr :: forall (p :: Pass). HsExpr (GhcPass p) -> HsExpr (GhcPass p)
ppr_splice_decl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
ppr_splice :: forall (p :: Pass). OutputableBndrId p => SDoc -> IdP (GhcPass p) -> LHsExpr (GhcPass p) -> SDoc -> SDoc
ppr_quasi :: OutputableBndr p => p -> p -> FastString -> SDoc
ppr_module_name_prefix :: Maybe ModuleName -> SDoc
ppr_lexpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
ppr_lcmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
ppr_infix_expr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> Maybe SDoc
ppr_expr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> SDoc
ppr_do_stmts :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Anno (StmtLR (GhcPass idL) (GhcPass idR) body) ~ SrcSpanAnnA, Outputable body) => [LStmtLR (GhcPass idL) (GhcPass idR) body] -> SDoc
ppr_cmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
ppr_apps :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> [Either (LHsExpr (GhcPass p)) (LHsWcType (NoGhcTc (GhcPass p)))] -> SDoc
pprTransformStmt :: forall (p :: Pass). OutputableBndrId p => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) -> Maybe (LHsExpr (GhcPass p)) -> SDoc
pprTransStmt :: Outputable body => Maybe body -> body -> TransForm -> SDoc
pprStmtInCtxt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body, Anno (StmtLR (GhcPass idL) (GhcPass idR) body) ~ SrcSpanAnnA) => HsStmtContext (GhcPass idL) -> StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
pprStmt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Anno (StmtLR (GhcPass idL) (GhcPass idR) body) ~ SrcSpanAnnA, Outputable body) => StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
pprQuals :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body, Anno (StmtLR (GhcPass p) (GhcPass p) body) ~ SrcSpanAnnA) => [LStmt (GhcPass p) body] -> SDoc
pprPendingSplice :: forall (p :: Pass). OutputableBndrId p => SplicePointName -> LHsExpr (GhcPass p) -> SDoc
pprParendLExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
pprParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> HsExpr (GhcPass p) -> SDoc
pprMatches :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => MatchGroup (GhcPass idR) body -> SDoc
pprMatchInCtxt :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => Match (GhcPass idR) body -> SDoc
pprMatch :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => Match (GhcPass idR) body -> SDoc
pprLCmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
pprHsBracket :: forall (p :: Pass). OutputableBndrId p => HsBracket (GhcPass p) -> SDoc
pprGRHSs :: forall (idR :: Pass) body passL. (OutputableBndrId idR, Outputable body) => HsMatchContext passL -> GRHSs (GhcPass idR) body -> SDoc
pprGRHS :: forall (idR :: Pass) body passL. (OutputableBndrId idR, Outputable body) => HsMatchContext passL -> GRHS (GhcPass idR) body -> SDoc
pprDo :: forall (p :: Pass) body any. (OutputableBndrId p, Outputable body, Anno (StmtLR (GhcPass p) (GhcPass p) body) ~ SrcSpanAnnA) => HsStmtContext any -> [LStmt (GhcPass p) body] -> SDoc
pprDebugParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
pprComp :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body, Anno (StmtLR (GhcPass p) (GhcPass p) body) ~ SrcSpanAnnA) => [LStmt (GhcPass p) body] -> SDoc
pprCmdArg :: forall (p :: Pass). OutputableBndrId p => HsCmdTop (GhcPass p) -> SDoc
pprCmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
pprBy :: Outputable body => Maybe body -> SDoc
pprBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
pprBindStmt :: (Outputable pat, Outputable expr) => pat -> expr -> SDoc
pprArg :: forall (idL :: Pass). OutputableBndrId idL => ApplicativeArg (GhcPass idL) -> SDoc
pp_rhs :: Outputable body => HsMatchContext passL -> body -> SDoc
pp_dotdot :: SDoc
-- | parenthesizeHsExpr p e checks if
-- hsExprNeedsParens p e is true, and if so, surrounds
-- e with an HsPar. Otherwise, it simply returns
-- e.
parenthesizeHsExpr :: forall (p :: Pass). IsPass p => PprPrec -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
noSyntaxExpr :: forall (p :: Pass). IsPass p => SyntaxExpr (GhcPass p)
-- | This is used for rebindable-syntax pieces that are too polymorphic for
-- tcSyntaxOp (trS_fmap and the mzip in ParStmt)
noExpr :: forall (p :: Pass). HsExpr (GhcPass p)
-- | Make a 'SyntaxExpr GhcRn' from an expression Used only in
-- getMonadFailOp. See Note [Monad fail : Rebindable syntax, overloaded
-- strings] in GHC.Rename.Expr
mkSyntaxExpr :: HsExpr GhcRn -> SyntaxExprRn
-- | Make a SyntaxExpr from a Name (the "rn" is because this
-- is used in the renamer).
mkRnSyntaxExpr :: Name -> SyntaxExprRn
matchGroupArity :: forall (id :: Pass) body. MatchGroup (GhcPass id) body -> Arity
matchContextErrString :: forall (p :: Pass). OutputableBndrId p => HsMatchContext (GhcPass p) -> SDoc
matchArrowContextErrString :: HsArrowMatchContext -> SDoc
-- | Is there only one RHS in this list of matches?
isSingletonMatchGroup :: forall (p :: Pass) body. [LMatch (GhcPass p) body] -> Bool
isQuietHsExpr :: HsExpr id -> Bool
isQuietHsCmd :: HsCmd id -> Bool
isEmptyMatchGroup :: forall (p :: Pass) body. MatchGroup (GhcPass p) body -> Bool
isAtomicHsExpr :: forall (p :: Pass). IsPass p => HsExpr (GhcPass p) -> Bool
hsLMatchPats :: forall (id :: Pass) body. LMatch (GhcPass id) body -> [LPat (GhcPass id)]
-- | hsExprNeedsParens p e returns True if the
-- expression e needs parentheses under precedence p.
hsExprNeedsParens :: forall (p :: Pass). IsPass p => PprPrec -> HsExpr (GhcPass p) -> Bool
data XViaStrategyPs
XViaStrategyPs :: EpAnn [AddEpAnn] -> LHsSigType GhcPs -> XViaStrategyPs
data HsRuleAnn
HsRuleAnn :: Maybe (AddEpAnn, AddEpAnn) -> Maybe (AddEpAnn, AddEpAnn) -> [AddEpAnn] -> HsRuleAnn
-- | The locations of forall and . for forall'd type vars
-- Using AddEpAnn to capture possible unicode variants
[ra_tyanns] :: HsRuleAnn -> Maybe (AddEpAnn, AddEpAnn)
-- | The locations of forall and . for forall'd term vars
-- Using AddEpAnn to capture possible unicode variants
[ra_tmanns] :: HsRuleAnn -> Maybe (AddEpAnn, AddEpAnn)
[ra_rest] :: HsRuleAnn -> [AddEpAnn]
tyFamInstDeclName :: forall (p :: Pass). Anno (IdGhcP p) ~ SrcSpanAnnN => TyFamInstDecl (GhcPass p) -> IdP (GhcPass p)
tyFamInstDeclLName :: forall (p :: Pass). Anno (IdGhcP p) ~ SrcSpanAnnN => TyFamInstDecl (GhcPass p) -> LocatedN (IdP (GhcPass p))
tyClDeclLName :: forall (p :: Pass). Anno (IdGhcP p) ~ SrcSpanAnnN => TyClDecl (GhcPass p) -> LocatedN (IdP (GhcPass p))
tcdName :: forall (p :: Pass). Anno (IdGhcP p) ~ SrcSpanAnnN => TyClDecl (GhcPass p) -> IdP (GhcPass p)
standaloneKindSigName :: forall (p :: Pass). StandaloneKindSig (GhcPass p) -> IdP (GhcPass p)
roleAnnotDeclName :: forall (p :: Pass). RoleAnnotDecl (GhcPass p) -> IdP (GhcPass p)
-- | Maybe return name of the result type variable
resultVariableName :: forall (a :: Pass). FamilyResultSig (GhcPass a) -> Maybe (IdP (GhcPass a))
pprTyFamInstDecl :: forall (p :: Pass). OutputableBndrId p => TopLevelFlag -> TyFamInstDecl (GhcPass p) -> SDoc
pprTyClDeclFlavour :: forall (p :: Pass). TyClDecl (GhcPass p) -> SDoc
pprHsFamInstLHS :: forall (p :: Pass). OutputableBndrId p => IdP (GhcPass p) -> HsOuterFamEqnTyVarBndrs (GhcPass p) -> HsTyPats (GhcPass p) -> LexicalFixity -> Maybe (LHsContext (GhcPass p)) -> SDoc
pprDataFamInstFlavour :: forall (p :: Pass). DataFamInstDecl (GhcPass p) -> SDoc
-- | Partition a list of HsDecls into function/pattern bindings,
-- signatures, type family declarations, type family instances, and
-- documentation comments.
--
-- Panics when given a declaration that cannot be put into any of the
-- output groups.
--
-- The primary use of this function is to implement
-- cvBindsAndSigs.
partitionBindsAndSigs :: [LHsDecl GhcPs] -> (LHsBinds GhcPs, [LSig GhcPs], [LFamilyDecl GhcPs], [LTyFamInstDecl GhcPs], [LDataFamInstDecl GhcPs], [LDocDecl GhcPs])
-- | Map over the via type if dealing with ViaStrategy.
-- Otherwise, return the DerivStrategy unchanged.
mapDerivStrategy :: forall p (pass :: Pass). p ~ GhcPass pass => (XViaStrategy p -> XViaStrategy p) -> DerivStrategy p -> DerivStrategy p
instDeclDataFamInsts :: forall (p :: Pass). [LInstDecl (GhcPass p)] -> [DataFamInstDecl (GhcPass p)]
-- | The fixity signatures for each top-level declaration and class method
-- in an HsGroup. See Note [Top-level fixity signatures in an
-- HsGroup]
hsGroupTopLevelFixitySigs :: forall (p :: Pass). HsGroup (GhcPass p) -> [LFixitySig (GhcPass p)]
-- | Does this declaration have a complete, user-supplied kind signature?
-- See Note [CUSKs: complete user-supplied kind signatures]
hsDeclHasCusk :: TyClDecl GhcRn -> Bool
hsConDeclTheta :: forall (p :: Pass). Maybe (LHsContext (GhcPass p)) -> [LHsType (GhcPass p)]
-- | Return Just fields if a data constructor declaration
-- uses record syntax (i.e., RecCon), where fields are
-- the field selectors. Otherwise, return Nothing.
getRecConArgs_maybe :: ConDecl GhcRn -> Maybe (LocatedL [LConDeclField GhcRn])
getConNames :: ConDecl GhcRn -> [LocatedN Name]
-- | Eliminate a DerivStrategy.
foldDerivStrategy :: forall p (pass :: Pass) r. p ~ GhcPass pass => r -> (XViaStrategy p -> r) -> DerivStrategy p -> r
flattenRuleDecls :: forall (p :: Pass). [LRuleDecls (GhcPass p)] -> [LRuleDecl (GhcPass p)]
familyDeclName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> IdP (GhcPass p)
familyDeclLName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> XRec (GhcPass p) (IdP (GhcPass p))
famResultKindSignature :: forall (p :: Pass). FamilyResultSig (GhcPass p) -> Maybe (LHsKind (GhcPass p))
emptyRnGroup :: forall (p :: Pass). HsGroup (GhcPass p)
emptyRdrGroup :: forall (p :: Pass). HsGroup (GhcPass p)
appendGroups :: forall (p :: Pass). HsGroup (GhcPass p) -> HsGroup (GhcPass p) -> HsGroup (GhcPass p)
data ListPatTc
ListPatTc :: Type -> Maybe (Type, SyntaxExpr GhcTc) -> ListPatTc
data EpAnnSumPat
EpAnnSumPat :: [AddEpAnn] -> [EpaLocation] -> [EpaLocation] -> EpAnnSumPat
[sumPatParens] :: EpAnnSumPat -> [AddEpAnn]
[sumPatVbarsBefore] :: EpAnnSumPat -> [EpaLocation]
[sumPatVbarsAfter] :: EpAnnSumPat -> [EpaLocation]
-- | This is the extension field for ConPat, added after typechecking It
-- adds quite a few extra fields, to support elaboration of pattern
-- matching.
data ConPatTc
ConPatTc :: [Type] -> [TyVar] -> [EvVar] -> TcEvBinds -> HsWrapper -> ConPatTc
-- | The universal arg types 1-1 with the universal tyvars of the
-- constructor/pattern synonym Use (conLikeResTy pat_con cpt_arg_tys) to
-- get the type of the pattern
[cpt_arg_tys] :: ConPatTc -> [Type]
-- | Existentially bound type variables in correctly-scoped order e.g. [k:*
-- x:k]
[cpt_tvs] :: ConPatTc -> [TyVar]
-- | Ditto *coercion variables* and *dictionaries* One reason for putting
-- coercion variable here I think is to ensure their kinds are zonked
[cpt_dicts] :: ConPatTc -> [EvVar]
-- | Bindings involving those dictionaries
[cpt_binds] :: ConPatTc -> TcEvBinds
[cpt_wrap] :: ConPatTc -> HsWrapper
-- | Coercion Pattern (translation only)
--
-- During desugaring a (CoPat co pat) turns into a cast with co
-- on the scrutinee, followed by a match on pat.
data CoPat
CoPat :: HsWrapper -> Pat GhcTc -> Type -> CoPat
-- | Coercion Pattern If co :: t1 ~ t2, p :: t2, then (CoPat co p) :: t1
[co_cpt_wrap] :: CoPat -> HsWrapper
-- | Why not LPat? Ans: existing locn will do
[co_pat_inner] :: CoPat -> Pat GhcTc
-- | Type of whole pattern, t1
[co_pat_ty] :: CoPat -> Type
pprParendLPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LPat (GhcPass p) -> SDoc
pprConArgs :: forall (p :: Pass). (OutputableBndrId p, Outputable (Anno (IdGhcP p))) => HsConPatDetails (GhcPass p) -> SDoc
-- | patNeedsParens p pat returns True if the
-- pattern pat needs parentheses under precedence p.
patNeedsParens :: forall (p :: Pass). IsPass p => PprPrec -> Pat (GhcPass p) -> Bool
-- | parenthesizePat p pat checks if
-- patNeedsParens p pat is true, and if so, surrounds
-- pat with a ParPat. Otherwise, it simply returns
-- pat.
parenthesizePat :: forall (p :: Pass). IsPass p => PprPrec -> LPat (GhcPass p) -> LPat (GhcPass p)
mkPrefixConPat :: DataCon -> [LPat GhcTc] -> [Type] -> LPat GhcTc
mkNilPat :: Type -> LPat GhcTc
mkCharLitPat :: SourceText -> Char -> LPat GhcTc
looksLazyPatBind :: forall (p :: Pass). HsBind (GhcPass p) -> Bool
-- | Is the pattern any of combination of:
--
--
-- - (pat)
-- - pat :: Type
-- - ~pat
-- - !pat
-- - x (variable)
--
isSimplePat :: forall (x :: Pass). LPat (GhcPass x) -> Maybe (IdP (GhcPass x))
isIrrefutableHsPat :: forall (p :: Pass). OutputableBndrId p => DynFlags -> LPat (GhcPass p) -> Bool
isBangedLPat :: forall (p :: Pass). LPat (GhcPass p) -> Bool
hsRecUpdFieldRdr :: forall (p :: Pass). HsRecUpdField (GhcPass p) -> Located RdrName
hsRecUpdFieldOcc :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> LFieldOcc GhcTc
hsRecUpdFieldId :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> Located Id
hsRecFieldId :: HsRecField GhcTc arg -> Located Id
collectEvVarsPats :: [Pat GhcTc] -> Bag EvVar
collectEvVarsPat :: Pat GhcTc -> Bag EvVar
data NHsValBindsLR idL
NValBinds :: [(RecFlag, LHsBinds idL)] -> [LSig GhcRn] -> NHsValBindsLR idL
data AnnSig
AnnSig :: AddEpAnn -> [AddEpAnn] -> AnnSig
[asDcolon] :: AnnSig -> AddEpAnn
[asRest] :: AnnSig -> [AddEpAnn]
-- | Using SourceText in case the pragma was spelled differently or used
-- mixed case
pragSrcBrackets :: SourceText -> String -> SDoc -> SDoc
pragBrackets :: SDoc -> SDoc
ppr_sig :: forall (p :: Pass). OutputableBndrId p => Sig (GhcPass p) -> SDoc
ppr_monobind :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsBindLR (GhcPass idL) (GhcPass idR) -> SDoc
pprVarSig :: OutputableBndr id => [id] -> SDoc -> SDoc
pprTicks :: SDoc -> SDoc -> SDoc
pprTcSpecPrags :: TcSpecPrags -> SDoc
pprSpec :: OutputableBndr id => id -> SDoc -> InlinePragma -> SDoc
pprMinimalSig :: OutputableBndr name => LBooleanFormula (GenLocated l name) -> SDoc
pprLHsBindsForUser :: forall (idL :: Pass) (idR :: Pass) (id2 :: Pass). (OutputableBndrId idL, OutputableBndrId idR, OutputableBndrId id2) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> [LSig (GhcPass id2)] -> [SDoc]
pprLHsBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => LHsBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
pprDeclList :: [SDoc] -> SDoc
plusHsValBinds :: forall (a :: Pass). HsValBinds (GhcPass a) -> HsValBinds (GhcPass a) -> HsValBinds (GhcPass a)
isEmptyValBinds :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) -> Bool
isEmptyLHsBinds :: forall (idL :: Pass) idR. LHsBindsLR (GhcPass idL) idR -> Bool
isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool
isEmptyIPBindsPR :: forall (p :: Pass). HsIPBinds (GhcPass p) -> Bool
eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
emptyValBindsOut :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
emptyValBindsIn :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
emptyLocalBinds :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b)
emptyLHsBinds :: forall (idL :: Pass) idR. LHsBindsLR (GhcPass idL) idR
class OutputableBndrFlag flag (p :: Pass)
type EpAnnForallTy = EpAnn (AddEpAnn, AddEpAnn)
unambiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> FieldOcc GhcTc
-- | Decompose a sigma type (of the form forall tvs. context
-- => body) into its constituent parts. Only splits type variable
-- binders that were quantified invisibly (e.g., forall a., with
-- a dot).
--
-- This function is used to split apart certain types, such as instance
-- declaration types, which disallow visible foralls. For
-- instance, if GHC split apart the forall in instance
-- forall a -> Show (Blah a), then that declaration would
-- mistakenly be accepted!
--
-- Note that this function looks through parentheses, so it will work on
-- types such as (forall a. ...). The downside to this is
-- that it is not generally possible to take the returned types and
-- reconstruct the original type (parentheses and all) from them.
splitLHsSigmaTyInvis :: forall (p :: Pass). LHsType (GhcPass p) -> ([LHsTyVarBndr Specificity (GhcPass p)], Maybe (LHsContext (GhcPass p)), LHsType (GhcPass p))
-- | Decompose a type of the form context => body into its
-- constituent parts.
--
-- Note that this function looks through parentheses, so it will work on
-- types such as (context => ...). The downside to
-- this is that it is not generally possible to take the returned types
-- and reconstruct the original type (parentheses and all) from them.
splitLHsQualTy :: forall (pass :: Pass). LHsType (GhcPass pass) -> (Maybe (LHsContext (GhcPass pass)), LHsType (GhcPass pass))
-- | Decompose a pattern synonym type signature into its constituent parts.
--
-- Note that this function looks through parentheses, so it will work on
-- types such as (forall a. ...). The downside to this is
-- that it is not generally possible to take the returned types and
-- reconstruct the original type (parentheses and all) from them.
splitLHsPatSynTy :: forall (p :: Pass). LHsSigType (GhcPass p) -> ([LHsTyVarBndr Specificity (GhcPass (NoGhcTcPass p))], Maybe (LHsContext (GhcPass p)), [LHsTyVarBndr Specificity (GhcPass p)], Maybe (LHsContext (GhcPass p)), LHsType (GhcPass p))
-- | Decompose a type class instance type (of the form forall
-- tvs. context => instance_head) into its constituent
-- parts. Note that the [Name]s returned correspond to either:
--
--
-- - The implicitly bound type variables (if the type lacks an
-- outermost forall), or
-- - The explicitly bound type variables (if the type has an outermost
-- forall).
--
--
-- This function is careful not to look through parentheses. See Note
-- [No nested foralls or contexts in instance types] for why this is
-- important.
splitLHsInstDeclTy :: LHsSigType GhcRn -> ([Name], Maybe (LHsContext GhcRn), LHsType GhcRn)
-- | Decompose a GADT type into its constituent parts. Returns
-- (outer_bndrs, mb_ctxt, body), where:
--
--
-- - outer_bndrs are HsOuterExplicit if the type has
-- explicit, outermost type variable binders. Otherwise, they are
-- HsOuterImplicit.
-- - mb_ctxt is Just the context, if it is provided.
-- Otherwise, it is Nothing.
-- - body is the body of the type after the optional
-- foralls and context.
--
--
-- This function is careful not to look through parentheses. See Note
-- [GADT abstract syntax] (Wrinkle: No nested foralls or contexts)
-- GHC.Hs.Decls for why this is important.
splitLHsGadtTy :: LHsSigType GhcPs -> (HsOuterSigTyVarBndrs GhcPs, Maybe (LHsContext GhcPs), LHsType GhcPs)
-- | Decompose a type of the form forall tvs. body into its
-- constituent parts. Only splits type variable binders that were
-- quantified invisibly (e.g., forall a., with a dot).
--
-- This function is used to split apart certain types, such as instance
-- declaration types, which disallow visible foralls. For
-- instance, if GHC split apart the forall in instance
-- forall a -> Show (Blah a), then that declaration would
-- mistakenly be accepted!
--
-- Unlike splitLHsForAllTyInvis, this function does not look
-- through parentheses, hence the suffix _KP (short for "Keep
-- Parentheses").
splitLHsForAllTyInvis_KP :: forall (pass :: Pass). LHsType (GhcPass pass) -> (Maybe (EpAnnForallTy, [LHsTyVarBndr Specificity (GhcPass pass)]), LHsType (GhcPass pass))
-- | Decompose a type of the form forall tvs. body into its
-- constituent parts. Only splits type variable binders that were
-- quantified invisibly (e.g., forall a., with a dot).
--
-- This function is used to split apart certain types, such as instance
-- declaration types, which disallow visible foralls. For
-- instance, if GHC split apart the forall in instance
-- forall a -> Show (Blah a), then that declaration would
-- mistakenly be accepted!
--
-- Note that this function looks through parentheses, so it will work on
-- types such as (forall a. ...). The downside to this is
-- that it is not generally possible to take the returned types and
-- reconstruct the original type (parentheses and all) from them. Unlike
-- splitLHsSigmaTyInvis, this function does not look through
-- parentheses, hence the suffix _KP (short for "Keep
-- Parentheses").
splitLHsForAllTyInvis :: forall (pass :: Pass). LHsType (GhcPass pass) -> ((EpAnnForallTy, [LHsTyVarBndr Specificity (GhcPass pass)]), LHsType (GhcPass pass))
splitHsFunType :: forall (p :: Pass). LHsType (GhcPass p) -> ([AddEpAnn], EpAnnComments, [HsScaled (GhcPass p) (LHsType (GhcPass p))], LHsType (GhcPass p))
-- | Set the attached flag
setHsTyVarBndrFlag :: forall flag flag' (pass :: Pass). flag -> HsTyVarBndr flag' (GhcPass pass) -> HsTyVarBndr flag (GhcPass pass)
selectorAmbiguousFieldOcc :: AmbiguousFieldOcc GhcTc -> Id
rdrNameAmbiguousFieldOcc :: forall (p :: Pass). AmbiguousFieldOcc (GhcPass p) -> RdrName
pprLHsContext :: forall (p :: Pass). OutputableBndrId p => Maybe (LHsContext (GhcPass p)) -> SDoc
pprHsType :: forall (p :: Pass). OutputableBndrId p => HsType (GhcPass p) -> SDoc
-- | Prints the outermost forall in a type signature if one is
-- written. If there is no outermost forall, nothing is printed.
pprHsOuterSigTyVarBndrs :: forall (p :: Pass). OutputableBndrId p => HsOuterSigTyVarBndrs (GhcPass p) -> SDoc
-- | Prints the explicit forall in a type family equation if one
-- is written. If there is no explicit forall, nothing is
-- printed.
pprHsOuterFamEqnTyVarBndrs :: forall (p :: Pass). OutputableBndrId p => HsOuterFamEqnTyVarBndrs (GhcPass p) -> SDoc
-- | Prints a forall; When passed an empty list, prints forall
-- ./forall -> only when -dppr-debug is
-- enabled.
pprHsForAll :: forall (p :: Pass). OutputableBndrId p => HsForAllTelescope (GhcPass p) -> Maybe (LHsContext (GhcPass p)) -> SDoc
pprConDeclFields :: forall (p :: Pass). OutputableBndrId p => [LConDeclField (GhcPass p)] -> SDoc
pprAnonWildCard :: SDoc
-- | parenthesizeHsType p ty checks if
-- hsTypeNeedsParens p ty is true, and if so, surrounds
-- ty with an HsParTy. Otherwise, it simply returns
-- ty.
parenthesizeHsType :: forall (p :: Pass). PprPrec -> LHsType (GhcPass p) -> LHsType (GhcPass p)
-- | parenthesizeHsContext p ctxt checks if ctxt
-- is a single constraint c such that
-- hsTypeNeedsParens p c is true, and if so, surrounds
-- c with an HsParTy to form a parenthesized
-- ctxt. Otherwise, it simply returns ctxt unchanged.
parenthesizeHsContext :: forall (p :: Pass). PprPrec -> LHsContext (GhcPass p) -> LHsContext (GhcPass p)
mkHsWildCardBndrs :: thing -> HsWildCardBndrs GhcPs thing
mkHsQTvs :: [LHsTyVarBndr () GhcPs] -> LHsQTyVars GhcPs
mkHsPatSigType :: EpAnn EpaLocation -> LHsType GhcPs -> HsPatSigType GhcPs
mkHsOuterImplicit :: HsOuterTyVarBndrs flag GhcPs
mkHsOuterExplicit :: EpAnnForallTy -> [LHsTyVarBndr flag GhcPs] -> HsOuterTyVarBndrs flag GhcPs
mkHsOpTy :: forall (p :: Pass). Anno (IdGhcP p) ~ SrcSpanAnnN => LHsType (GhcPass p) -> LocatedN (IdP (GhcPass p)) -> LHsType (GhcPass p) -> HsType (GhcPass p)
mkHsImplicitSigType :: LHsType GhcPs -> HsSigType GhcPs
mkHsForAllVisTele :: forall (p :: Pass). EpAnnForallTy -> [LHsTyVarBndr () (GhcPass p)] -> HsForAllTelescope (GhcPass p)
mkHsForAllInvisTele :: forall (p :: Pass). EpAnnForallTy -> [LHsTyVarBndr Specificity (GhcPass p)] -> HsForAllTelescope (GhcPass p)
mkHsExplicitSigType :: EpAnnForallTy -> [LHsTyVarBndr Specificity GhcPs] -> LHsType GhcPs -> HsSigType GhcPs
mkHsAppTys :: forall (p :: Pass). LHsType (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
mkHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
mkHsAppKindTy :: forall (p :: Pass). XAppKindTy (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
mkFieldOcc :: LocatedN RdrName -> FieldOcc GhcPs
mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs GhcRn thing
mkAnonWildCardTy :: HsType GhcPs
mkAmbiguousFieldOcc :: LocatedN RdrName -> AmbiguousFieldOcc GhcPs
-- | Compute the SrcSpan associated with an LHsTypeArg.
lhsTypeArgSrcSpan :: forall (pass :: Pass). LHsTypeArg (GhcPass pass) -> SrcSpan
isUnrestricted :: HsArrow GhcRn -> Bool
ignoreParens :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p)
hsWcScopedTvs :: LHsSigWcType GhcRn -> [Name]
-- | hsTypeNeedsParens p t returns True if the type
-- t needs parentheses under precedence p.
hsTypeNeedsParens :: forall (p :: Pass). PprPrec -> HsType (GhcPass p) -> Bool
hsTyVarName :: forall flag (p :: Pass). HsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
-- | Return the attached flag
hsTyVarBndrFlag :: forall flag (pass :: Pass). HsTyVarBndr flag (GhcPass pass) -> flag
-- | Get the kind signature of a type, ignoring parentheses:
--
-- hsTyKindSig `Maybe ` = Nothing hsTyKindSig `Maybe :: Type -> Type `
-- = Just `Type -> Type` hsTyKindSig `Maybe :: ((Type -> Type))` =
-- Just `Type -> Type`
--
-- This is used to extract the result kind of type synonyms with a CUSK:
--
-- type S = (F :: res_kind) ^^^^^^^^
hsTyKindSig :: forall (p :: Pass). LHsType (GhcPass p) -> Maybe (LHsKind (GhcPass p))
-- | Retrieve the name of the "head" of a nested type application. This is
-- somewhat like GHC.Tc.Gen.HsType.splitHsAppTys, but a little
-- more thorough. The purpose of this function is to examine instance
-- heads, so it doesn't handle *all* cases (like lists, tuples,
-- (~), etc.).
hsTyGetAppHead_maybe :: forall (p :: Pass). Anno (IdGhcP p) ~ SrcSpanAnnN => LHsType (GhcPass p) -> Maybe (LocatedN (IdP (GhcPass p)))
-- | Do all type variables in this LHsQTyVars come with kind
-- annotations?
hsTvbAllKinded :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> Bool
hsSigWcType :: UnXRec p => LHsSigWcType p -> LHsType p
hsScopedTvs :: LHsSigType GhcRn -> [Name]
hsOuterTyVarNames :: HsOuterTyVarBndrs flag GhcRn -> [Name]
hsOuterExplicitBndrs :: forall flag (p :: Pass). HsOuterTyVarBndrs flag (GhcPass p) -> [LHsTyVarBndr flag (NoGhcTc (GhcPass p))]
hsLTyVarNames :: forall flag (p :: Pass). [LHsTyVarBndr flag (GhcPass p)] -> [IdP (GhcPass p)]
hsLTyVarName :: forall flag (p :: Pass). LHsTyVarBndr flag (GhcPass p) -> IdP (GhcPass p)
hsLTyVarLocNames :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [LocatedN (IdP (GhcPass p))]
hsLTyVarLocName :: forall flag (p :: Pass). LHsTyVarBndr flag (GhcPass p) -> LocatedN (IdP (GhcPass p))
hsExplicitLTyVarNames :: forall (p :: Pass). LHsQTyVars (GhcPass p) -> [IdP (GhcPass p)]
hsAllLTyVarNames :: LHsQTyVars GhcRn -> [Name]
-- | Decompose a type class instance type (of the form forall
-- tvs. context => instance_head) into the
-- instance_head.
getLHsInstDeclHead :: forall (p :: Pass). LHsSigType (GhcPass p) -> LHsType (GhcPass p)
-- | Decompose a type class instance type (of the form forall
-- tvs. context => instance_head) into the
-- instance_head and retrieve the underlying class type
-- constructor (if it exists).
getLHsInstDeclClass_maybe :: forall (p :: Pass). Anno (IdGhcP p) ~ SrcSpanAnnN => LHsSigType (GhcPass p) -> Maybe (LocatedN (IdP (GhcPass p)))
getBangType :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p)
getBangStrictness :: forall (p :: Pass). LHsType (GhcPass p) -> HsSrcBang
fromMaybeContext :: forall (p :: Pass). Maybe (LHsContext (GhcPass p)) -> HsContext (GhcPass p)
emptyLHsQTvs :: LHsQTyVars GhcRn
dropWildCards :: LHsSigWcType pass -> LHsSigType pass
-- | Convert an arrow into its corresponding multiplicity. In essence this
-- erases the information of whether the programmer wrote an explicit
-- multiplicity or a shorthand.
arrowToHsType :: HsArrow GhcRn -> LHsType GhcRn
ambiguousFieldOcc :: FieldOcc GhcTc -> AmbiguousFieldOcc GhcTc
data OverLitTc
OverLitTc :: Bool -> Type -> OverLitTc
[ol_rebindable] :: OverLitTc -> Bool
[ol_type] :: OverLitTc -> Type
pp_st_suffix :: SourceText -> SDoc -> SDoc -> SDoc
-- | pmPprHsLit pretty prints literals and is used when pretty printing
-- pattern match warnings. All are printed the same (i.e., without hashes
-- if they are primitive and not wrapped in constructors if they are
-- boxed). This happens mainly for too reasons: * We do not want to
-- expose their internal representation * The warnings become too messy
pmPprHsLit :: forall (x :: Pass). HsLit (GhcPass x) -> SDoc
overLitType :: HsOverLit GhcTc -> Type
-- | Convert a literal from one index type to another
convertLit :: forall (p1 :: Pass) (p2 :: Pass). HsLit (GhcPass p1) -> HsLit (GhcPass p2)
pprSpliceDecl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SpliceExplicitFlag -> SDoc
pprSplice :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
pprPatBind :: forall (bndr :: Pass) (p :: Pass). (OutputableBndrId bndr, OutputableBndrId p) => LPat (GhcPass bndr) -> GRHSs (GhcPass p) (LHsExpr (GhcPass p)) -> SDoc
pprLExpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
pprFunBind :: forall (idR :: Pass). OutputableBndrId idR => MatchGroup (GhcPass idR) (LHsExpr (GhcPass idR)) -> SDoc
pprExpr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> SDoc
data UntypedSpliceFlavour
UntypedExpSplice :: UntypedSpliceFlavour
UntypedPatSplice :: UntypedSpliceFlavour
UntypedTypeSplice :: UntypedSpliceFlavour
UntypedDeclSplice :: UntypedSpliceFlavour
data TransForm
ThenForm :: TransForm
GroupForm :: TransForm
-- | Finalizers produced by a splice with addModFinalizer
--
-- See Note [Delaying modFinalizers in untyped splices] in
-- GHC.Rename.Splice. For how this is used.
newtype ThModFinalizers
ThModFinalizers :: [ForeignRef (Q ())] -> ThModFinalizers
-- | Exact print annotations when in qualifier lists or guards -
-- AnnKeywordId : AnnVbar, AnnComma,AnnThen,
-- AnnBy,AnnBy, AnnGroup,AnnUsing
data StmtLR idL idR body
LastStmt :: XLastStmt idL idR body -> body -> Maybe Bool -> SyntaxExpr idR -> StmtLR idL idR body
BindStmt :: XBindStmt idL idR body -> LPat idL -> body -> StmtLR idL idR body
-- | ApplicativeStmt represents an applicative expression built with
-- <$> and <*>. It is generated by the renamer,
-- and is desugared into the appropriate applicative expression by the
-- desugarer, but it is intended to be invisible in error messages.
--
-- For full details, see Note [ApplicativeDo] in GHC.Rename.Expr
ApplicativeStmt :: XApplicativeStmt idL idR body -> [(SyntaxExpr idR, ApplicativeArg idL)] -> Maybe (SyntaxExpr idR) -> StmtLR idL idR body
BodyStmt :: XBodyStmt idL idR body -> body -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
-- |
LetStmt :: XLetStmt idL idR body -> HsLocalBindsLR idL idR -> StmtLR idL idR body
ParStmt :: XParStmt idL idR body -> [ParStmtBlock idL idR] -> HsExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
TransStmt :: XTransStmt idL idR body -> TransForm -> [ExprLStmt idL] -> [(IdP idR, IdP idR)] -> LHsExpr idR -> Maybe (LHsExpr idR) -> SyntaxExpr idR -> SyntaxExpr idR -> HsExpr idR -> StmtLR idL idR body
[trS_ext] :: StmtLR idL idR body -> XTransStmt idL idR body
[trS_form] :: StmtLR idL idR body -> TransForm
[trS_stmts] :: StmtLR idL idR body -> [ExprLStmt idL]
[trS_bndrs] :: StmtLR idL idR body -> [(IdP idR, IdP idR)]
[trS_using] :: StmtLR idL idR body -> LHsExpr idR
[trS_by] :: StmtLR idL idR body -> Maybe (LHsExpr idR)
[trS_ret] :: StmtLR idL idR body -> SyntaxExpr idR
[trS_bind] :: StmtLR idL idR body -> SyntaxExpr idR
[trS_fmap] :: StmtLR idL idR body -> HsExpr idR
-- |
RecStmt :: XRecStmt idL idR body -> XRec idR [LStmtLR idL idR body] -> [IdP idR] -> [IdP idR] -> SyntaxExpr idR -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body
[recS_ext] :: StmtLR idL idR body -> XRecStmt idL idR body
[recS_stmts] :: StmtLR idL idR body -> XRec idR [LStmtLR idL idR body]
[recS_later_ids] :: StmtLR idL idR body -> [IdP idR]
[recS_rec_ids] :: StmtLR idL idR body -> [IdP idR]
[recS_bind_fn] :: StmtLR idL idR body -> SyntaxExpr idR
[recS_ret_fn] :: StmtLR idL idR body -> SyntaxExpr idR
[recS_mfix_fn] :: StmtLR idL idR body -> SyntaxExpr idR
XStmtLR :: !XXStmtLR idL idR body -> StmtLR idL idR body
-- | do block Statement
type Stmt id body = StmtLR id id body
type SplicePointName = Name
-- | A splice can appear with various decorations wrapped around it. This
-- data type captures explicitly how it was originally written, for use
-- in the pretty printer.
data SpliceDecoration
-- | $splice or $$splice
DollarSplice :: SpliceDecoration
-- | bare splice
BareSplice :: SpliceDecoration
type RecUpdProj p = RecProj p LHsExpr p
type RecProj p arg = HsRecField' FieldLabelStrings p arg
type family PendingTcSplice' p
type family PendingRnSplice' p
-- | Parenthesised Statement Block
data ParStmtBlock idL idR
ParStmtBlock :: XParStmtBlock idL idR -> [ExprLStmt idL] -> [IdP idR] -> SyntaxExpr idR -> ParStmtBlock idL idR
XParStmtBlock :: !XXParStmtBlock idL idR -> ParStmtBlock idL idR
data MatchGroupTc
MatchGroupTc :: [Scaled Type] -> Type -> MatchGroupTc
[mg_arg_tys] :: MatchGroupTc -> [Scaled Type]
[mg_res_ty] :: MatchGroupTc -> Type
data Match p body
Match :: XCMatch p body -> HsMatchContext (NoGhcTc p) -> [LPat p] -> GRHSs p body -> Match p body
[m_ext] :: Match p body -> XCMatch p body
[m_ctxt] :: Match p body -> HsMatchContext (NoGhcTc p)
[m_pats] :: Match p body -> [LPat p]
[m_grhss] :: Match p body -> GRHSs p body
XMatch :: !XXMatch p body -> Match p body
-- | Located Statement with separate Left and Right id's
type LStmtLR idL idR body = XRec idL StmtLR idL idR body
-- | Located do block Statement
type LStmt id body = XRec id StmtLR id id body
-- | Located Match
--
-- May have AnnKeywordId : AnnSemi when in a list
type LMatch id body = XRec id Match id body
-- | Located Haskell Tuple Argument
--
-- HsTupArg is used for tuple sections (,a,) is
-- represented by ExplicitTuple [Missing ty1, Present a, Missing
-- ty3] Which in turn stands for (x:ty1 y:ty2. (x,a,y))
type LHsTupArg id = XRec id HsTupArg id
type LHsRecUpdProj p = XRec p RecUpdProj p
type LHsRecProj p arg = XRec p RecProj p arg
-- | Top-level command, introducing a new arrow. This may occur inside a
-- proc (where the stack is empty) or as an argument of a command-forming
-- operator.
--
-- Located Haskell Top-level Command
type LHsCmdTop p = XRec p HsCmdTop p
-- | Located Haskell Command (for arrow syntax)
type LHsCmd id = XRec id HsCmd id
-- | Located Guarded Right-Hand Side
type LGRHS id body = XRec id GRHS id body
-- |
--
-- Haskell Tuple Argument
data HsTupArg id
-- | The argument
Present :: XPresent id -> LHsExpr id -> HsTupArg id
-- | The argument is missing, but this is its type
Missing :: XMissing id -> HsTupArg id
-- | Note [Trees that Grow] extension point
XTupArg :: !XXTupArg id -> HsTupArg id
-- | Haskell Statement Context.
data HsStmtContext p
ListComp :: HsStmtContext p
MonadComp :: HsStmtContext p
-- |
-- - ModuleName. do { ... }
--
DoExpr :: Maybe ModuleName -> HsStmtContext p
-- |
-- - ModuleName. mdo { ... } ie recursive do-expression
--
MDoExpr :: Maybe ModuleName -> HsStmtContext p
-- | do-notation in an arrow-command context
ArrowExpr :: HsStmtContext p
-- | A command-line Stmt in GHCi pat <- rhs
GhciStmtCtxt :: HsStmtContext p
-- | Pattern guard for specified thing
PatGuard :: HsMatchContext p -> HsStmtContext p
-- | A branch of a parallel stmt
ParStmtCtxt :: HsStmtContext p -> HsStmtContext p
-- | A branch of a transform stmt
TransStmtCtxt :: HsStmtContext p -> HsStmtContext p
-- | Haskell Spliced Thing
--
-- Values that can result from running a splice.
data HsSplicedThing id
-- | Haskell Spliced Expression
HsSplicedExpr :: HsExpr id -> HsSplicedThing id
-- | Haskell Spliced Type
HsSplicedTy :: HsType id -> HsSplicedThing id
-- | Haskell Spliced Pattern
HsSplicedPat :: Pat id -> HsSplicedThing id
-- | Haskell Record Bindings
type HsRecordBinds p = HsRecFields p LHsExpr p
-- | A pragma, written as {-# ... #-}, that may appear within an
-- expression.
data HsPragE p
HsPragSCC :: XSCC p -> SourceText -> StringLiteral -> HsPragE p
-- |
-- - AnnKeywordId : AnnOpen, AnnOpen '{-#
-- GENERATED', AnnVal,AnnVal,
-- AnnColon,AnnVal, AnnMinus,
-- AnnVal,AnnColon, AnnVal, AnnClose
-- '#-}'
--
XHsPragE :: !XXPragE p -> HsPragE p
-- | Haskell Match Context
--
-- Context of a pattern match. This is more subtle than it would seem.
-- See Note [Varieties of pattern matches].
data HsMatchContext p
FunRhs :: LIdP p -> LexicalFixity -> SrcStrictness -> HsMatchContext p
-- | function binder of f
[mc_fun] :: HsMatchContext p -> LIdP p
-- | fixing of f
[mc_fixity] :: HsMatchContext p -> LexicalFixity
-- | was f banged? See Note [FunBind vs PatBind]
[mc_strictness] :: HsMatchContext p -> SrcStrictness
-- | Patterns of a lambda
LambdaExpr :: HsMatchContext p
-- | Patterns and guards on a case alternative
CaseAlt :: HsMatchContext p
-- | Guards of a multi-way if alternative
IfAlt :: HsMatchContext p
-- | A pattern match inside arrow notation
ArrowMatchCtxt :: HsArrowMatchContext -> HsMatchContext p
-- | A pattern binding eg [y] <- e = e
PatBindRhs :: HsMatchContext p
-- | Guards of pattern bindings, e.g., (Just b) | Just _ <- x = e |
-- otherwise = e'
PatBindGuards :: HsMatchContext p
-- | Record update [used only in GHC.HsToCore.Expr to tell matchWrapper
-- what sort of runtime error message to generate]
RecUpd :: HsMatchContext p
-- | Pattern of a do-stmt, list comprehension, pattern guard, etc
StmtCtxt :: HsStmtContext p -> HsMatchContext p
-- | A Template Haskell pattern splice
ThPatSplice :: HsMatchContext p
-- | A Template Haskell pattern quotation [p| (a,b) |]
ThPatQuote :: HsMatchContext p
-- | A pattern synonym declaration
PatSyn :: HsMatchContext p
data HsFieldLabel p
HsFieldLabel :: XCHsFieldLabel p -> Located FieldLabelString -> HsFieldLabel p
[hflExt] :: HsFieldLabel p -> XCHsFieldLabel p
[hflLabel] :: HsFieldLabel p -> Located FieldLabelString
XHsFieldLabel :: !XXHsFieldLabel p -> HsFieldLabel p
-- | The AST used to hard-refer to GhcPass, which was a layer violation.
-- For now, we paper it over with this new extension point.
type family HsDoRn p
-- | Haskell Top-level Command
data HsCmdTop p
HsCmdTop :: XCmdTop p -> LHsCmd p -> HsCmdTop p
XCmdTop :: !XXCmdTop p -> HsCmdTop p
-- | Haskell Command (e.g. a "statement" in an Arrow proc block)
data HsCmd id
-- |
HsCmdArrApp :: XCmdArrApp id -> LHsExpr id -> LHsExpr id -> HsArrAppType -> Bool -> HsCmd id
-- |
HsCmdArrForm :: XCmdArrForm id -> LHsExpr id -> LexicalFixity -> Maybe Fixity -> [LHsCmdTop id] -> HsCmd id
HsCmdApp :: XCmdApp id -> LHsCmd id -> LHsExpr id -> HsCmd id
-- |
HsCmdLam :: XCmdLam id -> MatchGroup id (LHsCmd id) -> HsCmd id
-- |
HsCmdPar :: XCmdPar id -> LHsCmd id -> HsCmd id
-- |
HsCmdCase :: XCmdCase id -> LHsExpr id -> MatchGroup id (LHsCmd id) -> HsCmd id
-- |
HsCmdLamCase :: XCmdLamCase id -> MatchGroup id (LHsCmd id) -> HsCmd id
-- |
HsCmdIf :: XCmdIf id -> SyntaxExpr id -> LHsExpr id -> LHsCmd id -> LHsCmd id -> HsCmd id
-- |
HsCmdLet :: XCmdLet id -> HsLocalBinds id -> LHsCmd id -> HsCmd id
-- |
HsCmdDo :: XCmdDo id -> XRec id [CmdLStmt id] -> HsCmd id
XCmd :: !XXCmd id -> HsCmd id
type family HsBracketRn p
-- | Haskell Bracket
data HsBracket p
ExpBr :: XExpBr p -> LHsExpr p -> HsBracket p
PatBr :: XPatBr p -> LPat p -> HsBracket p
DecBrL :: XDecBrL p -> [LHsDecl p] -> HsBracket p
DecBrG :: XDecBrG p -> HsGroup p -> HsBracket p
TypBr :: XTypBr p -> LHsType p -> HsBracket p
VarBr :: XVarBr p -> Bool -> LIdP p -> HsBracket p
TExpBr :: XTExpBr p -> LHsExpr p -> HsBracket p
XBracket :: !XXBracket p -> HsBracket p
-- | Haskell arrow match context.
data HsArrowMatchContext
-- | A proc expression
ProcExpr :: HsArrowMatchContext
-- | A case alternative inside arrow notation
ArrowCaseAlt :: HsArrowMatchContext
-- | An arrow kappa abstraction
KappaExpr :: HsArrowMatchContext
-- | Haskell Array Application Type
data HsArrAppType
HsHigherOrderApp :: HsArrAppType
HsFirstOrderApp :: HsArrAppType
-- | Guard Statement
type GuardStmt id = Stmt id LHsExpr id
-- | Guard Located Statement
type GuardLStmt id = LStmt id LHsExpr id
-- | Ghci Statement
type GhciStmt id = Stmt id LHsExpr id
-- | Ghci Located Statement
type GhciLStmt id = LStmt id LHsExpr id
-- | Guarded Right Hand Side.
data GRHS p body
GRHS :: XCGRHS p body -> [GuardLStmt p] -> body -> GRHS p body
XGRHS :: !XXGRHS p body -> GRHS p body
-- | RecordDotSyntax field updates
newtype FieldLabelStrings p
FieldLabelStrings :: [Located (HsFieldLabel p)] -> FieldLabelStrings p
-- | The fail operator
--
-- This is used for `.. <-` "bind statements" in do notation,
-- including non-monadic "binds" in applicative.
--
-- The fail operator is 'Just expr' if it potentially fail monadically.
-- if the pattern match cannot fail, or shouldn't fail monadically
-- (regular incomplete pattern exception), it is Nothing.
--
-- See Note [Monad fail : Rebindable syntax, overloaded strings] for the
-- type of expression in the Just case, and why it is so.
--
-- See Note [Failing pattern matches in Stmts] for which contexts for
-- 'BindStmt's should use the monadic fail and which shouldn't.
type FailOperator id = Maybe SyntaxExpr id
-- | Expression Statement
type ExprStmt id = Stmt id LHsExpr id
-- | Expression Located Statement
type ExprLStmt id = LStmt id LHsExpr id
-- | Command Syntax Table (for Arrow syntax)
type CmdSyntaxTable p = [(Name, HsExpr p)]
-- | Command Statement
type CmdStmt id = Stmt id LHsCmd id
-- | Command Located Statement
type CmdLStmt id = LStmt id LHsCmd id
-- | Arithmetic Sequence Information
data ArithSeqInfo id
From :: LHsExpr id -> ArithSeqInfo id
FromThen :: LHsExpr id -> LHsExpr id -> ArithSeqInfo id
FromTo :: LHsExpr id -> LHsExpr id -> ArithSeqInfo id
FromThenTo :: LHsExpr id -> LHsExpr id -> LHsExpr id -> ArithSeqInfo id
type family ApplicativeArgStmCtxPass idL
-- | Applicative Argument
data ApplicativeArg idL
ApplicativeArgOne :: XApplicativeArgOne idL -> LPat idL -> LHsExpr idL -> Bool -> ApplicativeArg idL
-- | The fail operator, after renaming
--
-- The fail operator is needed if this is a BindStmt where the pattern
-- can fail. E.g.: (Just a) <- stmt The fail operator will be invoked
-- if the pattern match fails. It is also used for guards in
-- MonadComprehensions. The fail operator is Nothing if the pattern match
-- can't fail
[xarg_app_arg_one] :: ApplicativeArg idL -> XApplicativeArgOne idL
[app_arg_pattern] :: ApplicativeArg idL -> LPat idL
[arg_expr] :: ApplicativeArg idL -> LHsExpr idL
-- | True = was a BodyStmt, False = was a BindStmt. See Note
-- [Applicative BodyStmt]
[is_body_stmt] :: ApplicativeArg idL -> Bool
ApplicativeArgMany :: XApplicativeArgMany idL -> [ExprLStmt idL] -> HsExpr idL -> LPat idL -> HsStmtContext (ApplicativeArgStmCtxPass idL) -> ApplicativeArg idL
[xarg_app_arg_many] :: ApplicativeArg idL -> XApplicativeArgMany idL
[app_stmts] :: ApplicativeArg idL -> [ExprLStmt idL]
[final_expr] :: ApplicativeArg idL -> HsExpr idL
[bv_pattern] :: ApplicativeArg idL -> LPat idL
-- | context of the do expression, used in pprArg
[stmt_context] :: ApplicativeArg idL -> HsStmtContext (ApplicativeArgStmCtxPass idL)
XApplicativeArg :: !XXApplicativeArg idL -> ApplicativeArg idL
qualifiedDoModuleName_maybe :: HsStmtContext p -> Maybe ModuleName
prependQualified :: Maybe ModuleName -> SDoc -> SDoc
pprStmtContext :: (Outputable (IdP p), UnXRec p) => HsStmtContext p -> SDoc
pprMatchContextNoun :: (Outputable (IdP p), UnXRec p) => HsMatchContext p -> SDoc
pprMatchContext :: (Outputable (IdP p), UnXRec p) => HsMatchContext p -> SDoc
pprFieldLabelStrings :: FieldLabelStrings p -> SDoc
pprExternalSrcLoc :: (StringLiteral, (Int, Int), (Int, Int)) -> SDoc
pprArrowMatchContextNoun :: HsArrowMatchContext -> SDoc
pprAStmtContext :: (Outputable (IdP p), UnXRec p) => HsStmtContext p -> SDoc
matchSeparator :: HsMatchContext p -> SDoc
isTypedSplice :: HsSplice id -> Bool
isTypedBracket :: HsBracket id -> Bool
isPatSynCtxt :: HsMatchContext p -> Bool
-- | Is this a monadic context?
isMonadStmtContext :: HsStmtContext id -> Bool
isMonadCompContext :: HsStmtContext id -> Bool
isInfixMatch :: Match id body -> Bool
isComprehensionContext :: HsStmtContext id -> Bool
-- | Warning pragma Declarations
data WarnDecls pass
Warnings :: XWarnings pass -> SourceText -> [LWarnDecl pass] -> WarnDecls pass
[wd_ext] :: WarnDecls pass -> XWarnings pass
[wd_src] :: WarnDecls pass -> SourceText
[wd_warnings] :: WarnDecls pass -> [LWarnDecl pass]
XWarnDecls :: !XXWarnDecls pass -> WarnDecls pass
-- | Warning pragma Declaration
data WarnDecl pass
Warning :: XWarning pass -> [LIdP pass] -> WarningTxt -> WarnDecl pass
XWarnDecl :: !XXWarnDecl pass -> WarnDecl pass
-- | Type Family Instance Equation
type TyFamInstEqn pass = FamEqn pass LHsType pass
-- | Type Family Instance Declaration
data TyFamInstDecl pass
-- |
TyFamInstDecl :: XCTyFamInstDecl pass -> TyFamInstEqn pass -> TyFamInstDecl pass
[tfid_xtn] :: TyFamInstDecl pass -> XCTyFamInstDecl pass
[tfid_eqn] :: TyFamInstDecl pass -> TyFamInstEqn pass
XTyFamInstDecl :: !XXTyFamInstDecl pass -> TyFamInstDecl pass
-- | Type family default declarations. A convenient synonym for
-- TyFamInstDecl. See Note [Type family instance declarations
-- in HsSyn].
type TyFamDefltDecl = TyFamInstDecl
-- | Type or Class Group
data TyClGroup pass
TyClGroup :: XCTyClGroup pass -> [LTyClDecl pass] -> [LRoleAnnotDecl pass] -> [LStandaloneKindSig pass] -> [LInstDecl pass] -> TyClGroup pass
[group_ext] :: TyClGroup pass -> XCTyClGroup pass
[group_tyclds] :: TyClGroup pass -> [LTyClDecl pass]
[group_roles] :: TyClGroup pass -> [LRoleAnnotDecl pass]
[group_kisigs] :: TyClGroup pass -> [LStandaloneKindSig pass]
[group_instds] :: TyClGroup pass -> [LInstDecl pass]
XTyClGroup :: !XXTyClGroup pass -> TyClGroup pass
-- | A type or class declaration.
data TyClDecl pass
-- |
-- type/data family T :: *->*
--
--
--
-- - AnnKeywordId : AnnType, AnnData,
-- AnnFamily,AnnDcolon, AnnWhere,AnnOpenP,
-- AnnDcolon,AnnCloseP, AnnEqual,AnnRarrow,
-- AnnVbar
--
FamDecl :: XFamDecl pass -> FamilyDecl pass -> TyClDecl pass
[tcdFExt] :: TyClDecl pass -> XFamDecl pass
[tcdFam] :: TyClDecl pass -> FamilyDecl pass
-- | type declaration
--
--
SynDecl :: XSynDecl pass -> LIdP pass -> LHsQTyVars pass -> LexicalFixity -> LHsType pass -> TyClDecl pass
-- | Post renameer, FVs
[tcdSExt] :: TyClDecl pass -> XSynDecl pass
-- | Type constructor
[tcdLName] :: TyClDecl pass -> LIdP pass
-- | Type variables; for an associated type these include outer binders
[tcdTyVars] :: TyClDecl pass -> LHsQTyVars pass
-- | Fixity used in the declaration
[tcdFixity] :: TyClDecl pass -> LexicalFixity
-- | RHS of type declaration
[tcdRhs] :: TyClDecl pass -> LHsType pass
-- | data declaration
--
--
DataDecl :: XDataDecl pass -> LIdP pass -> LHsQTyVars pass -> LexicalFixity -> HsDataDefn pass -> TyClDecl pass
-- | Post renamer, CUSK flag, FVs
[tcdDExt] :: TyClDecl pass -> XDataDecl pass
-- | Type constructor
[tcdLName] :: TyClDecl pass -> LIdP pass
-- | Type variables; for an associated type these include outer binders
[tcdTyVars] :: TyClDecl pass -> LHsQTyVars pass
-- | Fixity used in the declaration
[tcdFixity] :: TyClDecl pass -> LexicalFixity
[tcdDataDefn] :: TyClDecl pass -> HsDataDefn pass
ClassDecl :: XClassDecl pass -> Maybe (LHsContext pass) -> LIdP pass -> LHsQTyVars pass -> LexicalFixity -> [LHsFunDep pass] -> [LSig pass] -> LHsBinds pass -> [LFamilyDecl pass] -> [LTyFamDefltDecl pass] -> [LDocDecl pass] -> TyClDecl pass
-- | Post renamer, FVs
[tcdCExt] :: TyClDecl pass -> XClassDecl pass
-- | Context...
[tcdCtxt] :: TyClDecl pass -> Maybe (LHsContext pass)
-- | Type constructor
[tcdLName] :: TyClDecl pass -> LIdP pass
-- | Type variables; for an associated type these include outer binders
[tcdTyVars] :: TyClDecl pass -> LHsQTyVars pass
-- | Fixity used in the declaration
[tcdFixity] :: TyClDecl pass -> LexicalFixity
-- | Functional deps
[tcdFDs] :: TyClDecl pass -> [LHsFunDep pass]
-- | Methods' signatures
[tcdSigs] :: TyClDecl pass -> [LSig pass]
-- | Default methods
[tcdMeths] :: TyClDecl pass -> LHsBinds pass
-- | Associated types;
[tcdATs] :: TyClDecl pass -> [LFamilyDecl pass]
-- | Associated type defaults
[tcdATDefs] :: TyClDecl pass -> [LTyFamDefltDecl pass]
-- | Haddock docs
[tcdDocs] :: TyClDecl pass -> [LDocDecl pass]
XTyClDecl :: !XXTyClDecl pass -> TyClDecl pass
data StandaloneKindSig pass
StandaloneKindSig :: XStandaloneKindSig pass -> LIdP pass -> LHsSigType pass -> StandaloneKindSig pass
XStandaloneKindSig :: !XXStandaloneKindSig pass -> StandaloneKindSig pass
-- | Splice Declaration
data SpliceDecl p
SpliceDecl :: XSpliceDecl p -> XRec p (HsSplice p) -> SpliceExplicitFlag -> SpliceDecl p
XSpliceDecl :: !XXSpliceDecl p -> SpliceDecl p
-- | Rule Declarations
data RuleDecls pass
HsRules :: XCRuleDecls pass -> SourceText -> [LRuleDecl pass] -> RuleDecls pass
[rds_ext] :: RuleDecls pass -> XCRuleDecls pass
[rds_src] :: RuleDecls pass -> SourceText
[rds_rules] :: RuleDecls pass -> [LRuleDecl pass]
XRuleDecls :: !XXRuleDecls pass -> RuleDecls pass
-- | Rule Declaration
data RuleDecl pass
HsRule :: XHsRule pass -> XRec pass (SourceText, RuleName) -> Activation -> Maybe [LHsTyVarBndr () (NoGhcTc pass)] -> [LRuleBndr pass] -> XRec pass (HsExpr pass) -> XRec pass (HsExpr pass) -> RuleDecl pass
-- | After renamer, free-vars from the LHS and RHS
[rd_ext] :: RuleDecl pass -> XHsRule pass
-- | Note [Pragma source text] in GHC.Types.Basic
[rd_name] :: RuleDecl pass -> XRec pass (SourceText, RuleName)
[rd_act] :: RuleDecl pass -> Activation
-- | Forall'd type vars
[rd_tyvs] :: RuleDecl pass -> Maybe [LHsTyVarBndr () (NoGhcTc pass)]
-- | Forall'd term vars, before typechecking; after typechecking this
-- includes all forall'd vars
[rd_tmvs] :: RuleDecl pass -> [LRuleBndr pass]
[rd_lhs] :: RuleDecl pass -> XRec pass (HsExpr pass)
-- |
[rd_rhs] :: RuleDecl pass -> XRec pass (HsExpr pass)
XRuleDecl :: !XXRuleDecl pass -> RuleDecl pass
-- | Rule Binder
data RuleBndr pass
RuleBndr :: XCRuleBndr pass -> LIdP pass -> RuleBndr pass
RuleBndrSig :: XRuleBndrSig pass -> LIdP pass -> HsPatSigType pass -> RuleBndr pass
-- |
XRuleBndr :: !XXRuleBndr pass -> RuleBndr pass
-- | Role Annotation Declaration
data RoleAnnotDecl pass
-- |
RoleAnnotDecl :: XCRoleAnnotDecl pass -> LIdP pass -> [XRec pass (Maybe Role)] -> RoleAnnotDecl pass
XRoleAnnotDecl :: !XXRoleAnnotDecl pass -> RoleAnnotDecl pass
data NewOrData
-- |
-- newtype Blah ...
--
NewType :: NewOrData
-- |
-- data Blah ...
--
DataType :: NewOrData
-- | Located Warning Declarations
type LWarnDecls pass = XRec pass WarnDecls pass
-- | Located Warning pragma Declaration
type LWarnDecl pass = XRec pass WarnDecl pass
-- | Located Type Family Instance Equation
type LTyFamInstEqn pass = XRec pass TyFamInstEqn pass
-- | Located Type Family Instance Declaration
type LTyFamInstDecl pass = XRec pass TyFamInstDecl pass
-- | Located type family default declarations.
type LTyFamDefltDecl pass = XRec pass TyFamDefltDecl pass
-- | Located Declaration of a Type or Class
type LTyClDecl pass = XRec pass TyClDecl pass
-- | Located Standalone Kind Signature
type LStandaloneKindSig pass = XRec pass StandaloneKindSig pass
-- | Located Splice Declaration
type LSpliceDecl pass = XRec pass SpliceDecl pass
-- | Located Rule Declarations
type LRuleDecls pass = XRec pass RuleDecls pass
-- | Located Rule Declaration
type LRuleDecl pass = XRec pass RuleDecl pass
-- | Located Rule Binder
type LRuleBndr pass = XRec pass RuleBndr pass
-- | Located Role Annotation Declaration
type LRoleAnnotDecl pass = XRec pass RoleAnnotDecl pass
-- | Located Instance Declaration
type LInstDecl pass = XRec pass InstDecl pass
-- | Located Injectivity Annotation
type LInjectivityAnn pass = XRec pass InjectivityAnn pass
type LHsFunDep pass = XRec pass FunDep pass
type LHsDerivingClause pass = XRec pass HsDerivingClause pass
type LHsDecl p = XRec p HsDecl p
-- | Located Foreign Declaration
type LForeignDecl pass = XRec pass ForeignDecl pass
-- | Located type Family Result Signature
type LFamilyResultSig pass = XRec pass FamilyResultSig pass
-- | Located type Family Declaration
type LFamilyDecl pass = XRec pass FamilyDecl pass
-- | Located Documentation comment Declaration
type LDocDecl pass = XRec pass DocDecl
-- | A Located DerivStrategy.
type LDerivStrategy pass = XRec pass DerivStrategy pass
-- | Located stand-alone 'deriving instance' declaration
type LDerivDecl pass = XRec pass DerivDecl pass
type LDerivClauseTys pass = XRec pass DerivClauseTys pass
-- | Located Default Declaration
type LDefaultDecl pass = XRec pass DefaultDecl pass
-- | Located Data Family Instance Declaration
type LDataFamInstDecl pass = XRec pass DataFamInstDecl pass
-- | Located data Constructor Declaration
type LConDecl pass = XRec pass ConDecl pass
-- | Located Class Instance Declaration
type LClsInstDecl pass = XRec pass ClsInstDecl pass
-- | Located Annotation Declaration
type LAnnDecl pass = XRec pass AnnDecl pass
-- | Instance Declaration
data InstDecl pass
ClsInstD :: XClsInstD pass -> ClsInstDecl pass -> InstDecl pass
[cid_d_ext] :: InstDecl pass -> XClsInstD pass
[cid_inst] :: InstDecl pass -> ClsInstDecl pass
DataFamInstD :: XDataFamInstD pass -> DataFamInstDecl pass -> InstDecl pass
[dfid_ext] :: InstDecl pass -> XDataFamInstD pass
[dfid_inst] :: InstDecl pass -> DataFamInstDecl pass
TyFamInstD :: XTyFamInstD pass -> TyFamInstDecl pass -> InstDecl pass
[tfid_ext] :: InstDecl pass -> XTyFamInstD pass
[tfid_inst] :: InstDecl pass -> TyFamInstDecl pass
XInstDecl :: !XXInstDecl pass -> InstDecl pass
-- | If the user supplied an injectivity annotation it is represented using
-- InjectivityAnn. At the moment this is a single injectivity condition -
-- see Note [Injectivity annotation]. `Located name` stores the LHS of
-- injectivity condition. `[Located name]` stores the RHS of injectivity
-- condition. Example:
--
-- type family Foo a b c = r | r -> a c where ...
--
-- This will be represented as "InjectivityAnn r [a,
-- c]"
data InjectivityAnn pass
-- |
InjectivityAnn :: XCInjectivityAnn pass -> LIdP pass -> [LIdP pass] -> InjectivityAnn pass
XInjectivityAnn :: !XXInjectivityAnn pass -> InjectivityAnn pass
-- | Haskell Type Patterns
type HsTyPats pass = [LHsTypeArg pass]
data HsRuleRn
HsRuleRn :: NameSet -> NameSet -> HsRuleRn
-- | Haskell Group
--
-- A HsDecl is categorised into a HsGroup before being fed
-- to the renamer.
data HsGroup p
HsGroup :: XCHsGroup p -> HsValBinds p -> [LSpliceDecl p] -> [TyClGroup p] -> [LDerivDecl p] -> [LFixitySig p] -> [LDefaultDecl p] -> [LForeignDecl p] -> [LWarnDecls p] -> [LAnnDecl p] -> [LRuleDecls p] -> [LDocDecl p] -> HsGroup p
[hs_ext] :: HsGroup p -> XCHsGroup p
[hs_valds] :: HsGroup p -> HsValBinds p
[hs_splcds] :: HsGroup p -> [LSpliceDecl p]
[hs_tyclds] :: HsGroup p -> [TyClGroup p]
[hs_derivds] :: HsGroup p -> [LDerivDecl p]
[hs_fixds] :: HsGroup p -> [LFixitySig p]
[hs_defds] :: HsGroup p -> [LDefaultDecl p]
[hs_fords] :: HsGroup p -> [LForeignDecl p]
[hs_warnds] :: HsGroup p -> [LWarnDecls p]
[hs_annds] :: HsGroup p -> [LAnnDecl p]
[hs_ruleds] :: HsGroup p -> [LRuleDecls p]
[hs_docs] :: HsGroup p -> [LDocDecl p]
XHsGroup :: !XXHsGroup p -> HsGroup p
-- | A single deriving clause of a data declaration.
--
--
data HsDerivingClause pass
HsDerivingClause :: XCHsDerivingClause pass -> Maybe (LDerivStrategy pass) -> LDerivClauseTys pass -> HsDerivingClause pass
[deriv_clause_ext] :: HsDerivingClause pass -> XCHsDerivingClause pass
-- | The user-specified strategy (if any) to use when deriving
-- deriv_clause_tys.
[deriv_clause_strategy] :: HsDerivingClause pass -> Maybe (LDerivStrategy pass)
-- | The types to derive.
[deriv_clause_tys] :: HsDerivingClause pass -> LDerivClauseTys pass
XHsDerivingClause :: !XXHsDerivingClause pass -> HsDerivingClause pass
-- | Haskell Deriving clause
type HsDeriving pass = [LHsDerivingClause pass]
-- | A Haskell Declaration
data HsDecl p
-- | Type or Class Declaration
TyClD :: XTyClD p -> TyClDecl p -> HsDecl p
-- | Instance declaration
InstD :: XInstD p -> InstDecl p -> HsDecl p
-- | Deriving declaration
DerivD :: XDerivD p -> DerivDecl p -> HsDecl p
-- | Value declaration
ValD :: XValD p -> HsBind p -> HsDecl p
-- | Signature declaration
SigD :: XSigD p -> Sig p -> HsDecl p
-- | Standalone kind signature
KindSigD :: XKindSigD p -> StandaloneKindSig p -> HsDecl p
-- | 'default' declaration
DefD :: XDefD p -> DefaultDecl p -> HsDecl p
-- | Foreign declaration
ForD :: XForD p -> ForeignDecl p -> HsDecl p
-- | Warning declaration
WarningD :: XWarningD p -> WarnDecls p -> HsDecl p
-- | Annotation declaration
AnnD :: XAnnD p -> AnnDecl p -> HsDecl p
-- | Rule declaration
RuleD :: XRuleD p -> RuleDecls p -> HsDecl p
-- | Splice declaration (Includes quasi-quotes)
SpliceD :: XSpliceD p -> SpliceDecl p -> HsDecl p
-- | Documentation comment declaration
DocD :: XDocD p -> DocDecl -> HsDecl p
-- | Role annotation declaration
RoleAnnotD :: XRoleAnnotD p -> RoleAnnotDecl p -> HsDecl p
XHsDecl :: !XXHsDecl p -> HsDecl p
-- | Haskell Data type Definition
data HsDataDefn pass
-- | Declares a data type or newtype, giving its constructors
-- data/newtype T a = constrs data/newtype instance T [a] =
-- constrs
HsDataDefn :: XCHsDataDefn pass -> NewOrData -> Maybe (LHsContext pass) -> Maybe (XRec pass CType) -> Maybe (LHsKind pass) -> [LConDecl pass] -> HsDeriving pass -> HsDataDefn pass
[dd_ext] :: HsDataDefn pass -> XCHsDataDefn pass
[dd_ND] :: HsDataDefn pass -> NewOrData
-- | Context
[dd_ctxt] :: HsDataDefn pass -> Maybe (LHsContext pass)
[dd_cType] :: HsDataDefn pass -> Maybe (XRec pass CType)
-- | Optional kind signature.
--
-- (Just k) for a GADT-style data, or data
-- instance decl, with explicit kind sig
--
-- Always Nothing for H98-syntax decls
[dd_kindSig] :: HsDataDefn pass -> Maybe (LHsKind pass)
-- | Data constructors
--
-- For data T a = T1 | T2 a the LConDecls all have
-- ConDeclH98. For data T a where { T1 :: T a } the
-- LConDecls all have ConDeclGADT.
[dd_cons] :: HsDataDefn pass -> [LConDecl pass]
-- | Optional 'deriving' clause
[dd_derivs] :: HsDataDefn pass -> HsDeriving pass
XHsDataDefn :: !XXHsDataDefn pass -> HsDataDefn pass
-- | The arguments in a Haskell98-style data constructor.
type HsConDeclH98Details pass = HsConDetails Void HsScaled pass LBangType pass XRec pass [LConDeclField pass]
-- | The arguments in a GADT constructor. Unlike Haskell98-style
-- constructors, GADT constructors cannot be declared with infix syntax.
-- As a result, we do not use HsConDetails here, as
-- InfixCon would be an unrepresentable state. (There is a notion
-- of infix GADT constructors for the purposes of derived Show
-- instances—see Note [Infix GADT constructors] in GHC.Tc.TyCl—but that
-- is an orthogonal concern.)
data HsConDeclGADTDetails pass
PrefixConGADT :: [HsScaled pass (LBangType pass)] -> HsConDeclGADTDetails pass
RecConGADT :: XRec pass [LConDeclField pass] -> HsConDeclGADTDetails pass
pattern XFunDep :: () => !XXFunDep pass -> FunDep pass
data ForeignImport
CImport :: Located CCallConv -> Located Safety -> Maybe Header -> CImportSpec -> Located SourceText -> ForeignImport
data ForeignExport
CExport :: Located CExportSpec -> Located SourceText -> ForeignExport
-- | Foreign Declaration
data ForeignDecl pass
ForeignImport :: XForeignImport pass -> LIdP pass -> LHsSigType pass -> ForeignImport -> ForeignDecl pass
[fd_i_ext] :: ForeignDecl pass -> XForeignImport pass
[fd_name] :: ForeignDecl pass -> LIdP pass
[fd_sig_ty] :: ForeignDecl pass -> LHsSigType pass
[fd_fi] :: ForeignDecl pass -> ForeignImport
-- |
ForeignExport :: XForeignExport pass -> LIdP pass -> LHsSigType pass -> ForeignExport -> ForeignDecl pass
[fd_e_ext] :: ForeignDecl pass -> XForeignExport pass
[fd_name] :: ForeignDecl pass -> LIdP pass
[fd_sig_ty] :: ForeignDecl pass -> LHsSigType pass
[fd_fe] :: ForeignDecl pass -> ForeignExport
XForeignDecl :: !XXForeignDecl pass -> ForeignDecl pass
-- | type Family Result Signature
data FamilyResultSig pass
-- |
NoSig :: XNoSig pass -> FamilyResultSig pass
-- |
KindSig :: XCKindSig pass -> LHsKind pass -> FamilyResultSig pass
-- |
TyVarSig :: XTyVarSig pass -> LHsTyVarBndr () pass -> FamilyResultSig pass
XFamilyResultSig :: !XXFamilyResultSig pass -> FamilyResultSig pass
data FamilyInfo pass
DataFamily :: FamilyInfo pass
OpenTypeFamily :: FamilyInfo pass
-- | Nothing if we're in an hs-boot file and the user said "type
-- family Foo x where .."
ClosedTypeFamily :: Maybe [LTyFamInstEqn pass] -> FamilyInfo pass
-- | type Family Declaration
data FamilyDecl pass
FamilyDecl :: XCFamilyDecl pass -> FamilyInfo pass -> TopLevelFlag -> LIdP pass -> LHsQTyVars pass -> LexicalFixity -> LFamilyResultSig pass -> Maybe (LInjectivityAnn pass) -> FamilyDecl pass
[fdExt] :: FamilyDecl pass -> XCFamilyDecl pass
[fdInfo] :: FamilyDecl pass -> FamilyInfo pass
[fdTopLevel] :: FamilyDecl pass -> TopLevelFlag
[fdLName] :: FamilyDecl pass -> LIdP pass
[fdTyVars] :: FamilyDecl pass -> LHsQTyVars pass
[fdFixity] :: FamilyDecl pass -> LexicalFixity
[fdResultSig] :: FamilyDecl pass -> LFamilyResultSig pass
[fdInjectivityAnn] :: FamilyDecl pass -> Maybe (LInjectivityAnn pass)
-- |
XFamilyDecl :: !XXFamilyDecl pass -> FamilyDecl pass
-- | Family Equation
--
-- One equation in a type family instance declaration, data family
-- instance declaration, or type family default. See Note [Type family
-- instance declarations in HsSyn] See Note [Family instance declaration
-- binders]
data FamEqn pass rhs
FamEqn :: XCFamEqn pass rhs -> LIdP pass -> HsOuterFamEqnTyVarBndrs pass -> HsTyPats pass -> LexicalFixity -> rhs -> FamEqn pass rhs
[feqn_ext] :: FamEqn pass rhs -> XCFamEqn pass rhs
[feqn_tycon] :: FamEqn pass rhs -> LIdP pass
-- | Optional quantified type vars
[feqn_bndrs] :: FamEqn pass rhs -> HsOuterFamEqnTyVarBndrs pass
[feqn_pats] :: FamEqn pass rhs -> HsTyPats pass
-- | Fixity used in the declaration
[feqn_fixity] :: FamEqn pass rhs -> LexicalFixity
-- |
[feqn_rhs] :: FamEqn pass rhs -> rhs
XFamEqn :: !XXFamEqn pass rhs -> FamEqn pass rhs
-- | Documentation comment Declaration
data DocDecl
DocCommentNext :: HsDocString -> DocDecl
DocCommentPrev :: HsDocString -> DocDecl
DocCommentNamed :: String -> HsDocString -> DocDecl
DocGroup :: Int -> HsDocString -> DocDecl
-- | Which technique the user explicitly requested when deriving an
-- instance.
data DerivStrategy pass
-- | GHC's "standard" strategy, which is to implement a custom instance for
-- the data type. This only works for certain types that GHC knows about
-- (e.g., Eq, Show, Functor when
-- -XDeriveFunctor is enabled, etc.)
StockStrategy :: XStockStrategy pass -> DerivStrategy pass
-- |
-- -XDeriveAnyClass
--
AnyclassStrategy :: XAnyClassStrategy pass -> DerivStrategy pass
-- |
-- -XGeneralizedNewtypeDeriving
--
NewtypeStrategy :: XNewtypeStrategy pass -> DerivStrategy pass
-- |
-- -XDerivingVia
--
ViaStrategy :: XViaStrategy pass -> DerivStrategy pass
-- | Stand-alone 'deriving instance' declaration
data DerivDecl pass
DerivDecl :: XCDerivDecl pass -> LHsSigWcType pass -> Maybe (LDerivStrategy pass) -> Maybe (XRec pass OverlapMode) -> DerivDecl pass
[deriv_ext] :: DerivDecl pass -> XCDerivDecl pass
-- | The instance type to derive.
--
-- It uses an LHsSigWcType because the context is allowed to be a
-- single wildcard:
--
--
-- deriving instance _ => Eq (Foo a)
--
--
-- Which signifies that the context should be inferred.
[deriv_type] :: DerivDecl pass -> LHsSigWcType pass
[deriv_strategy] :: DerivDecl pass -> Maybe (LDerivStrategy pass)
-- |
[deriv_overlap_mode] :: DerivDecl pass -> Maybe (XRec pass OverlapMode)
XDerivDecl :: !XXDerivDecl pass -> DerivDecl pass
-- | The types mentioned in a single deriving clause. This can
-- come in two forms, DctSingle or DctMulti, depending on
-- whether the types are surrounded by enclosing parentheses or not.
-- These parentheses are semantically different than HsParTy. For
-- example, deriving () means "derive zero classes" rather than
-- "derive an instance of the 0-tuple".
--
-- DerivClauseTys use LHsSigType because deriving
-- clauses can mention type variables that aren't bound by the datatype,
-- e.g.
--
--
-- data T b = ... deriving (C [a])
--
--
-- should produce a derived instance for C [a] (T b).
data DerivClauseTys pass
-- | A deriving clause with a single type. Moreover, that type can
-- only be a type constructor without any arguments.
--
-- Example: deriving Eq
DctSingle :: XDctSingle pass -> LHsSigType pass -> DerivClauseTys pass
-- | A deriving clause with a comma-separated list of types,
-- surrounded by enclosing parentheses.
--
-- Example: deriving (Eq, C a)
DctMulti :: XDctMulti pass -> [LHsSigType pass] -> DerivClauseTys pass
XDerivClauseTys :: !XXDerivClauseTys pass -> DerivClauseTys pass
-- | Default Declaration
data DefaultDecl pass
-- |
DefaultDecl :: XCDefaultDecl pass -> [LHsType pass] -> DefaultDecl pass
XDefaultDecl :: !XXDefaultDecl pass -> DefaultDecl pass
-- | Data Family Instance Declaration
newtype DataFamInstDecl pass
-- |
DataFamInstDecl :: FamEqn pass (HsDataDefn pass) -> DataFamInstDecl pass
[dfid_eqn] :: DataFamInstDecl pass -> FamEqn pass (HsDataDefn pass)
data DataDeclRn
DataDeclRn :: Bool -> NameSet -> DataDeclRn
-- | does this have a CUSK? See Note [CUSKs: complete user-supplied kind
-- signatures]
[tcdDataCusk] :: DataDeclRn -> Bool
[tcdFVs] :: DataDeclRn -> NameSet
-- |
-- data T b = forall a. Eq a => MkT a b
-- MkT :: forall b a. Eq a => MkT a b
--
-- data T b where
-- MkT1 :: Int -> T Int
--
-- data T = Int MkT Int
-- | MkT2
--
-- data T a where
-- Int MkT Int :: T Int
--
--
--
--
-- data Constructor Declaration
data ConDecl pass
ConDeclGADT :: XConDeclGADT pass -> [LIdP pass] -> XRec pass (HsOuterSigTyVarBndrs pass) -> Maybe (LHsContext pass) -> HsConDeclGADTDetails pass -> LHsType pass -> Maybe LHsDocString -> ConDecl pass
[con_g_ext] :: ConDecl pass -> XConDeclGADT pass
[con_names] :: ConDecl pass -> [LIdP pass]
-- | The outermost type variable binders, be they explicit or implicit. The
-- XRec is used to anchor exact print annotations, AnnForall and
-- AnnDot.
[con_bndrs] :: ConDecl pass -> XRec pass (HsOuterSigTyVarBndrs pass)
-- | User-written context (if any)
[con_mb_cxt] :: ConDecl pass -> Maybe (LHsContext pass)
-- | Arguments; never infix
[con_g_args] :: ConDecl pass -> HsConDeclGADTDetails pass
-- | Result type
[con_res_ty] :: ConDecl pass -> LHsType pass
-- | A possible Haddock comment.
[con_doc] :: ConDecl pass -> Maybe LHsDocString
ConDeclH98 :: XConDeclH98 pass -> LIdP pass -> Bool -> [LHsTyVarBndr Specificity pass] -> Maybe (LHsContext pass) -> HsConDeclH98Details pass -> Maybe LHsDocString -> ConDecl pass
[con_ext] :: ConDecl pass -> XConDeclH98 pass
[con_name] :: ConDecl pass -> LIdP pass
-- | True = explicit user-written forall e.g. data T a = forall b.
-- MkT b (b->a) con_ex_tvs = {b} False => con_ex_tvs is empty
[con_forall] :: ConDecl pass -> Bool
-- | Existentials only
[con_ex_tvs] :: ConDecl pass -> [LHsTyVarBndr Specificity pass]
-- | User-written context (if any)
[con_mb_cxt] :: ConDecl pass -> Maybe (LHsContext pass)
-- | Arguments; can be infix
[con_args] :: ConDecl pass -> HsConDeclH98Details pass
-- | A possible Haddock comment.
[con_doc] :: ConDecl pass -> Maybe LHsDocString
XConDecl :: !XXConDecl pass -> ConDecl pass
-- | Class Instance Declaration
data ClsInstDecl pass
ClsInstDecl :: XCClsInstDecl pass -> LHsSigType pass -> LHsBinds pass -> [LSig pass] -> [LTyFamInstDecl pass] -> [LDataFamInstDecl pass] -> Maybe (XRec pass OverlapMode) -> ClsInstDecl pass
[cid_ext] :: ClsInstDecl pass -> XCClsInstDecl pass
[cid_poly_ty] :: ClsInstDecl pass -> LHsSigType pass
[cid_binds] :: ClsInstDecl pass -> LHsBinds pass
[cid_sigs] :: ClsInstDecl pass -> [LSig pass]
[cid_tyfam_insts] :: ClsInstDecl pass -> [LTyFamInstDecl pass]
[cid_datafam_insts] :: ClsInstDecl pass -> [LDataFamInstDecl pass]
-- |
[cid_overlap_mode] :: ClsInstDecl pass -> Maybe (XRec pass OverlapMode)
XClsInstDecl :: !XXClsInstDecl pass -> ClsInstDecl pass
data CImportSpec
CLabel :: CLabelString -> CImportSpec
CFunction :: CCallTarget -> CImportSpec
CWrapper :: CImportSpec
-- | Annotation Provenance
data AnnProvenance pass
ValueAnnProvenance :: LIdP pass -> AnnProvenance pass
TypeAnnProvenance :: LIdP pass -> AnnProvenance pass
ModuleAnnProvenance :: AnnProvenance pass
-- | Annotation Declaration
data AnnDecl pass
-- |
HsAnnotation :: XHsAnnotation pass -> SourceText -> AnnProvenance pass -> XRec pass (HsExpr pass) -> AnnDecl pass
XAnnDecl :: !XXAnnDecl pass -> AnnDecl pass
tyClGroupTyClDecls :: [TyClGroup pass] -> [LTyClDecl pass]
tyClGroupRoleDecls :: [TyClGroup pass] -> [LRoleAnnotDecl pass]
tyClGroupKindSigs :: [TyClGroup pass] -> [LStandaloneKindSig pass]
tyClGroupInstDecls :: [TyClGroup pass] -> [LInstDecl pass]
tyClDeclTyVars :: TyClDecl pass -> LHsQTyVars pass
pprFullRuleName :: Located (SourceText, RuleName) -> SDoc
pprFlavour :: FamilyInfo pass -> SDoc
-- | Convert a NewOrData to a TyConFlavour
newOrDataToFlavour :: NewOrData -> TyConFlavour
-- | type family declaration
isTypeFamilyDecl :: TyClDecl pass -> Bool
-- | type or type instance declaration
isSynDecl :: TyClDecl pass -> Bool
-- | open type family info
isOpenTypeFamilyInfo :: FamilyInfo pass -> Bool
-- | type/data family declaration
isFamilyDecl :: TyClDecl pass -> Bool
-- | data family declaration
isDataFamilyDecl :: TyClDecl pass -> Bool
-- | True = argument is a data/newtype
-- declaration.
isDataDecl :: TyClDecl pass -> Bool
-- | closed type family info
isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool
-- | type class
isClassDecl :: TyClDecl pass -> Bool
hsGroupInstDecls :: HsGroup id -> [LInstDecl id]
docDeclDoc :: DocDecl -> HsDocString
-- | A short description of a DerivStrategy'.
derivStrategyName :: DerivStrategy a -> SDoc
countTyClDecls :: [TyClDecl pass] -> (Int, Int, Int, Int, Int)
collectRuleBndrSigTys :: [RuleBndr pass] -> [HsPatSigType pass]
annProvenanceName_maybe :: UnXRec p => AnnProvenance p -> Maybe (IdP p)
-- | Type checker Specialisation Pragmas
--
-- TcSpecPrags conveys SPECIALISE pragmas from the type
-- checker to the desugarer
data TcSpecPrags
-- | Super-specialised: a default method should be macro-expanded at every
-- call site
IsDefaultMethod :: TcSpecPrags
SpecPrags :: [LTcSpecPrag] -> TcSpecPrags
-- | Type checker Specification Pragma
data TcSpecPrag
-- | The Id to be specialised, a wrapper that specialises the polymorphic
-- function, and inlining spec for the specialised function
SpecPrag :: Id -> HsWrapper -> InlinePragma -> TcSpecPrag
-- | Signatures and pragmas
data Sig pass
-- | An ordinary type signature
--
--
-- f :: Num a => a -> a
--
--
-- After renaming, this list of Names contains the named wildcards
-- brought into scope by this signature. For a signature _ -> _a
-- -> Bool, the renamer will leave the unnamed wildcard
-- _ untouched, and the named wildcard _a is then
-- replaced with fresh meta vars in the type. Their names are stored in
-- the type signature that brought them into scope, in this third field
-- to be more specific.
--
--
TypeSig :: XTypeSig pass -> [LIdP pass] -> LHsSigWcType pass -> Sig pass
-- | A pattern synonym type signature
--
--
-- pattern Single :: () => (Show a) => a -> [a]
--
--
--
PatSynSig :: XPatSynSig pass -> [LIdP pass] -> LHsSigType pass -> Sig pass
-- | A signature for a class method False: ordinary class-method signature
-- True: generic-default class method signature e.g. class C a where op
-- :: a -> a -- Ordinary default op :: Eq a => a -> a -- Generic
-- default No wildcards allowed here
--
--
ClassOpSig :: XClassOpSig pass -> Bool -> [LIdP pass] -> LHsSigType pass -> Sig pass
-- | A type signature in generated code, notably the code generated for
-- record selectors. We simply record the desired Id itself, replete with
-- its name, type and IdDetails. Otherwise it's just like a type
-- signature: there should be an accompanying binding
IdSig :: XIdSig pass -> Id -> Sig pass
-- | An ordinary fixity declaration
--
--
-- infixl 8 ***
--
--
--
FixSig :: XFixSig pass -> FixitySig pass -> Sig pass
-- | An inline pragma
--
--
-- {#- INLINE f #-}
--
--
--
InlineSig :: XInlineSig pass -> LIdP pass -> InlinePragma -> Sig pass
-- | A specialisation pragma
--
--
-- {-# SPECIALISE f :: Int -> Int #-}
--
--
--
SpecSig :: XSpecSig pass -> LIdP pass -> [LHsSigType pass] -> InlinePragma -> Sig pass
-- | A specialisation pragma for instance declarations only
--
--
-- {-# SPECIALISE instance Eq [Int] #-}
--
--
-- (Class tys); should be a specialisation of the current instance
-- declaration
--
--
SpecInstSig :: XSpecInstSig pass -> SourceText -> LHsSigType pass -> Sig pass
-- | A minimal complete definition pragma
--
--
-- {-# MINIMAL a | (b, c | (d | e)) #-}
--
--
--
MinimalSig :: XMinimalSig pass -> SourceText -> LBooleanFormula (LIdP pass) -> Sig pass
-- | A "set cost centre" pragma for declarations
--
--
-- {-# SCC funName #-}
--
--
-- or
--
--
-- {-# SCC funName "cost_centre_name" #-}
--
SCCFunSig :: XSCCFunSig pass -> SourceText -> LIdP pass -> Maybe (XRec pass StringLiteral) -> Sig pass
-- | A complete match pragma
--
--
-- {-# COMPLETE C, D [:: T] #-}
--
--
-- Used to inform the pattern match checker about additional complete
-- matchings which, for example, arise from pattern synonym definitions.
CompleteMatchSig :: XCompleteMatchSig pass -> SourceText -> XRec pass [LIdP pass] -> Maybe (LIdP pass) -> Sig pass
XSig :: !XXSig pass -> Sig pass
-- | Record Pattern Synonym Field
data RecordPatSynField pass
RecordPatSynField :: FieldOcc pass -> LIdP pass -> RecordPatSynField pass
-- | Field label visible in rest of the file
[recordPatSynField] :: RecordPatSynField pass -> FieldOcc pass
-- | Filled in by renamer, the name used internally by the pattern
[recordPatSynPatVar] :: RecordPatSynField pass -> LIdP pass
-- |
--
-- Pattern Synonym binding
data PatSynBind idL idR
PSB :: XPSB idL idR -> LIdP idL -> HsPatSynDetails idR -> LPat idR -> HsPatSynDir idR -> PatSynBind idL idR
-- | Post renaming, FVs. See Note [Bind free vars]
[psb_ext] :: PatSynBind idL idR -> XPSB idL idR
-- | Name of the pattern synonym
[psb_id] :: PatSynBind idL idR -> LIdP idL
-- | Formal parameter names
[psb_args] :: PatSynBind idL idR -> HsPatSynDetails idR
-- | Right-hand side
[psb_def] :: PatSynBind idL idR -> LPat idR
-- | Directionality
[psb_dir] :: PatSynBind idL idR -> HsPatSynDir idR
XPatSynBind :: !XXPatSynBind idL idR -> PatSynBind idL idR
-- | Located Type checker Specification Pragmas
type LTcSpecPrag = Located TcSpecPrag
-- | Located Signature
type LSig pass = XRec pass Sig pass
-- | Located Implicit Parameter Binding
--
-- May have AnnKeywordId : AnnSemi when in a list
type LIPBind id = XRec id IPBind id
type LHsLocalBindsLR idL idR = XRec idL HsLocalBindsLR idL idR
-- | Located Haskell local bindings
type LHsLocalBinds id = XRec id HsLocalBinds id
-- | Located Haskell Bindings with separate Left and Right identifier types
type LHsBindsLR idL idR = Bag LHsBindLR idL idR
-- | Located Haskell Bindings
type LHsBinds id = LHsBindsLR id id
-- | Located Haskell Binding with separate Left and Right identifier types
type LHsBindLR idL idR = XRec idL HsBindLR idL idR
-- | Located Haskell Binding
type LHsBind id = LHsBindLR id id
-- | Located Fixity Signature
type LFixitySig pass = XRec pass FixitySig pass
-- | Implicit parameter bindings.
--
-- These bindings start off as (Left "x") in the parser and stay that way
-- until after type-checking when they are replaced with (Right d), where
-- "d" is the name of the dictionary holding the evidence for the
-- implicit parameter.
--
--
data IPBind id
IPBind :: XCIPBind id -> Either (XRec id HsIPName) (IdP id) -> LHsExpr id -> IPBind id
XIPBind :: !XXIPBind id -> IPBind id
-- | Haskell Value bindings with separate Left and Right identifier types
-- (not implicit parameters) Used for both top level and nested bindings
-- May contain pattern synonym bindings
data HsValBindsLR idL idR
-- | Value Bindings In
--
-- Before renaming RHS; idR is always RdrName Not dependency analysed
-- Recursive by default
ValBinds :: XValBinds idL idR -> LHsBindsLR idL idR -> [LSig idR] -> HsValBindsLR idL idR
-- | Value Bindings Out
--
-- After renaming RHS; idR can be Name or Id Dependency analysed, later
-- bindings in the list may depend on earlier ones.
XValBindsLR :: !XXValBindsLR idL idR -> HsValBindsLR idL idR
-- | Haskell Value Bindings
type HsValBinds id = HsValBindsLR id id
-- | Haskell Pattern Synonym Direction
data HsPatSynDir id
Unidirectional :: HsPatSynDir id
ImplicitBidirectional :: HsPatSynDir id
ExplicitBidirectional :: MatchGroup id (LHsExpr id) -> HsPatSynDir id
-- | Haskell Pattern Synonym Details
type HsPatSynDetails pass = HsConDetails Void LIdP pass [RecordPatSynField pass]
-- | Haskell Local Bindings with separate Left and Right identifier types
--
-- Bindings in a 'let' expression or a 'where' clause
data HsLocalBindsLR idL idR
-- | Haskell Value Bindings
HsValBinds :: XHsValBinds idL idR -> HsValBindsLR idL idR -> HsLocalBindsLR idL idR
-- | Haskell Implicit Parameter Bindings
HsIPBinds :: XHsIPBinds idL idR -> HsIPBinds idR -> HsLocalBindsLR idL idR
-- | Empty Local Bindings
EmptyLocalBinds :: XEmptyLocalBinds idL idR -> HsLocalBindsLR idL idR
XHsLocalBindsLR :: !XXHsLocalBindsLR idL idR -> HsLocalBindsLR idL idR
-- | Haskell Local Bindings
type HsLocalBinds id = HsLocalBindsLR id id
-- | Haskell Implicit Parameter Bindings
data HsIPBinds id
IPBinds :: XIPBinds id -> [LIPBind id] -> HsIPBinds id
XHsIPBinds :: !XXHsIPBinds id -> HsIPBinds id
-- | Haskell Binding with separate Left and Right id's
data HsBindLR idL idR
-- | Function-like Binding
--
-- FunBind is used for both functions f x = e and variables
-- f = x -> e and strict variables !x = x + 1
--
-- Reason 1: Special case for type inference: see tcMonoBinds.
--
-- Reason 2: Instance decls can only have FunBinds, which is convenient.
-- If you change this, you'll need to change e.g. rnMethodBinds
--
-- But note that the form f :: a->a = ... parses as a pattern
-- binding, just like (f :: a -> a) = ...
--
-- Strict bindings have their strictness recorded in the
-- SrcStrictness of their MatchContext. See Note [FunBind
-- vs PatBind] for details about the relationship between FunBind and
-- PatBind.
--
-- AnnKeywordIds
--
--
FunBind :: XFunBind idL idR -> LIdP idL -> MatchGroup idR (LHsExpr idR) -> [CoreTickish] -> HsBindLR idL idR
-- | After the renamer (but before the type-checker), this contains the
-- locally-bound free variables of this defn. See Note [Bind free vars]
--
-- After the type-checker, this contains a coercion from the type of the
-- MatchGroup to the type of the Id. Example:
--
--
-- f :: Int -> forall a. a -> a
-- f x y = y
--
--
-- Then the MatchGroup will have type (Int -> a' -> a') (with a
-- free type variable a'). The coercion will take a CoreExpr of this type
-- and convert it to a CoreExpr of type Int -> forall a'. a' -> a'
-- Notice that the coercion captures the free a'.
[fun_ext] :: HsBindLR idL idR -> XFunBind idL idR
[fun_id] :: HsBindLR idL idR -> LIdP idL
-- | The payload
[fun_matches] :: HsBindLR idL idR -> MatchGroup idR (LHsExpr idR)
-- | Ticks to put on the rhs, if any
[fun_tick] :: HsBindLR idL idR -> [CoreTickish]
-- | Pattern Binding
--
-- The pattern is never a simple variable; That case is done by FunBind.
-- See Note [FunBind vs PatBind] for details about the relationship
-- between FunBind and PatBind.
PatBind :: XPatBind idL idR -> LPat idL -> GRHSs idR (LHsExpr idR) -> ([CoreTickish], [[CoreTickish]]) -> HsBindLR idL idR
-- | See Note [Bind free vars]
[pat_ext] :: HsBindLR idL idR -> XPatBind idL idR
[pat_lhs] :: HsBindLR idL idR -> LPat idL
[pat_rhs] :: HsBindLR idL idR -> GRHSs idR (LHsExpr idR)
-- | Ticks to put on the rhs, if any, and ticks to put on the bound
-- variables.
[pat_ticks] :: HsBindLR idL idR -> ([CoreTickish], [[CoreTickish]])
-- | Variable Binding
--
-- Dictionary binding and suchlike. All VarBinds are introduced by the
-- type checker
VarBind :: XVarBind idL idR -> IdP idL -> LHsExpr idR -> HsBindLR idL idR
[var_ext] :: HsBindLR idL idR -> XVarBind idL idR
[var_id] :: HsBindLR idL idR -> IdP idL
-- | Located only for consistency
[var_rhs] :: HsBindLR idL idR -> LHsExpr idR
-- | Abstraction Bindings
AbsBinds :: XAbsBinds idL idR -> [TyVar] -> [EvVar] -> [ABExport idL] -> [TcEvBinds] -> LHsBinds idL -> Bool -> HsBindLR idL idR
[abs_ext] :: HsBindLR idL idR -> XAbsBinds idL idR
[abs_tvs] :: HsBindLR idL idR -> [TyVar]
-- | Includes equality constraints
[abs_ev_vars] :: HsBindLR idL idR -> [EvVar]
-- | AbsBinds only gets used when idL = idR after renaming, but these need
-- to be idL's for the collect... code in HsUtil to have the right type
[abs_exports] :: HsBindLR idL idR -> [ABExport idL]
-- | Evidence bindings Why a list? See GHC.Tc.TyCl.Instance Note
-- [Typechecking plan for instance declarations]
[abs_ev_binds] :: HsBindLR idL idR -> [TcEvBinds]
-- | Typechecked user bindings
[abs_binds] :: HsBindLR idL idR -> LHsBinds idL
[abs_sig] :: HsBindLR idL idR -> Bool
-- | Patterns Synonym Binding
PatSynBind :: XPatSynBind idL idR -> PatSynBind idL idR -> HsBindLR idL idR
XHsBindsLR :: !XXHsBindsLR idL idR -> HsBindLR idL idR
-- | Haskell Binding
type HsBind id = HsBindLR id id
-- | Fixity Signature
data FixitySig pass
FixitySig :: XFixitySig pass -> [LIdP pass] -> Fixity -> FixitySig pass
XFixitySig :: !XXFixitySig pass -> FixitySig pass
-- | Abstraction Bindings Export
data ABExport p
ABE :: XABE p -> IdP p -> IdP p -> HsWrapper -> TcSpecPrags -> ABExport p
[abe_ext] :: ABExport p -> XABE p
-- | Any INLINE pragma is attached to this Id
[abe_poly] :: ABExport p -> IdP p
[abe_mono] :: ABExport p -> IdP p
-- | See Note [ABExport wrapper] Shape: (forall abs_tvs. abs_ev_vars =>
-- abe_mono) ~ abe_poly
[abe_wrap] :: ABExport p -> HsWrapper
-- | SPECIALISE pragmas
[abe_prags] :: ABExport p -> TcSpecPrags
XABExport :: !XXABExport p -> ABExport p
noSpecPrags :: TcSpecPrags
isTypeLSig :: UnXRec p => LSig p -> Bool
isSpecLSig :: UnXRec p => LSig p -> Bool
isSpecInstLSig :: UnXRec p => LSig p -> Bool
isSCCFunSig :: UnXRec p => LSig p -> Bool
isPragLSig :: UnXRec p => LSig p -> Bool
isMinimalLSig :: UnXRec p => LSig p -> Bool
isInlineLSig :: UnXRec p => LSig p -> Bool
isFixityLSig :: UnXRec p => LSig p -> Bool
isDefaultMethod :: TcSpecPrags -> Bool
isCompleteMatchSig :: UnXRec p => LSig p -> Bool
hsSigDoc :: Sig name -> SDoc
hasSpecPrags :: TcSpecPrags -> Bool
pprLPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> SDoc
-- | Located Haskell Record Update Field
type LHsRecUpdField p = XRec p HsRecUpdField p
-- | Located Haskell Record Field
type LHsRecField' p id arg = XRec p HsRecField' id arg
-- | Located Haskell Record Field
type LHsRecField p arg = XRec p HsRecField p arg
-- | Haskell Record Update Field
type HsRecUpdField p = HsRecField' AmbiguousFieldOcc p LHsExpr p
-- | Haskell Record Fields
--
-- HsRecFields is used only for patterns and expressions (not data type
-- declarations)
data HsRecFields p arg
HsRecFields :: [LHsRecField p arg] -> Maybe (Located Int) -> HsRecFields p arg
[rec_flds] :: HsRecFields p arg -> [LHsRecField p arg]
[rec_dotdot] :: HsRecFields p arg -> Maybe (Located Int)
-- | Haskell Record Field
--
--
--
-- For details on above see note [exact print annotations] in
-- GHC.Parser.Annotation
data HsRecField' id arg
HsRecField :: XHsRecField id -> Located id -> arg -> Bool -> HsRecField' id arg
[hsRecFieldAnn] :: HsRecField' id arg -> XHsRecField id
[hsRecFieldLbl] :: HsRecField' id arg -> Located id
-- | Filled in by renamer when punning
[hsRecFieldArg] :: HsRecField' id arg -> arg
-- | Note [Punning]
[hsRecPun] :: HsRecField' id arg -> Bool
-- | Haskell Record Field
type HsRecField p arg = HsRecField' FieldOcc p arg
-- | Haskell Constructor Pattern Details
type HsConPatDetails p = HsConDetails HsPatSigType NoGhcTc p LPat p HsRecFields p LPat p
type family ConLikeP x
hsRecFieldsArgs :: UnXRec p => HsRecFields p arg -> [arg]
hsRecFields :: UnXRec p => HsRecFields p arg -> [XCFieldOcc p]
hsRecFieldSel :: HsRecField pass arg -> Located (XCFieldOcc pass)
hsConPatArgs :: UnXRec p => HsConPatDetails p -> [LPat p]
-- | Located Haskell Wildcard Type
type LHsWcType pass = HsWildCardBndrs pass LHsType pass
type LHsTypeArg p = HsArg LHsType p LHsKind p
-- | Located Haskell Type
type LHsType pass = XRec pass HsType pass
-- | Located Haskell Type Variable Binder
type LHsTyVarBndr flag pass = XRec pass HsTyVarBndr flag pass
-- | Located Haskell Signature Wildcard Type
type LHsSigWcType pass = HsWildCardBndrs pass LHsSigType pass
-- | Located Haskell Signature Type
type LHsSigType pass = XRec pass HsSigType pass
-- | Located Haskell Quantified Type Variables
data LHsQTyVars pass
HsQTvs :: XHsQTvs pass -> [LHsTyVarBndr () pass] -> LHsQTyVars pass
[hsq_ext] :: LHsQTyVars pass -> XHsQTvs pass
[hsq_explicit] :: LHsQTyVars pass -> [LHsTyVarBndr () pass]
XLHsQTyVars :: !XXLHsQTyVars pass -> LHsQTyVars pass
-- | Located Haskell Kind
type LHsKind pass = XRec pass HsKind pass
-- | Located Haskell Context
type LHsContext pass = XRec pass HsContext pass
-- | Located Field Occurrence
type LFieldOcc pass = XRec pass FieldOcc pass
-- | Located Constructor Declaration Field
type LConDeclField pass = XRec pass ConDeclField pass
-- | Located Bang Type
type LBangType pass = XRec pass BangType pass
-- | Haskell Wildcard Binders
data HsWildCardBndrs pass thing
HsWC :: XHsWC pass thing -> thing -> HsWildCardBndrs pass thing
[hswc_ext] :: HsWildCardBndrs pass thing -> XHsWC pass thing
[hswc_body] :: HsWildCardBndrs pass thing -> thing
XHsWildCardBndrs :: !XXHsWildCardBndrs pass thing -> HsWildCardBndrs pass thing
-- | Haskell Type
data HsType pass
-- |
HsForAllTy :: XForAllTy pass -> HsForAllTelescope pass -> LHsType pass -> HsType pass
[hst_xforall] :: HsType pass -> XForAllTy pass
[hst_tele] :: HsType pass -> HsForAllTelescope pass
[hst_body] :: HsType pass -> LHsType pass
HsQualTy :: XQualTy pass -> Maybe (LHsContext pass) -> LHsType pass -> HsType pass
[hst_xqual] :: HsType pass -> XQualTy pass
[hst_ctxt] :: HsType pass -> Maybe (LHsContext pass)
[hst_body] :: HsType pass -> LHsType pass
-- |
HsTyVar :: XTyVar pass -> PromotionFlag -> LIdP pass -> HsType pass
-- |
HsAppTy :: XAppTy pass -> LHsType pass -> LHsType pass -> HsType pass
HsAppKindTy :: XAppKindTy pass -> LHsType pass -> LHsKind pass -> HsType pass
-- |
HsFunTy :: XFunTy pass -> HsArrow pass -> LHsType pass -> LHsType pass -> HsType pass
-- |
HsListTy :: XListTy pass -> LHsType pass -> HsType pass
-- |
HsTupleTy :: XTupleTy pass -> HsTupleSort -> [LHsType pass] -> HsType pass
-- |
HsSumTy :: XSumTy pass -> [LHsType pass] -> HsType pass
-- |
HsOpTy :: XOpTy pass -> LHsType pass -> LIdP pass -> LHsType pass -> HsType pass
-- |
HsParTy :: XParTy pass -> LHsType pass -> HsType pass
-- |
-- (?x :: ty)
--
--
--
HsIParamTy :: XIParamTy pass -> XRec pass HsIPName -> LHsType pass -> HsType pass
-- |
HsStarTy :: XStarTy pass -> Bool -> HsType pass
-- |
-- (ty :: kind)
--
--
--
HsKindSig :: XKindSig pass -> LHsType pass -> LHsKind pass -> HsType pass
-- |
HsSpliceTy :: XSpliceTy pass -> HsSplice pass -> HsType pass
-- |
HsDocTy :: XDocTy pass -> LHsType pass -> LHsDocString -> HsType pass
-- |
HsBangTy :: XBangTy pass -> HsSrcBang -> LHsType pass -> HsType pass
-- |
HsRecTy :: XRecTy pass -> [LConDeclField pass] -> HsType pass
-- |
HsExplicitListTy :: XExplicitListTy pass -> PromotionFlag -> [LHsType pass] -> HsType pass
-- |
HsExplicitTupleTy :: XExplicitTupleTy pass -> [LHsType pass] -> HsType pass
-- |
HsTyLit :: XTyLit pass -> HsTyLit -> HsType pass
-- |
HsWildCardTy :: XWildCardTy pass -> HsType pass
XHsType :: !XXType pass -> HsType pass
-- | Haskell Type Variable Binder The flag annotates the binder. It is
-- Specificity in places where explicit specificity is allowed
-- (e.g. x :: forall {a} b. ...) or () in other places.
data HsTyVarBndr flag pass
UserTyVar :: XUserTyVar pass -> flag -> LIdP pass -> HsTyVarBndr flag pass
-- |
KindedTyVar :: XKindedTyVar pass -> flag -> LIdP pass -> LHsKind pass -> HsTyVarBndr flag pass
XTyVarBndr :: !XXTyVarBndr pass -> HsTyVarBndr flag pass
-- | Haskell Type Literal
data HsTyLit
HsNumTy :: SourceText -> Integer -> HsTyLit
HsStrTy :: SourceText -> FastString -> HsTyLit
HsCharTy :: SourceText -> Char -> HsTyLit
-- | Haskell Tuple Sort
data HsTupleSort
HsUnboxedTuple :: HsTupleSort
HsBoxedOrConstraintTuple :: HsTupleSort
-- | A type signature that obeys the forall-or-nothing rule. In
-- other words, an LHsType that uses an
-- HsOuterSigTyVarBndrs to represent its outermost type variable
-- quantification. See Note [Representing type signatures].
data HsSigType pass
HsSig :: XHsSig pass -> HsOuterSigTyVarBndrs pass -> LHsType pass -> HsSigType pass
[sig_ext] :: HsSigType pass -> XHsSig pass
[sig_bndrs] :: HsSigType pass -> HsOuterSigTyVarBndrs pass
[sig_body] :: HsSigType pass -> LHsType pass
XHsSigType :: !XXHsSigType pass -> HsSigType pass
-- | This is used in the syntax. In constructor declaration. It must keep
-- the arrow representation.
data HsScaled pass a
HsScaled :: HsArrow pass -> a -> HsScaled pass a
-- | Types that can appear in pattern signatures, as well as the signatures
-- for term-level binders in RULES. See Note [Pattern signature
-- binders and scoping].
--
-- This is very similar to HsSigWcType, but with slightly
-- different semantics: see Note [HsType binders]. See also
-- Note [The wildcard story for types].
data HsPatSigType pass
HsPS :: XHsPS pass -> LHsType pass -> HsPatSigType pass
-- | After renamer: HsPSRn
[hsps_ext] :: HsPatSigType pass -> XHsPS pass
-- | Main payload (the type itself)
[hsps_body] :: HsPatSigType pass -> LHsType pass
XHsPatSigType :: !XXHsPatSigType pass -> HsPatSigType pass
-- | The extension field for HsPatSigType, which is only used in the
-- renamer onwards. See Note [Pattern signature binders and
-- scoping].
data HsPSRn
HsPSRn :: [Name] -> [Name] -> HsPSRn
-- | Wildcard names
[hsps_nwcs] :: HsPSRn -> [Name]
-- | Implicitly bound variable names
[hsps_imp_tvs] :: HsPSRn -> [Name]
-- | The outermost type variables in a type that obeys the
-- forall-or-nothing rule. See Note [forall-or-nothing
-- rule].
data HsOuterTyVarBndrs flag pass
-- | Implicit forall, e.g., f :: a -> b -> b
HsOuterImplicit :: XHsOuterImplicit pass -> HsOuterTyVarBndrs flag pass
[hso_ximplicit] :: HsOuterTyVarBndrs flag pass -> XHsOuterImplicit pass
-- | Explicit forall, e.g., f :: forall a b. a -> b -> b
HsOuterExplicit :: XHsOuterExplicit pass flag -> [LHsTyVarBndr flag (NoGhcTc pass)] -> HsOuterTyVarBndrs flag pass
[hso_xexplicit] :: HsOuterTyVarBndrs flag pass -> XHsOuterExplicit pass flag
[hso_bndrs] :: HsOuterTyVarBndrs flag pass -> [LHsTyVarBndr flag (NoGhcTc pass)]
XHsOuterTyVarBndrs :: !XXHsOuterTyVarBndrs pass -> HsOuterTyVarBndrs flag pass
-- | Used for signatures, e.g.,
--
--
-- f :: forall a {b}. blah
--
--
-- We use Specificity for the HsOuterTyVarBndrs
-- flag to allow distinguishing between specified and inferred
-- type variables.
type HsOuterSigTyVarBndrs = HsOuterTyVarBndrs Specificity
-- | Used for type-family instance equations, e.g.,
--
--
-- type instance forall a. F [a] = Tree a
--
--
-- The notion of specificity is irrelevant in type family equations, so
-- we use () for the HsOuterTyVarBndrs flag.
type HsOuterFamEqnTyVarBndrs = HsOuterTyVarBndrs ()
-- | Haskell Kind
type HsKind pass = HsType pass
-- | These names are used early on to store the names of implicit
-- parameters. They completely disappear after type-checking.
newtype HsIPName
HsIPName :: FastString -> HsIPName
-- | The type variable binders in an HsForAllTy. See also Note
-- [Variable Specificity and Forall Visibility] in
-- GHC.Tc.Gen.HsType.
data HsForAllTelescope pass
-- | A visible forall (e.g., forall a -> {...}). These
-- do not have any notion of specificity, so we use () as a
-- placeholder value.
HsForAllVis :: XHsForAllVis pass -> [LHsTyVarBndr () pass] -> HsForAllTelescope pass
[hsf_xvis] :: HsForAllTelescope pass -> XHsForAllVis pass
[hsf_vis_bndrs] :: HsForAllTelescope pass -> [LHsTyVarBndr () pass]
-- | An invisible forall (e.g., forall a {b} c. {...}),
-- where each binder has a Specificity.
HsForAllInvis :: XHsForAllInvis pass -> [LHsTyVarBndr Specificity pass] -> HsForAllTelescope pass
[hsf_xinvis] :: HsForAllTelescope pass -> XHsForAllInvis pass
[hsf_invis_bndrs] :: HsForAllTelescope pass -> [LHsTyVarBndr Specificity pass]
XHsForAllTelescope :: !XXHsForAllTelescope pass -> HsForAllTelescope pass
type HsCoreTy = Type
-- | Haskell Context
type HsContext pass = [LHsType pass]
-- | Describes the arguments to a data constructor. This is a common
-- representation for several constructor-related concepts, including:
--
--
-- - The arguments in a Haskell98-style constructor declaration (see
-- HsConDeclH98Details in GHC.Hs.Decls).
-- - The arguments in constructor patterns in case/function
-- definitions (see HsConPatDetails in GHC.Hs.Pat).
-- - The left-hand side arguments in a pattern synonym binding (see
-- HsPatSynDetails in GHC.Hs.Binds).
--
--
-- One notable exception is the arguments in a GADT constructor, which
-- uses a separate data type entirely (see HsConDeclGADTDetails
-- in GHC.Hs.Decls). This is because GADT constructors cannot be
-- declared with infix syntax, unlike the concepts above (#18844).
data HsConDetails tyarg arg rec
PrefixCon :: [tyarg] -> [arg] -> HsConDetails tyarg arg rec
RecCon :: rec -> HsConDetails tyarg arg rec
InfixCon :: arg -> arg -> HsConDetails tyarg arg rec
-- | Denotes the type of arrows in the surface language
data HsArrow pass
-- | a -> b or a → b
HsUnrestrictedArrow :: IsUnicodeSyntax -> HsArrow pass
-- | a %1 -> b or a %1 → b, or a ⊸ b
HsLinearArrow :: IsUnicodeSyntax -> Maybe AddEpAnn -> HsArrow pass
-- | a %m -> b or a %m → b (very much including `a %Many -> b`! This
-- is how the programmer wrote it). It is stored as an HsType so
-- as to preserve the syntax as written in the program.
HsExplicitMult :: IsUnicodeSyntax -> Maybe AddEpAnn -> LHsType pass -> HsArrow pass
data HsArg tm ty
HsValArg :: tm -> HsArg tm ty
HsTypeArg :: SrcSpan -> ty -> HsArg tm ty
HsArgPar :: SrcSpan -> HsArg tm ty
-- | Field Occurrence
--
-- Represents an *occurrence* of an unambiguous field. This may or may
-- not be a binding occurrence (e.g. this type is used in
-- ConDeclField and RecordPatSynField which bind their
-- fields, but also in HsRecField for record construction and
-- patterns, which do not).
--
-- We store both the RdrName the user originally wrote, and after
-- the renamer, the selector function.
data FieldOcc pass
FieldOcc :: XCFieldOcc pass -> LocatedN RdrName -> FieldOcc pass
[extFieldOcc] :: FieldOcc pass -> XCFieldOcc pass
-- | See Note [Located RdrNames] in GHC.Hs.Expr
[rdrNameFieldOcc] :: FieldOcc pass -> LocatedN RdrName
XFieldOcc :: !XXFieldOcc pass -> FieldOcc pass
-- | Constructor Declaration Field
data ConDeclField pass
ConDeclField :: XConDeclField pass -> [LFieldOcc pass] -> LBangType pass -> Maybe LHsDocString -> ConDeclField pass
[cd_fld_ext] :: ConDeclField pass -> XConDeclField pass
-- | See Note [ConDeclField passs]
[cd_fld_names] :: ConDeclField pass -> [LFieldOcc pass]
[cd_fld_type] :: ConDeclField pass -> LBangType pass
-- |
[cd_fld_doc] :: ConDeclField pass -> Maybe LHsDocString
XConDeclField :: !XXConDeclField pass -> ConDeclField pass
-- | Bang Type
--
-- In the parser, strictness and packedness annotations bind more tightly
-- than docstrings. This means that when consuming a BangType (and
-- looking for HsBangTy) we must be ready to peer behind a
-- potential layer of HsDocTy. See #15206 for motivation and
-- getBangType for an example.
type BangType pass = HsType pass
-- | Ambiguous Field Occurrence
--
-- Represents an *occurrence* of a field that is potentially ambiguous
-- after the renamer, with the ambiguity resolved by the typechecker. We
-- always store the RdrName that the user originally wrote, and
-- store the selector function after the renamer (for unambiguous
-- occurrences) or the typechecker (for ambiguous occurrences).
--
-- See Note [HsRecField and HsRecUpdField] in GHC.Hs.Pat and Note
-- [Disambiguating record fields] in GHC.Tc.Gen.Head. See Note
-- [Located RdrNames] in GHC.Hs.Expr
data AmbiguousFieldOcc pass
Unambiguous :: XUnambiguous pass -> LocatedN RdrName -> AmbiguousFieldOcc pass
Ambiguous :: XAmbiguous pass -> LocatedN RdrName -> AmbiguousFieldOcc pass
XAmbiguousFieldOcc :: !XXAmbiguousFieldOcc pass -> AmbiguousFieldOcc pass
numVisibleArgs :: [HsArg tm ty] -> Arity
-- | An empty list that can be used to indicate that there are no type
-- arguments allowed in cases where HsConDetails is applied to Void.
noTypeArgs :: [Void]
mapHsOuterImplicit :: (XHsOuterImplicit pass -> XHsOuterImplicit pass) -> HsOuterTyVarBndrs flag pass -> HsOuterTyVarBndrs flag pass
-- | Does this HsTyVarBndr come with an explicit kind annotation?
isHsKindedTyVar :: HsTyVarBndr flag pass -> Bool
-- | When creating syntax we use the shorthands. It's better for printing,
-- also, the shorthands work trivially at each pass.
hsUnrestricted :: a -> HsScaled pass a
hsScaledThing :: HsScaled pass a -> a
hsQTvExplicit :: LHsQTyVars pass -> [LHsTyVarBndr () pass]
hsPatSigType :: HsPatSigType pass -> LHsType pass
hsMult :: HsScaled pass a -> HsArrow pass
-- | When creating syntax we use the shorthands. It's better for printing,
-- also, the shorthands work trivially at each pass.
hsLinear :: a -> HsScaled pass a
hsIPNameFS :: HsIPName -> FastString
-- | Pattern
--
--
data Pat p
-- | Wildcard Pattern The sole reason for a type on a WildPat is to support
-- hsPatType :: Pat Id -> Type
WildPat :: XWildPat p -> Pat p
-- | Variable Pattern
VarPat :: XVarPat p -> LIdP p -> Pat p
-- | Lazy Pattern ^ - AnnKeywordId : AnnTilde
LazyPat :: XLazyPat p -> LPat p -> Pat p
-- | As pattern ^ - AnnKeywordId : AnnAt
AsPat :: XAsPat p -> LIdP p -> LPat p -> Pat p
-- | Parenthesised pattern See Note [Parens in HsSyn] in GHC.Hs.Expr ^ -
-- AnnKeywordId : AnnOpen '(', AnnClose
-- ')'
ParPat :: XParPat p -> LPat p -> Pat p
-- | Bang pattern ^ - AnnKeywordId : AnnBang
BangPat :: XBangPat p -> LPat p -> Pat p
-- | Syntactic List
--
--
ListPat :: XListPat p -> [LPat p] -> Pat p
-- | Tuple sub-patterns
--
--
TuplePat :: XTuplePat p -> [LPat p] -> Boxity -> Pat p
-- | Anonymous sum pattern
--
--
SumPat :: XSumPat p -> LPat p -> ConTag -> Arity -> Pat p
-- | Constructor Pattern
ConPat :: XConPat p -> XRec p (ConLikeP p) -> HsConPatDetails p -> Pat p
[pat_con_ext] :: Pat p -> XConPat p
[pat_con] :: Pat p -> XRec p (ConLikeP p)
[pat_args] :: Pat p -> HsConPatDetails p
-- |
ViewPat :: XViewPat p -> LHsExpr p -> LPat p -> Pat p
-- |
SplicePat :: XSplicePat p -> HsSplice p -> Pat p
-- | Literal Pattern Used for *non-overloaded* literal patterns: Int#,
-- Char#, Int, Char, String, etc.
LitPat :: XLitPat p -> HsLit p -> Pat p
-- | Natural Pattern
--
--
NPat :: XNPat p -> XRec p (HsOverLit p) -> Maybe (SyntaxExpr p) -> SyntaxExpr p -> Pat p
-- | n+k pattern
NPlusKPat :: XNPlusKPat p -> LIdP p -> XRec p (HsOverLit p) -> HsOverLit p -> SyntaxExpr p -> SyntaxExpr p -> Pat p
-- |
SigPat :: XSigPat p -> LPat p -> HsPatSigType (NoGhcTc p) -> Pat p
-- | Trees that Grow extension point for new constructors
XPat :: !XXPat p -> Pat p
type LPat p = XRec p Pat p
-- | Overloaded Literal Value
data OverLitVal
-- | Integer-looking literals;
HsIntegral :: !IntegralLit -> OverLitVal
-- | Frac-looking literals
HsFractional :: !FractionalLit -> OverLitVal
-- | String-looking literals
HsIsString :: !SourceText -> !FastString -> OverLitVal
-- | Haskell Overloaded Literal
data HsOverLit p
OverLit :: XOverLit p -> OverLitVal -> HsExpr p -> HsOverLit p
[ol_ext] :: HsOverLit p -> XOverLit p
[ol_val] :: HsOverLit p -> OverLitVal
[ol_witness] :: HsOverLit p -> HsExpr p
XOverLit :: !XXOverLit p -> HsOverLit p
-- | Haskell Literal
data HsLit x
-- | Character
HsChar :: XHsChar x -> Char -> HsLit x
-- | Unboxed character
HsCharPrim :: XHsCharPrim x -> Char -> HsLit x
-- | String
HsString :: XHsString x -> FastString -> HsLit x
-- | Packed bytes
HsStringPrim :: XHsStringPrim x -> !ByteString -> HsLit x
-- | Genuinely an Int; arises from GHC.Tc.Deriv.Generate, and from
-- TRANSLATION
HsInt :: XHsInt x -> IntegralLit -> HsLit x
-- | literal Int#
HsIntPrim :: XHsIntPrim x -> Integer -> HsLit x
-- | literal Word#
HsWordPrim :: XHsWordPrim x -> Integer -> HsLit x
-- | literal Int64#
HsInt64Prim :: XHsInt64Prim x -> Integer -> HsLit x
-- | literal Word64#
HsWord64Prim :: XHsWord64Prim x -> Integer -> HsLit x
-- | Genuinely an integer; arises only from TRANSLATION (overloaded
-- literals are done with HsOverLit)
HsInteger :: XHsInteger x -> Integer -> Type -> HsLit x
-- | Genuinely a rational; arises only from TRANSLATION (overloaded
-- literals are done with HsOverLit)
HsRat :: XHsRat x -> FractionalLit -> Type -> HsLit x
-- | Unboxed Float
HsFloatPrim :: XHsFloatPrim x -> FractionalLit -> HsLit x
-- | Unboxed Double
HsDoublePrim :: XHsDoublePrim x -> FractionalLit -> HsLit x
XLit :: !XXLit x -> HsLit x
negateOverLitVal :: OverLitVal -> OverLitVal
-- | hsOverLitNeedsParens p ol returns True if an
-- overloaded literal ol needs to be parenthesized under
-- precedence p.
hsOverLitNeedsParens :: PprPrec -> HsOverLit x -> Bool
-- | hsLitNeedsParens p l returns True if a literal
-- l needs to be parenthesized under precedence p.
hsLitNeedsParens :: PprPrec -> HsLit x -> Bool
-- | Located Import Declaration
type LImportDecl pass = XRec pass ImportDecl pass
-- | Located name with possible adornment - AnnKeywordIds :
-- AnnType, AnnPattern
type LIEWrappedName name = LocatedA IEWrappedName name
-- | Located Import or Export
type LIE pass = XRec pass IE pass
-- | If/how an import is qualified.
data ImportDeclQualifiedStyle
-- | qualified appears in prepositive position.
QualifiedPre :: ImportDeclQualifiedStyle
-- | qualified appears in postpositive position.
QualifiedPost :: ImportDeclQualifiedStyle
-- | Not qualified.
NotQualified :: ImportDeclQualifiedStyle
-- | Import Declaration
--
-- A single Haskell import declaration.
data ImportDecl pass
ImportDecl :: XCImportDecl pass -> SourceText -> XRec pass ModuleName -> Maybe StringLiteral -> IsBootInterface -> Bool -> ImportDeclQualifiedStyle -> Bool -> Maybe (XRec pass ModuleName) -> Maybe (Bool, XRec pass [LIE pass]) -> ImportDecl pass
[ideclExt] :: ImportDecl pass -> XCImportDecl pass
[ideclSourceSrc] :: ImportDecl pass -> SourceText
-- | Module name.
[ideclName] :: ImportDecl pass -> XRec pass ModuleName
-- | Package qualifier.
[ideclPkgQual] :: ImportDecl pass -> Maybe StringLiteral
-- | IsBoot = {-# SOURCE #-} import
[ideclSource] :: ImportDecl pass -> IsBootInterface
-- | True => safe import
[ideclSafe] :: ImportDecl pass -> Bool
-- | If/how the import is qualified.
[ideclQualified] :: ImportDecl pass -> ImportDeclQualifiedStyle
-- | True => implicit import (of Prelude)
[ideclImplicit] :: ImportDecl pass -> Bool
-- | as Module
[ideclAs] :: ImportDecl pass -> Maybe (XRec pass ModuleName)
-- | (True => hiding, names)
[ideclHiding] :: ImportDecl pass -> Maybe (Bool, XRec pass [LIE pass])
-- | AnnKeywordIds
--
--
XImportDecl :: !XXImportDecl pass -> ImportDecl pass
-- | A name in an import or export specification which may have adornments.
-- Used primarily for accurate pretty printing of ParsedSource, and API
-- Annotation placement. The Annotation is the location of the
-- adornment in the original source.
data IEWrappedName name
-- | no extra
IEName :: LocatedN name -> IEWrappedName name
-- | pattern X
IEPattern :: EpaLocation -> LocatedN name -> IEWrappedName name
-- | type (:+:)
IEType :: EpaLocation -> LocatedN name -> IEWrappedName name
-- | Imported or Exported Wildcard
data IEWildcard
NoIEWildcard :: IEWildcard
IEWildcard :: Int -> IEWildcard
-- | Imported or exported entity.
data IE pass
-- | Imported or Exported Variable
IEVar :: XIEVar pass -> LIEWrappedName (IdP pass) -> IE pass
-- | Imported or exported Thing with Absent list
--
-- The thing is a Class/Type (can't tell) - AnnKeywordIds :
-- AnnPattern, AnnType,AnnVal
IEThingAbs :: XIEThingAbs pass -> LIEWrappedName (IdP pass) -> IE pass
-- | Imported or exported Thing with All imported or exported
--
-- The thing is a ClassType and the All refers to
-- methodsconstructors
--
--
IEThingAll :: XIEThingAll pass -> LIEWrappedName (IdP pass) -> IE pass
-- | Imported or exported Thing With given imported or exported
--
-- The thing is a Class/Type and the imported or exported things are
-- methods/constructors and record fields; see Note [IEThingWith] -
-- AnnKeywordIds : AnnOpen, AnnClose,
-- AnnComma, AnnType
IEThingWith :: XIEThingWith pass -> LIEWrappedName (IdP pass) -> IEWildcard -> [LIEWrappedName (IdP pass)] -> IE pass
-- | Imported or exported module contents
--
-- (Export Only)
--
--
IEModuleContents :: XIEModuleContents pass -> XRec pass ModuleName -> IE pass
-- | Doc section heading
IEGroup :: XIEGroup pass -> Int -> HsDocString -> IE pass
-- | Some documentation
IEDoc :: XIEDoc pass -> HsDocString -> IE pass
-- | Reference to named doc
IEDocNamed :: XIEDocNamed pass -> String -> IE pass
XIE :: !XXIE pass -> IE pass
data EpAnnImportDecl
EpAnnImportDecl :: EpaLocation -> Maybe (EpaLocation, EpaLocation) -> Maybe EpaLocation -> Maybe EpaLocation -> Maybe EpaLocation -> Maybe EpaLocation -> EpAnnImportDecl
[importDeclAnnImport] :: EpAnnImportDecl -> EpaLocation
[importDeclAnnPragma] :: EpAnnImportDecl -> Maybe (EpaLocation, EpaLocation)
[importDeclAnnSafe] :: EpAnnImportDecl -> Maybe EpaLocation
[importDeclAnnQualified] :: EpAnnImportDecl -> Maybe EpaLocation
[importDeclAnnPackage] :: EpAnnImportDecl -> Maybe EpaLocation
[importDeclAnnAs] :: EpAnnImportDecl -> Maybe EpaLocation
simpleImportDecl :: ModuleName -> ImportDecl GhcPs
replaceWrappedName :: IEWrappedName name1 -> name2 -> IEWrappedName name2
replaceLWrappedName :: LIEWrappedName name1 -> name2 -> LIEWrappedName name2
pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc
lieWrappedName :: LIEWrappedName name -> name
-- | Convenience function to answer the question if an import decl. is
-- qualified.
isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool
-- | Given two possible located qualified tokens, compute a style
-- (in a conforming Haskell program only one of the two can be not
-- Nothing). This is called from GHC.Parser.
importDeclQualifiedStyle :: Maybe EpaLocation -> Maybe EpaLocation -> (Maybe EpaLocation, ImportDeclQualifiedStyle)
ieWrappedName :: IEWrappedName name -> name
ieWrappedLName :: IEWrappedName name -> LocatedN name
ieNames :: forall (p :: Pass). IE (GhcPass p) -> [IdP (GhcPass p)]
ieName :: forall (p :: Pass). IE (GhcPass p) -> IdP (GhcPass p)
ieLWrappedName :: LIEWrappedName name -> LocatedN name
data Pass
Parsed :: Pass
Renamed :: Pass
Typechecked :: Pass
-- | Constraint type to bundle up the requirement for OutputableBndr
-- on both the id and the NoGhcTc of it. See Note
-- [NoGhcTc].
type OutputableBndrId (pass :: Pass) = (OutputableBndr IdGhcP pass, OutputableBndr IdGhcP NoGhcTcPass pass, Outputable GenLocated Anno IdGhcP pass IdGhcP pass, Outputable GenLocated Anno IdGhcP NoGhcTcPass pass IdGhcP NoGhcTcPass pass, IsPass pass)
type family NoGhcTcPass (p :: Pass) :: Pass
type IsSrcSpanAnn (p :: Pass) a = (Anno IdGhcP p ~ SrcSpanAnn' EpAnn a, IsPass p)
-- | Allows us to check what phase we're in at GHC's runtime. For example,
-- this class allows us to write > f :: forall p. IsPass p =>
-- HsExpr (GhcPass p) -> blah > f e = case ghcPass @p of > GhcPs
-- -> ... in this RHS we have HsExpr GhcPs... > GhcRn -> ... in
-- this RHS we have HsExpr GhcRn... > GhcTc -> ... in this RHS we
-- have HsExpr GhcTc... which is very useful, for example, when
-- pretty-printing. See Note [IsPass].
class (NoGhcTcPass NoGhcTcPass p ~ NoGhcTcPass p, IsPass NoGhcTcPass p) => IsPass (p :: Pass)
ghcPass :: IsPass p => GhcPass p
-- | Maps the "normal" id type for a given GHC pass
type family IdGhcP (pass :: Pass)
type GhcTc = GhcPass 'Typechecked
type GhcRn = GhcPass 'Renamed
type GhcPs = GhcPass 'Parsed
-- | Used as a data type index for the hsSyn AST; also serves as a
-- singleton type for Pass
data GhcPass (c :: Pass)
[GhcPs] :: GhcPass 'Parsed
[GhcRn] :: GhcPass 'Renamed
[GhcTc] :: GhcPass 'Typechecked
pprIfTc :: forall (p :: Pass). IsPass p => (p ~ 'Typechecked => SDoc) -> SDoc
pprIfRn :: forall (p :: Pass). IsPass p => (p ~ 'Renamed => SDoc) -> SDoc
pprIfPs :: forall (p :: Pass). IsPass p => (p ~ 'Parsed => SDoc) -> SDoc
mkSingleAltCase :: CoreExpr -> Id -> AltCon -> [Var] -> CoreExpr -> CoreExpr
type TcMCoercionR = MCoercionR
type TcMCoercionN = MCoercionN
type TcMCoercion = MCoercion
data TcEvBinds
TcEvBinds :: EvBindsVar -> TcEvBinds
EvBinds :: Bag EvBind -> TcEvBinds
type TcCoercionR = CoercionR
type TcCoercionP = CoercionP
type TcCoercionN = CoercionN
type TcCoercion = Coercion
data QuoteWrapper
QuoteWrapper :: EvVar -> Type -> QuoteWrapper
data HsWrapper
WpHole :: HsWrapper
WpCompose :: HsWrapper -> HsWrapper -> HsWrapper
WpFun :: HsWrapper -> HsWrapper -> Scaled TcType -> SDoc -> HsWrapper
WpCast :: TcCoercionR -> HsWrapper
WpEvLam :: EvVar -> HsWrapper
WpEvApp :: EvTerm -> HsWrapper
WpTyLam :: TyVar -> HsWrapper
WpTyApp :: KindOrType -> HsWrapper
WpLet :: TcEvBinds -> HsWrapper
WpMultCoercion :: Coercion -> HsWrapper
-- | Where to store evidence for expression holes See Note [Holes] in
-- GHC.Tc.Types.Constraint
data HoleExprRef
HER :: IORef EvTerm -> TcType -> Unique -> HoleExprRef
-- | Instructions on how to make a Typeable dictionary. See Note
-- [Typeable evidence terms]
data EvTypeable
-- | Dictionary for Typeable T where T is a type
-- constructor with all of its kind variables saturated. The
-- [EvTerm] is Typeable evidence for the applied
-- kinds..
EvTypeableTyCon :: TyCon -> [EvTerm] -> EvTypeable
-- | Dictionary for Typeable (s t), given a dictionaries for
-- s and t.
EvTypeableTyApp :: EvTerm -> EvTerm -> EvTypeable
-- | Dictionary for Typeable (s # w -> t), given a dictionaries
-- for w, s, and t.
EvTypeableTrFun :: EvTerm -> EvTerm -> EvTerm -> EvTypeable
-- | Dictionary for a type literal, e.g. Typeable "foo" or
-- Typeable 3 The EvTerm is evidence of, e.g.,
-- KnownNat 3 (see #10348)
EvTypeableTyLit :: EvTerm -> EvTypeable
data EvTerm
EvExpr :: EvExpr -> EvTerm
EvTypeable :: Type -> EvTypeable -> EvTerm
EvFun :: [TyVar] -> [EvVar] -> TcEvBinds -> EvVar -> EvTerm
[et_tvs] :: EvTerm -> [TyVar]
[et_given] :: EvTerm -> [EvVar]
[et_binds] :: EvTerm -> TcEvBinds
[et_body] :: EvTerm -> EvVar
type EvExpr = CoreExpr
-- | Evidence for CallStack implicit parameters.
data EvCallStack
EvCsEmpty :: EvCallStack
-- | EvCsPushCall name loc stk represents a call to name,
-- occurring at loc, in a calling context stk.
EvCsPushCall :: Name -> RealSrcSpan -> EvExpr -> EvCallStack
data EvBindsVar
EvBindsVar :: Unique -> IORef EvBindMap -> IORef CoVarSet -> EvBindsVar
[ebv_uniq] :: EvBindsVar -> Unique
[ebv_binds] :: EvBindsVar -> IORef EvBindMap
[ebv_tcvs] :: EvBindsVar -> IORef CoVarSet
CoEvBindsVar :: Unique -> IORef CoVarSet -> EvBindsVar
[ebv_uniq] :: EvBindsVar -> Unique
[ebv_tcvs] :: EvBindsVar -> IORef CoVarSet
newtype EvBindMap
EvBindMap :: DVarEnv EvBind -> EvBindMap
[ev_bind_varenv] :: EvBindMap -> DVarEnv EvBind
data EvBind
EvBind :: EvVar -> EvTerm -> Bool -> EvBind
[eb_lhs] :: EvBind -> EvVar
[eb_rhs] :: EvBind -> EvTerm
[eb_is_given] :: EvBind -> Bool
-- | Create a Expr that wraps a value in an implicit-parameter
-- dictionary. See unwrapIP.
wrapIP :: Type -> CoercionR
varSetMinusEvBindMap :: VarSet -> EvBindMap -> VarSet
-- | Create a Expr that unwraps an implicit-parameter or
-- overloaded-label dictionary to expose the underlying value. We expect
-- the Expr to have the form `IP sym ty` or `IsLabel sym ty`, and
-- return a Expr `co :: IP sym ty ~ ty` or `co :: IsLabel sym ty ~
-- ty`. See also Note [Type-checking overloaded labels] in
-- GHC.Tc.Gen.Expr.
unwrapIP :: Type -> CoercionR
tcDowngradeRole :: Role -> Role -> TcCoercion -> TcCoercion
tcCoercionRole :: TcCoercion -> Role
tcCoercionKind :: TcCoercion -> Pair TcType
quoteWrapperTyVarTy :: QuoteWrapper -> Type
pprHsWrapper :: HsWrapper -> (Bool -> SDoc) -> SDoc
nonDetStrictFoldEvBindMap :: (EvBind -> a -> a) -> a -> EvBindMap -> a
mkWpTyLams :: [TyVar] -> HsWrapper
mkWpTyApps :: [Type] -> HsWrapper
mkWpLet :: TcEvBinds -> HsWrapper
mkWpLams :: [Var] -> HsWrapper
mkWpFun :: HsWrapper -> HsWrapper -> Scaled TcType -> TcType -> SDoc -> HsWrapper
mkWpEvVarApps :: [EvVar] -> HsWrapper
mkWpEvApps :: [EvTerm] -> HsWrapper
mkWpCastR :: TcCoercionR -> HsWrapper
mkWpCastN :: TcCoercionN -> HsWrapper
mkWantedEvBind :: EvVar -> EvTerm -> EvBind
mkTcUnbranchedAxInstCo :: CoAxiom Unbranched -> [TcType] -> [TcCoercion] -> TcCoercionR
mkTcTyConAppCo :: Role -> TyCon -> [TcCoercion] -> TcCoercion
mkTcTransCo :: TcCoercion -> TcCoercion -> TcCoercion
mkTcSymMCo :: TcMCoercion -> TcMCoercion
mkTcSymCo :: TcCoercion -> TcCoercion
mkTcSubCo :: HasDebugCallStack => TcCoercionN -> TcCoercionR
mkTcRepReflCo :: TcType -> TcCoercionR
mkTcReflCo :: Role -> TcType -> TcCoercion
mkTcPhantomCo :: TcCoercionN -> TcType -> TcType -> TcCoercionP
mkTcNthCo :: Role -> Int -> TcCoercion -> TcCoercion
mkTcNomReflCo :: TcType -> TcCoercionN
mkTcLRCo :: LeftOrRight -> TcCoercion -> TcCoercion
mkTcKindCo :: TcCoercion -> TcCoercionN
mkTcGReflRightMCo :: Role -> TcType -> TcMCoercionN -> TcCoercion
mkTcGReflRightCo :: Role -> TcType -> TcCoercionN -> TcCoercion
mkTcGReflLeftMCo :: Role -> TcType -> TcMCoercionN -> TcCoercion
mkTcGReflLeftCo :: Role -> TcType -> TcCoercionN -> TcCoercion
mkTcFunCo :: Role -> TcCoercion -> TcCoercion -> TcCoercion -> TcCoercion
mkTcForAllCos :: [(TyVar, TcCoercionN)] -> TcCoercion -> TcCoercion
mkTcForAllCo :: TyVar -> TcCoercionN -> TcCoercion -> TcCoercion
mkTcFamilyTyConAppCo :: TyCon -> [TcCoercionN] -> TcCoercionN
mkTcCoherenceRightCo :: Role -> TcType -> TcCoercionN -> TcCoercion -> TcCoercion
mkTcCoherenceLeftCo :: Role -> TcType -> TcCoercionN -> TcCoercion -> TcCoercion
mkTcCoVarCo :: CoVar -> TcCoercion
mkTcAxiomRuleCo :: CoAxiomRule -> [TcCoercion] -> TcCoercionR
mkTcAxInstCo :: forall (br :: BranchFlag). Role -> CoAxiom br -> BranchIndex -> [TcType] -> [TcCoercion] -> TcCoercion
mkTcAppCo :: TcCoercion -> TcCoercionN -> TcCoercion
mkGivenEvBind :: EvVar -> EvTerm -> EvBind
mkEvScSelectors :: Class -> [TcType] -> [(TcPredType, EvExpr)]
mkEvCast :: EvExpr -> TcCoercion -> EvTerm
-- | If a SwapFlag is IsSwapped, flip the orientation of a
-- coercion
maybeTcSymCo :: SwapFlag -> TcCoercion -> TcCoercion
-- | If the EqRel is ReprEq, makes a SubCo; otherwise, does nothing. Note
-- that the input coercion should always be nominal.
maybeTcSubCo :: HasDebugCallStack => EqRel -> TcCoercionN -> TcCoercion
lookupEvBind :: EvBindMap -> EvVar -> Maybe EvBind
-- | This version does a slow check, calculating the related types and
-- seeing if they are equal.
isTcReflexiveCo :: TcCoercion -> Bool
isTcReflCo :: TcCoercion -> Bool
isIdHsWrapper :: HsWrapper -> Bool
isEmptyTcEvBinds :: TcEvBinds -> Bool
isEmptyEvBindMap :: EvBindMap -> Bool
isCoEvBindsVar :: EvBindsVar -> Bool
idHsWrapper :: HsWrapper
-- | Identifies the lambda-bound dictionaries of an
-- HsWrapper. This is used (only) to allow the pattern-match
-- overlap checker to know what Given dictionaries are in scope.
--
-- We specifically do not collect dictionaries bound in a WpLet.
-- These are either superclasses of lambda-bound ones, or (extremely
-- numerous) results of binding Wanted dictionaries. We definitely don't
-- want all those cluttering up the Given dictionaries for pattern-match
-- overlap checking!
hsWrapDictBinders :: HsWrapper -> Bag DictId
foldEvBindMap :: (EvBind -> a -> a) -> a -> EvBindMap -> a
findNeededEvVars :: EvBindMap -> VarSet -> VarSet
filterEvBindMap :: (EvBind -> Bool) -> EvBindMap -> EvBindMap
extendEvBinds :: EvBindMap -> EvBind -> EvBindMap
evVarsOfTerm :: EvTerm -> VarSet
evTypeable :: Type -> EvTypeable -> EvTerm
evTermCoercion_maybe :: EvTerm -> Maybe TcCoercion
evTermCoercion :: EvTerm -> TcCoercion
evSelector :: Id -> [Type] -> [EvExpr] -> EvExpr
-- | Any sort of evidence Id, including coercions
evId :: EvId -> EvExpr
evDataConApp :: DataCon -> [Type] -> [EvExpr] -> EvTerm
evDFunApp :: DFunId -> [Type] -> [EvExpr] -> EvTerm
evCoercion :: TcCoercion -> EvTerm
-- | d |> co
evCast :: EvExpr -> TcCoercion -> EvTerm
evBindVar :: EvBind -> EvVar
evBindMapToVarSet :: EvBindMap -> VarSet
evBindMapBinds :: EvBindMap -> Bag EvBind
emptyTcEvBinds :: TcEvBinds
emptyEvBindMap :: EvBindMap
collectHsWrapBinders :: HsWrapper -> ([Var], HsWrapper)
-- | Convert the QuoteWrapper into a normal HsWrapper which can be used to
-- apply its contents.
applyQuoteWrapper :: QuoteWrapper -> HsWrapper
(<.>) :: HsWrapper -> HsWrapper -> HsWrapper
data TcLclEnv
TcLclEnv :: RealSrcSpan -> [ErrCtxt] -> Bool -> TcLevel -> ThStage -> ThBindEnv -> ArrowCtxt -> LocalRdrEnv -> TcTypeEnv -> TcRef UsageEnv -> TcBinderStack -> TcRef WantedConstraints -> TcRef (Messages DecoratedSDoc) -> TcLclEnv
[tcl_loc] :: TcLclEnv -> RealSrcSpan
[tcl_ctxt] :: TcLclEnv -> [ErrCtxt]
[tcl_in_gen_code] :: TcLclEnv -> Bool
[tcl_tclvl] :: TcLclEnv -> TcLevel
[tcl_th_ctxt] :: TcLclEnv -> ThStage
[tcl_th_bndrs] :: TcLclEnv -> ThBindEnv
[tcl_arrow_ctxt] :: TcLclEnv -> ArrowCtxt
[tcl_rdr] :: TcLclEnv -> LocalRdrEnv
[tcl_env] :: TcLclEnv -> TcTypeEnv
[tcl_usage] :: TcLclEnv -> TcRef UsageEnv
[tcl_bndrs] :: TcLclEnv -> TcBinderStack
[tcl_lie] :: TcLclEnv -> TcRef WantedConstraints
[tcl_errs] :: TcLclEnv -> TcRef (Messages DecoratedSDoc)
setLclEnvTcLevel :: TcLclEnv -> TcLevel -> TcLclEnv
setLclEnvLoc :: TcLclEnv -> RealSrcSpan -> TcLclEnv
getLclEnvTcLevel :: TcLclEnv -> TcLevel
getLclEnvLoc :: TcLclEnv -> RealSrcSpan
lookupOrigNameCache :: OrigNameCache -> Module -> OccName -> Maybe Name
extendNameCache :: OrigNameCache -> Module -> OccName -> Name -> OrigNameCache
wordTyConName :: Name
wordTyCon :: TyCon
wordTy :: Type
wordDataCon :: DataCon
word8TyCon :: TyCon
word8Ty :: Type
word8DataCon :: DataCon
wiredInTyCons :: [TyCon]
unrestrictedFunTyConName :: Name
unliftedTypeKindTyConName :: Name
unliftedRepTyConName :: Name
unliftedDataConTyCon :: TyCon
unitTyConKey :: Unique
unitTyCon :: TyCon
unitDataConId :: Id
unitDataCon :: DataCon
unboxedUnitTyCon :: TyCon
unboxedUnitTy :: Type
unboxedUnitDataCon :: DataCon
-- | Specialization of unboxedTupleSumKind for sums
unboxedSumKind :: [Type] -> Kind
typeToTypeKind :: Kind
typeSymbolKindCon :: TyCon
tupleDataConName :: Boxity -> Arity -> Name
true_RDR :: RdrName
trueDataConId :: Id
trueDataCon :: DataCon
sumRepDataConTyCon :: TyCon
stringTyCon_RDR :: RdrName
stringTy :: Type
soloTyCon :: TyCon
promotedTrueDataCon :: TyCon
promotedNothingDataCon :: TyCon
promotedNilDataCon :: TyCon
promotedLTDataCon :: TyCon
promotedJustDataCon :: TyCon
promotedGTDataCon :: TyCon
promotedFalseDataCon :: TyCon
promotedEQDataCon :: TyCon
promotedConsDataCon :: TyCon
pairTyCon :: TyCon
orderingTyCon :: TyCon
ordLTDataConId :: Id
ordLTDataCon :: DataCon
ordGTDataConId :: Id
ordGTDataCon :: DataCon
ordEQDataConId :: Id
ordEQDataCon :: DataCon
oneDataConName :: Name
oneDataCon :: DataCon
nothingDataConName :: Name
nothingDataCon :: DataCon
nonEmptyTyConName :: Name
nonEmptyTyCon :: TyCon
nonEmptyDataConName :: Name
nonEmptyDataCon :: DataCon
nilDataConName :: Name
nilDataCon :: DataCon
naturalTyConName :: Name
naturalTyCon :: TyCon
naturalNSDataConName :: Name
naturalNSDataCon :: DataCon
naturalNBDataConName :: Name
naturalNBDataCon :: DataCon
multiplicityTyConName :: Name
mkWiredInTyConName :: BuiltInSyntax -> Module -> FastString -> Unique -> TyCon -> Name
mkWiredInIdName :: Module -> FastString -> Unique -> Id -> Name
-- | Make a tuple type. The list of types should not include any
-- RuntimeRep specifications. Boxed 1-tuples are *not* flattened. See
-- Note [One-tuples] and Note [Don't flatten tuples from HsSyn] in
-- GHC.Core.Make
mkTupleTy1 :: Boxity -> [Type] -> Type
-- | Make a tuple type. The list of types should not include any
-- RuntimeRep specifications. Boxed 1-tuples are flattened. See Note
-- [One-tuples]
mkTupleTy :: Boxity -> [Type] -> Type
mkTupleStr :: Boxity -> Arity -> String
mkSumTy :: [Type] -> Type
mkPromotedPairTy :: Kind -> Kind -> Type -> Type -> Type
mkPromotedMaybeTy :: Kind -> Maybe Type -> Type
mkMaybeTy :: Type -> Kind
mkListTy :: Type -> Type
maybeTyConName :: Name
maybeTyCon :: TyCon
manyDataConName :: Name
manyDataCon :: DataCon
-- | Make a fake, recovery TyCon from an existing one. Used when
-- recovering from errors in type declarations
makeRecoveryTyCon :: TyCon -> TyCon
listTyCon_RDR :: RdrName
listTyConName :: Name
liftedTypeKindTyConName :: Name
liftedRepTyConName :: Name
justDataConName :: Name
justDataCon :: DataCon
isPromotedPairType :: Type -> Maybe (Type, Type)
isPromotedMaybeTy :: Type -> Maybe (Maybe Type)
isCTupleTyConName :: Name -> Bool
-- | Built-in syntax isn't "in scope" so these OccNames map to wired-in
-- Names with BuiltInSyntax. However, this should only be necessary while
-- resolving names produced by Template Haskell splices since we take
-- care to encode built-in syntax names specially in interface files. See
-- Note [Symbol table representation of names].
--
-- Moreover, there is no need to include names of things that the user
-- can't write (e.g. type representation bindings like $tc(,,,)).
isBuiltInOcc_maybe :: OccName -> Maybe Name
integerTyConName :: Name
integerTyCon :: TyCon
integerISDataConName :: Name
integerISDataCon :: DataCon
integerIPDataConName :: Name
integerIPDataCon :: DataCon
integerINDataConName :: Name
integerINDataCon :: DataCon
intTyCon_RDR :: RdrName
intTyConName :: Name
intTyCon :: TyCon
intTy :: Type
intDataCon_RDR :: RdrName
intDataCon :: DataCon
heqTyConName :: Name
heqDataCon :: DataCon
heqClass :: Class
floatTyConName :: Name
floatTyCon :: TyCon
floatTy :: Type
floatDataCon :: DataCon
-- | Replaces constraint tuple names with corresponding boxed ones.
filterCTuple :: RdrName -> RdrName
false_RDR :: RdrName
falseDataConId :: Id
falseDataCon :: DataCon
eqTyCon_RDR :: RdrName
eqTyConName :: Name
eqTyCon :: TyCon
eqDataCon :: DataCon
eqClass :: Class
doubleTyConName :: Name
doubleTyCon :: TyCon
doubleTy :: Type
doubleDataCon :: DataCon
constraintKindTyConName :: Name
constraintKindTyCon :: TyCon
consDataCon_RDR :: RdrName
consDataConName :: Name
consDataCon :: DataCon
coercibleTyConName :: Name
coercibleDataCon :: DataCon
coercibleClass :: Class
charTyCon_RDR :: RdrName
charTyConName :: Name
charTyCon :: TyCon
charDataCon :: DataCon
cTupleTyConNames :: [Name]
-- | If the given name is that of a constraint tuple, return its arity.
cTupleTyConNameArity_maybe :: Name -> Maybe Arity
cTupleTyCon :: Arity -> TyCon
cTupleSelId :: ConTag -> Arity -> Id
cTupleDataConNames :: [Name]
boxingDataCon_maybe :: TyCon -> Maybe DataCon
boolTyCon_RDR :: RdrName
boolTyConName :: Name
boolTyCon :: TyCon
boolTy :: Type
anyTyCon :: TyCon
anyTy :: Type
-- | Syntax Expression
--
-- SyntaxExpr is represents the function used in interpreting rebindable
-- syntax. In the parser, we have no information to supply; in the
-- renamer, we have the name of the function (but see Note [Monad fail :
-- Rebindable syntax, overloaded strings] for a wrinkle) and in the
-- type-checker we have a more elaborate structure SyntaxExprTc.
--
-- In some contexts, rebindable syntax is not implemented, and so we have
-- constructors to represent that possibility in both the renamer and
-- typechecker instantiations.
--
-- E.g. (>>=) is filled in before the renamer by the
-- appropriate Name for (>>=), and then
-- instantiated by the type checker with its type args etc
type family SyntaxExpr p
data MatchGroup p body
MG :: XMG p body -> XRec p [LMatch p body] -> Origin -> MatchGroup p body
[mg_ext] :: MatchGroup p body -> XMG p body
[mg_alts] :: MatchGroup p body -> XRec p [LMatch p body]
[mg_origin] :: MatchGroup p body -> Origin
XMatchGroup :: !XXMatchGroup p body -> MatchGroup p body
-- | Located Haskell Expression
type LHsExpr p = XRec p HsExpr p
-- | Haskell Splice
data HsSplice id
HsTypedSplice :: XTypedSplice id -> SpliceDecoration -> IdP id -> LHsExpr id -> HsSplice id
HsUntypedSplice :: XUntypedSplice id -> SpliceDecoration -> IdP id -> LHsExpr id -> HsSplice id
HsQuasiQuote :: XQuasiQuote id -> IdP id -> IdP id -> SrcSpan -> FastString -> HsSplice id
HsSpliced :: XSpliced id -> ThModFinalizers -> HsSplicedThing id -> HsSplice id
XSplice :: !XXSplice id -> HsSplice id
-- | A Haskell expression.
data HsExpr p
-- | Variable See Note [Located RdrNames]
HsVar :: XVar p -> LIdP p -> HsExpr p
-- | Unbound variable; also used for "holes" (_ or _x). Turned from HsVar
-- to HsUnboundVar by the renamer, when it finds an out-of-scope variable
-- or hole. The (XUnboundVar p) field becomes an HoleExprRef after
-- typechecking; this is where the erroring expression will be written
-- after solving. See Note [Holes] in GHC.Tc.Types.Constraint.
HsUnboundVar :: XUnboundVar p -> OccName -> HsExpr p
-- | After typechecker only; must be different HsVar for pretty printing
HsConLikeOut :: XConLikeOut p -> ConLike -> HsExpr p
-- | Variable pointing to record selector The parser produces HsVars The
-- renamer renames record-field selectors to HsRecFld The typechecker
-- preserves HsRecFld
HsRecFld :: XRecFld p -> AmbiguousFieldOcc p -> HsExpr p
-- | Overloaded label (Note [Overloaded labels] in GHC.OverloadedLabels)
HsOverLabel :: XOverLabel p -> FastString -> HsExpr p
-- | Implicit parameter (not in use after typechecking)
HsIPVar :: XIPVar p -> HsIPName -> HsExpr p
-- | Overloaded literals
HsOverLit :: XOverLitE p -> HsOverLit p -> HsExpr p
-- | Simple (non-overloaded) literals
HsLit :: XLitE p -> HsLit p -> HsExpr p
-- | Lambda abstraction. Currently always a single match
--
--
HsLam :: XLam p -> MatchGroup p (LHsExpr p) -> HsExpr p
-- | Lambda-case
--
--
HsLamCase :: XLamCase p -> MatchGroup p (LHsExpr p) -> HsExpr p
-- | Application
HsApp :: XApp p -> LHsExpr p -> LHsExpr p -> HsExpr p
-- | Visible type application
--
-- Explicit type argument; e.g f @Int x y NB: Has wildcards, but no
-- implicit quantification
--
--
HsAppType :: XAppTypeE p -> LHsExpr p -> LHsWcType (NoGhcTc p) -> HsExpr p
-- | Operator applications: NB Bracketed ops such as (+) come out as Vars.
OpApp :: XOpApp p -> LHsExpr p -> LHsExpr p -> LHsExpr p -> HsExpr p
-- | Negation operator. Contains the negated expression and the name of
-- negate
--
--
NegApp :: XNegApp p -> LHsExpr p -> SyntaxExpr p -> HsExpr p
-- |
HsPar :: XPar p -> LHsExpr p -> HsExpr p
SectionL :: XSectionL p -> LHsExpr p -> LHsExpr p -> HsExpr p
SectionR :: XSectionR p -> LHsExpr p -> LHsExpr p -> HsExpr p
-- | Used for explicit tuples and sections thereof
--
--
ExplicitTuple :: XExplicitTuple p -> [HsTupArg p] -> Boxity -> HsExpr p
-- | Used for unboxed sum types
--
--
--
-- There will be multiple AnnVbar, (1 - alternative) before the
-- expression, (arity - alternative) after it
ExplicitSum :: XExplicitSum p -> ConTag -> Arity -> LHsExpr p -> HsExpr p
-- |
HsCase :: XCase p -> LHsExpr p -> MatchGroup p (LHsExpr p) -> HsExpr p
-- |
HsIf :: XIf p -> LHsExpr p -> LHsExpr p -> LHsExpr p -> HsExpr p
-- | Multi-way if
--
--
HsMultiIf :: XMultiIf p -> [LGRHS p (LHsExpr p)] -> HsExpr p
-- | let(rec)
--
--
HsLet :: XLet p -> HsLocalBinds p -> LHsExpr p -> HsExpr p
-- |
HsDo :: XDo p -> HsStmtContext (HsDoRn p) -> XRec p [ExprLStmt p] -> HsExpr p
-- | Syntactic list: [a,b,c,...]
--
--
ExplicitList :: XExplicitList p -> [LHsExpr p] -> HsExpr p
-- | Record construction
--
--
RecordCon :: XRecordCon p -> XRec p (ConLikeP p) -> HsRecordBinds p -> HsExpr p
[rcon_ext] :: HsExpr p -> XRecordCon p
[rcon_con] :: HsExpr p -> XRec p (ConLikeP p)
[rcon_flds] :: HsExpr p -> HsRecordBinds p
-- | Record update
--
--
RecordUpd :: XRecordUpd p -> LHsExpr p -> Either [LHsRecUpdField p] [LHsRecUpdProj p] -> HsExpr p
[rupd_ext] :: HsExpr p -> XRecordUpd p
[rupd_expr] :: HsExpr p -> LHsExpr p
[rupd_flds] :: HsExpr p -> Either [LHsRecUpdField p] [LHsRecUpdProj p]
-- | Record field selection e.g z.x.
--
--
--
-- This case only arises when the OverloadedRecordDot langauge extension
-- is enabled.
HsGetField :: XGetField p -> LHsExpr p -> Located (HsFieldLabel p) -> HsExpr p
[gf_ext] :: HsExpr p -> XGetField p
[gf_expr] :: HsExpr p -> LHsExpr p
[gf_field] :: HsExpr p -> Located (HsFieldLabel p)
-- | Record field selector. e.g. (.x) or (.x.y)
--
--
--
-- This case only arises when the OverloadedRecordDot langauge extensions
-- is enabled.
HsProjection :: XProjection p -> NonEmpty (Located (HsFieldLabel p)) -> HsExpr p
[proj_ext] :: HsExpr p -> XProjection p
[proj_flds] :: HsExpr p -> NonEmpty (Located (HsFieldLabel p))
-- | Expression with an explicit type signature. e :: type
--
--
ExprWithTySig :: XExprWithTySig p -> LHsExpr p -> LHsSigWcType (NoGhcTc p) -> HsExpr p
-- | Arithmetic sequence
--
--
ArithSeq :: XArithSeq p -> Maybe (SyntaxExpr p) -> ArithSeqInfo p -> HsExpr p
-- |
HsBracket :: XBracket p -> HsBracket p -> HsExpr p
HsRnBracketOut :: XRnBracketOut p -> HsBracket (HsBracketRn p) -> [PendingRnSplice' p] -> HsExpr p
HsTcBracketOut :: XTcBracketOut p -> Maybe QuoteWrapper -> HsBracket (HsBracketRn p) -> [PendingTcSplice' p] -> HsExpr p
-- |
HsSpliceE :: XSpliceE p -> HsSplice p -> HsExpr p
-- | proc notation for Arrows
--
--
HsProc :: XProc p -> LPat p -> LHsCmdTop p -> HsExpr p
-- |
HsStatic :: XStatic p -> LHsExpr p -> HsExpr p
HsTick :: XTick p -> CoreTickish -> LHsExpr p -> HsExpr p
HsBinTick :: XBinTick p -> Int -> Int -> LHsExpr p -> HsExpr p
HsPragE :: XPragE p -> HsPragE p -> LHsExpr p -> HsExpr p
XExpr :: !XXExpr p -> HsExpr p
-- | Guarded Right-Hand Sides
--
-- GRHSs are used both for pattern bindings and for Matches
--
--
data GRHSs p body
GRHSs :: XCGRHSs p body -> [LGRHS p body] -> HsLocalBinds p -> GRHSs p body
[grhssExt] :: GRHSs p body -> XCGRHSs p body
-- | Guarded RHSs
[grhssGRHSs] :: GRHSs p body -> [LGRHS p body]
-- | The where clause
[grhssLocalBinds] :: GRHSs p body -> HsLocalBinds p
XGRHSs :: !XXGRHSs p body -> GRHSs p body
type family XXWarnDecls x
type family XXWarnDecl x
type family XXValBindsLR x x'
type family XXType x
type family XXTyVarBndr x
type family XXTyFamInstDecl x
type family XXTyClGroup x
type family XXTyClDecl x
type family XXTupArg x
type family XXStmtLR x x' b
type family XXStandaloneKindSig x
type family XXSpliceDecl x
type family XXSplice x
type family XXSig x
type family XXRuleDecls x
type family XXRuleDecl x
type family XXRuleBndr x
type family XXRoleAnnotDecl x
type family XXPragE x
type family XXPatSynBind x x'
type family XXPat x
type family XXParStmtBlock x x'
type family XXOverLit x
type family XXMatchGroup x b
type family XXMatch x b
type family XXLit x
type family XXLHsQTyVars x
type family XXInstDecl x
type family XXInjectivityAnn x
type family XXImportDecl x
type family XXIPBind x
type family XXIE x
type family XXHsWildCardBndrs x b
type family XXHsSigType x
type family XXHsPatSigType x
type family XXHsOuterTyVarBndrs x
type family XXHsLocalBindsLR x x'
type family XXHsIPBinds x
type family XXHsGroup x
type family XXHsForAllTelescope x
type family XXHsFieldLabel x
type family XXHsDerivingClause x
type family XXHsDecl x
type family XXHsDataDefn x
type family XXHsBindsLR x x'
type family XXGRHSs x b
type family XXGRHS x b
type family XXFunDep x
type family XXForeignDecl x
type family XXFixitySig x
type family XXFieldOcc x
type family XXFamilyResultSig x
type family XXFamilyDecl x
type family XXFamEqn x r
type family XXExpr x
type family XXDerivDecl x
type family XXDerivClauseTys x
type family XXDefaultDecl x
type family XXConDeclField x
type family XXConDecl x
type family XXCmdTop x
type family XXCmd x
type family XXClsInstDecl x
type family XXBracket x
type family XXApplicativeArg x
type family XXAnnDecl x
type family XXAmbiguousFieldOcc x
type family XXABExport x
type family XWildPat x
type family XWildCardTy x
type family XWarnings x
type family XWarningD x
type family XWarning x
type family XViewPat x
type family XViaStrategy x
type family XVarPat x
type family XVarBr x
type family XVarBind x x'
type family XVar x
type family XValD x
type family XValBinds x x'
type family XUserTyVar x
type family XUntypedSplice x
type family XUnboundVar x
type family XUnambiguous x
type family XTypedSplice x
type family XTypeSig x
type family XTypBr x
type family XTyVarSig x
type family XTyVar x
type family XTyLit x
type family XTyFamInstD x
type family XTyClD x
type family XTupleTy x
type family XTuplePat x
type family XTransStmt x x' b
type family XTick x
type family XTcBracketOut x
type family XTExpBr x
type family XSynDecl x
type family XSumTy x
type family XSumPat x
type family XStockStrategy x
type family XStatic x
type family XStarTy x
type family XStandaloneKindSig x
type family XSpliced x
type family XSpliceTy x
type family XSplicePat x
type family XSpliceE x
type family XSpliceDecl x
type family XSpliceD x
type family XSpecSig x
type family XSpecInstSig x
type family XSigPat x
type family XSigD x
type family XSectionR x
type family XSectionL x
type family XSCCFunSig x
type family XSCC x
type family XRuleD x
type family XRuleBndrSig x
type family XRoleAnnotD x
type family XRnBracketOut x
type family XRecordUpd x
type family XRecordCon x
type family XRecTy x
type family XRecStmt x x' b
type family XRecFld x
-- | GHC's L prefixed variants wrap their vanilla variant in this type
-- family, to add SrcLoc info via Located. Other passes
-- than GhcPass not interested in location information can
-- define this as type instance XRec NoLocated a = a. See Note
-- [XRec and SrcSpans in the AST]
type family XRec p a = (r :: Type) | r -> a
type family XQuasiQuote x
type family XQualTy x
type family XProjection x
type family XProc x
type family XPresent x
type family XPragE x
type family XPatSynSig x
type family XPatSynBind x x'
type family XPatBr x
type family XPatBind x x'
type family XParTy x
type family XParStmtBlock x x'
type family XParStmt x x' b
type family XParPat x
type family XPar x
type family XPSB x x'
type family XOverLitE x
type family XOverLit x
type family XOverLabel x
type family XOpTy x
type family XOpApp x
type family XNoSig x
type family XNewtypeStrategy x
type family XNegApp x
type family XNPlusKPat x
type family XNPat x
type family XMultiIf x
type family XMissing x
type family XMinimalSig x
type family XMG x b
type family XLitPat x
type family XLitE x
type family XListTy x
type family XListPat x
type family XLetStmt x x' b
type family XLet x
type family XLazyPat x
type family XLastStmt x x' b
type family XLamCase x
type family XLam x
type family XKindedTyVar x
type family XKindSigD x
type family XKindSig x
type family XInstD x
type family XInlineSig x
type family XIf x
type family XIdSig x
type family XIParamTy x
type family XIPVar x
type family XIPBinds x
type family XIEVar x
type family XIEThingWith x
type family XIEThingAll x
type family XIEThingAbs x
type family XIEModuleContents x
type family XIEGroup x
type family XIEDocNamed x
type family XIEDoc x
type family XHsWordPrim x
type family XHsWord64Prim x
type family XHsWC x b
type family XHsValBinds x x'
type family XHsStringPrim x
type family XHsString x
type family XHsSig x
type family XHsRule x
type family XHsRecField x
type family XHsRat x
type family XHsQTvs x
type family XHsPS x
type family XHsOuterImplicit x
type family XHsOuterExplicit x flag
type family XHsInteger x
type family XHsIntPrim x
type family XHsInt64Prim x
type family XHsInt x
type family XHsIPBinds x x'
type family XHsForAllVis x
type family XHsForAllInvis x
type family XHsFloatPrim x
type family XHsDoublePrim x
type family XHsCharPrim x
type family XHsChar x
type family XHsAnnotation x
type family XGetField x
type family XFunTy x
type family XFunBind x x'
type family XForeignImport x
type family XForeignExport x
type family XForD x
type family XForAllTy x
type family XFixitySig x
type family XFixSig x
type family XFamDecl x
type family XExprWithTySig x
type family XExplicitTupleTy x
type family XExplicitTuple x
type family XExplicitSum x
type family XExplicitListTy x
type family XExplicitList x
type family XExpBr x
type family XEmptyLocalBinds x x'
type family XDocTy x
type family XDocD x
type family XDo x
type family XDerivD x
type family XDefD x
type family XDecBrL x
type family XDecBrG x
type family XDctSingle x
type family XDctMulti x
type family XDataFamInstD x
type family XDataDecl x
type family XConPat x
type family XConLikeOut x
type family XConDeclH98 x
type family XConDeclGADT x
type family XConDeclField x
type family XCompleteMatchSig x
type family XCoPat x
type family XCmdWrap x
type family XCmdTop x
type family XCmdPar x
type family XCmdLet x
type family XCmdLamCase x
type family XCmdLam x
type family XCmdIf x
type family XCmdDo x
type family XCmdCase x
type family XCmdArrForm x
type family XCmdArrApp x
type family XCmdApp x
type family XClsInstD x
type family XClassOpSig x
type family XClassDecl x
type family XCase x
type family XCTyFamInstDecl x
type family XCTyClGroup x
type family XCRuleDecls x
type family XCRuleBndr x
type family XCRoleAnnotDecl x
type family XCMatch x b
type family XCKindSig x
type family XCInjectivityAnn x
type family XCImportDecl x
type family XCIPBind x
type family XCHsGroup x
type family XCHsFieldLabel x
type family XCHsDerivingClause x
type family XCHsDataDefn x
type family XCGRHSs x b
type family XCGRHS x b
type family XCFunDep x
type family XCFieldOcc x
type family XCFamilyDecl x
type family XCFamEqn x r
type family XCDerivDecl x
type family XCDefaultDecl x
type family XCClsInstDecl x
type family XBracket x
type family XBodyStmt x x' b
type family XBindStmt x x' b
type family XBinTick x
type family XBangTy x
type family XBangPat x
type family XAsPat x
type family XArithSeq x
type family XApplicativeStmt x x' b
type family XApplicativeArgOne x
type family XApplicativeArgMany x
type family XAppTypeE x
type family XAppTy x
type family XAppKindTy x
type family XApp x
type family XAnyClassStrategy x
type family XAnnD x
type family XAmbiguous x
type family XAbsBinds x x'
type family XABE x
-- | The trivial wrapper that carries no additional information See Note
-- [XRec and SrcSpans in the AST]
class WrapXRec p a
wrapXRec :: WrapXRec p a => a -> XRec p a
-- | We can strip off the XRec to access the underlying data. See Note
-- [XRec and SrcSpans in the AST]
class UnXRec p
unXRec :: UnXRec p => XRec p a -> a
-- | See Note [NoGhcTc] in GHC.Hs.Extension. It has to be in this module
-- because it is used like an extension point (in the data definitions of
-- types that should be parameter-agnostic.
type family NoGhcTc p
-- | A placeholder type for TTG extension points that are not currently
-- unused to represent any particular value.
--
-- This should not be confused with NoExtCon, which are found in
-- unused extension constructors and therefore should never be
-- inhabited. In contrast, NoExtField is used in extension
-- points (e.g., as the field of some constructor), so it must
-- have an inhabitant to construct AST passes that manipulate fields with
-- that extension point as their type.
data NoExtField
NoExtField :: NoExtField
-- | Used in TTG extension constructors that have yet to be extended with
-- anything. If an extension constructor has NoExtCon as its
-- field, it is not intended to ever be constructed anywhere, and any
-- function that consumes the extension constructor can eliminate it by
-- way of noExtCon.
--
-- This should not be confused with NoExtField, which are found in
-- unused extension points (not constructors) and therefore
-- can be inhabited.
data NoExtCon
-- | We can map over the underlying type contained in an XRec
-- while preserving the annotation as is.
class MapXRec p
mapXRec :: (MapXRec p, Anno a ~ Anno b) => (a -> b) -> XRec p a -> XRec p b
type LIdP p = XRec p IdP p
-- | Maps the "normal" id type for a given pass
type family IdP p
type family Anno a = (b :: Type)
-- | Used when constructing a term with an unused extension point.
noExtField :: NoExtField
-- | Eliminate a NoExtCon. Much like absurd.
noExtCon :: NoExtCon -> a
data IOEnvFailure
IOEnvFailure :: IOEnvFailure
data IOEnv env a
writeMutVar :: IORef a -> a -> IOEnv env ()
updMutVarM :: IORef a -> (a -> IOEnv env a) -> IOEnv env ()
updMutVar :: IORef a -> (a -> a) -> IOEnv env ()
-- | Perform a computation with an altered environment
updEnv :: (env -> env') -> IOEnv env' a -> IOEnv env a
unsafeInterleaveM :: IOEnv env a -> IOEnv env a
uninterruptibleMaskM_ :: IOEnv env a -> IOEnv env a
tryMostM :: IOEnv env r -> IOEnv env (Either SomeException r)
tryM :: IOEnv env r -> IOEnv env (Either IOEnvFailure r)
tryAllM :: IOEnv env r -> IOEnv env (Either SomeException r)
-- | Perform a computation with a different environment
setEnv :: env' -> IOEnv env' a -> IOEnv env a
runIOEnv :: env -> IOEnv env a -> IO a
readMutVar :: IORef a -> IOEnv env a
newMutVar :: a -> IOEnv env (IORef a)
getEnv :: IOEnv env env
fixM :: (a -> IOEnv env a) -> IOEnv env a
failWithM :: String -> IOEnv env a
failM :: IOEnv env a
-- | Strict variant of atomicUpdMutVar.
atomicUpdMutVar' :: IORef a -> (a -> (a, b)) -> IOEnv env b
-- | Atomically update the reference. Does not force the evaluation of the
-- new variable contents. For strict update, use atomicUpdMutVar'.
atomicUpdMutVar :: IORef a -> (a -> (a, b)) -> IOEnv env b
data InstalledFindResult
InstalledFound :: ModLocation -> InstalledModule -> InstalledFindResult
InstalledNoPackage :: UnitId -> InstalledFindResult
InstalledNotFound :: [FilePath] -> Maybe UnitId -> InstalledFindResult
-- | The FinderCache maps modules to the result of searching for
-- that module. It records the results of searching for modules along the
-- search path. On :load, we flush the entire contents of this
-- cache.
type FinderCache = InstalledModuleEnv InstalledFindResult
-- | The result of searching for an imported module.
--
-- NB: FindResult manages both user source-import lookups (which can
-- result in Module) as well as direct imports for interfaces
-- (which always result in InstalledModule).
data FindResult
-- | The module was found
Found :: ModLocation -> Module -> FindResult
-- | The requested unit was not found
NoPackage :: Unit -> FindResult
-- | _Error_: both in multiple packages
FoundMultiple :: [(Module, ModuleOrigin)] -> FindResult
-- | Not found
NotFound :: [FilePath] -> Maybe Unit -> [Unit] -> [Unit] -> [(Unit, UnusableUnitReason)] -> [ModuleSuggestion] -> FindResult
-- | Places where I looked
[fr_paths] :: FindResult -> [FilePath]
-- | Just p => module is in this unit's manifest, but couldn't find the
-- .hi file
[fr_pkg] :: FindResult -> Maybe Unit
-- | Module is in these units, but the *module* is hidden
[fr_mods_hidden] :: FindResult -> [Unit]
-- | Module is in these units, but the *unit* is hidden
[fr_pkgs_hidden] :: FindResult -> [Unit]
-- | Module is in these units, but it is unusable
[fr_unusables] :: FindResult -> [(Unit, UnusableUnitReason)]
-- | Possible mis-spelled modules
[fr_suggestions] :: FindResult -> [ModuleSuggestion]
type TurnOnFlag = Bool
-- | Flags for manipulating package trust.
data TrustFlag
-- |
-- -trust
--
TrustPackage :: String -> TrustFlag
-- |
-- -distrust
--
DistrustPackage :: String -> TrustFlag
data RtsOptsEnabled
RtsOptsNone :: RtsOptsEnabled
RtsOptsIgnore :: RtsOptsEnabled
RtsOptsIgnoreAll :: RtsOptsEnabled
RtsOptsSafeOnly :: RtsOptsEnabled
RtsOptsAll :: RtsOptsEnabled
data ProfAuto
-- | no SCC annotations added
NoProfAuto :: ProfAuto
-- | top-level and nested functions are annotated
ProfAutoAll :: ProfAuto
-- | top-level functions annotated only
ProfAutoTop :: ProfAuto
-- | exported functions annotated only
ProfAutoExports :: ProfAuto
-- | annotate call-sites
ProfAutoCalls :: ProfAuto
data PkgDbRef
GlobalPkgDb :: PkgDbRef
UserPkgDb :: PkgDbRef
PkgDbPath :: FilePath -> PkgDbRef
-- | Flags for manipulating packages visibility.
data PackageFlag
-- | -package, -package-id
ExposePackage :: String -> PackageArg -> ModRenaming -> PackageFlag
-- |
-- -hide-package
--
HidePackage :: String -> PackageFlag
data PackageDBFlag
PackageDB :: PkgDbRef -> PackageDBFlag
NoUserPackageDB :: PackageDBFlag
NoGlobalPackageDB :: PackageDBFlag
ClearPackageDBs :: PackageDBFlag
-- | We accept flags which make packages visible, but how they select the
-- package varies; this data type reflects what selection criterion is
-- used.
data PackageArg
-- | -package, by PackageName
PackageArg :: String -> PackageArg
-- | -package-id, by Unit
UnitIdArg :: Unit -> PackageArg
-- | Represents the renaming that may be associated with an exposed
-- package, e.g. the rns part of -package "foo (rns)".
--
-- Here are some example parsings of the package flags (where a string
-- literal is punned to be a ModuleName:
--
--
-- - -package foo is ModRenaming True []
-- - -package foo () is ModRenaming False []
-- - -package foo (A) is ModRenaming False [(A,
-- A)]
-- - -package foo (A as B) is ModRenaming False
-- [(A, B)]
-- - -package foo with (A as B) is ModRenaming True
-- [(A, B)]
--
data ModRenaming
ModRenaming :: Bool -> [(ModuleName, ModuleName)] -> ModRenaming
-- | Bring all exposed modules into scope?
[modRenamingWithImplicit] :: ModRenaming -> Bool
-- | Bring module m into scope under name n.
[modRenamings] :: ModRenaming -> [(ModuleName, ModuleName)]
data LlvmTarget
LlvmTarget :: String -> String -> [String] -> LlvmTarget
[lDataLayout] :: LlvmTarget -> String
[lCPU] :: LlvmTarget -> String
[lAttributes] :: LlvmTarget -> [String]
-- | See Note [LLVM Configuration] in GHC.SysTools.
data LlvmConfig
LlvmConfig :: [(String, LlvmTarget)] -> [(Int, String)] -> LlvmConfig
[llvmTargets] :: LlvmConfig -> [(String, LlvmTarget)]
[llvmPasses] :: LlvmConfig -> [(Int, String)]
data LinkerInfo
GnuLD :: [Option] -> LinkerInfo
GnuGold :: [Option] -> LinkerInfo
LlvmLLD :: [Option] -> LinkerInfo
DarwinLD :: [Option] -> LinkerInfo
SolarisLD :: [Option] -> LinkerInfo
AixLD :: [Option] -> LinkerInfo
UnknownLD :: LinkerInfo
-- | Used to differentiate the scope an include needs to apply to. We have
-- to split the include paths to avoid accidentally forcing recursive
-- includes since -I overrides the system search paths. See #14312.
data IncludeSpecs
IncludeSpecs :: [String] -> [String] -> [String] -> IncludeSpecs
[includePathsQuote] :: IncludeSpecs -> [String]
[includePathsGlobal] :: IncludeSpecs -> [String]
-- | See note [Implicit include paths]
[includePathsQuoteImplicit] :: IncludeSpecs -> [String]
-- | Flags for manipulating the set of non-broken packages.
newtype IgnorePackageFlag
-- |
-- -ignore-package
--
IgnorePackage :: String -> IgnorePackageFlag
class HasDynFlags (m :: Type -> Type)
getDynFlags :: HasDynFlags m => m DynFlags
-- | The GhcMode tells us whether we're doing multi-module
-- compilation (controlled via the GHC API) or one-shot
-- (single-module) compilation. This makes a difference primarily to the
-- GHC.Unit.Finder: in one-shot mode we look for interface files
-- for imported modules, but in multi-module mode we look for source
-- files in order to check whether they need to be recompiled.
data GhcMode
-- | --make, GHCi, etc.
CompManager :: GhcMode
-- |
-- ghc -c Foo.hs
--
OneShot :: GhcMode
-- | ghc -M, see GHC.Unit.Finder for why we need this
MkDepend :: GhcMode
-- | What to do in the link step, if there is one.
data GhcLink
-- | Don't link at all
NoLink :: GhcLink
-- | Link object code into a binary
LinkBinary :: GhcLink
-- | Use the in-memory dynamic linker (works for both bytecode and object
-- code).
LinkInMemory :: GhcLink
-- | Link objects into a dynamic lib (DLL on Windows, DSO on ELF platforms)
LinkDynLib :: GhcLink
-- | Link objects into a static lib
LinkStaticLib :: GhcLink
newtype FlushOut
FlushOut :: IO () -> FlushOut
newtype FlushErr
FlushErr :: IO () -> FlushErr
data FlagSpec flag
FlagSpec :: String -> flag -> (TurnOnFlag -> DynP ()) -> GhcFlagMode -> FlagSpec flag
-- | Flag in string form
[flagSpecName] :: FlagSpec flag -> String
-- | Flag in internal form
[flagSpecFlag] :: FlagSpec flag -> flag
-- | Extra action to run when the flag is found Typically, emit a warning
-- or error
[flagSpecAction] :: FlagSpec flag -> TurnOnFlag -> DynP ()
-- | In which ghc mode the flag has effect
[flagSpecGhcMode] :: FlagSpec flag -> GhcFlagMode
type FatalMessager = String -> IO ()
data DynamicTooState
-- | Don't try to build dynamic objects too
DT_Dont :: DynamicTooState
-- | Won't try to generate dynamic objects for some reason
DT_Failed :: DynamicTooState
-- | Will still try to generate dynamic objects
DT_OK :: DynamicTooState
-- | Currently generating dynamic objects (in the backend)
DT_Dyn :: DynamicTooState
data DynLibLoader
Deployable :: DynLibLoader
SystemDependent :: DynLibLoader
class ContainsDynFlags t
extractDynFlags :: ContainsDynFlags t => t -> DynFlags
data CompilerInfo
GCC :: CompilerInfo
Clang :: CompilerInfo
AppleClang :: CompilerInfo
AppleClang51 :: CompilerInfo
UnknownCC :: CompilerInfo
-- | Unset a Extension
xopt_unset :: DynFlags -> Extension -> DynFlags
-- | Set or unset a Extension, unless it has been explicitly set or
-- unset before.
xopt_set_unlessExplSpec :: Extension -> (DynFlags -> Extension -> DynFlags) -> DynFlags -> DynFlags
-- | Set a Extension
xopt_set :: DynFlags -> Extension -> DynFlags
xopt_FieldSelectors :: DynFlags -> FieldSelectors
xopt_DuplicateRecordFields :: DynFlags -> DuplicateRecordFields
-- | Test whether a Extension is set
xopt :: Extension -> DynFlags -> Bool
-- | These -Xblah flags can all be reversed with -XNoblah
xFlags :: [FlagSpec Extension]
wordAlignment :: Platform -> Alignment
-- | Mark a WarningFlag as not fatal
wopt_unset_fatal :: DynFlags -> WarningFlag -> DynFlags
-- | Unset a WarningFlag
wopt_unset :: DynFlags -> WarningFlag -> DynFlags
-- | Mark a WarningFlag as fatal (do not set the flag)
wopt_set_fatal :: DynFlags -> WarningFlag -> DynFlags
-- | Set a WarningFlag
wopt_set :: DynFlags -> WarningFlag -> DynFlags
-- | Test whether a WarningFlag is set as fatal
wopt_fatal :: WarningFlag -> DynFlags -> Bool
-- | Test whether a WarningFlag is set
wopt :: WarningFlag -> DynFlags -> Bool
ways :: DynFlags -> Ways
-- | Warning group hierarchies, where there is an explicit inclusion
-- relation.
--
-- Each inner list is a hierarchy of warning groups, ordered from
-- smallest to largest, where each group is a superset of the one before
-- it.
--
-- Separating this from warningGroups allows for multiple
-- hierarchies with no inherent relation to be defined.
--
-- The special-case Weverything group is not included.
warningHierarchies :: [[String]]
-- | Warning groups.
--
-- As all warnings are in the Weverything set, it is ignored when
-- displaying to the user which group a warning is in.
warningGroups :: [(String, [WarningFlag])]
-- | These -W<blah> flags can all be reversed with
-- -Wno-<blah>
wWarningFlags :: [FlagSpec WarningFlag]
-- | Find the FlagSpec for a WarningFlag.
wWarningFlagMap :: Map WarningFlag (FlagSpec WarningFlag)
versionedFilePath :: ArchOS -> FilePath
-- | The directory for this version of ghc in the user's app directory The
-- appdir used to be in ~/.ghc but to respect the XDG specification we
-- want to move it under $XDG_DATA_HOME/ However, old tooling (like
-- cabal) might still write package environments to the old directory, so
-- we prefer that if a subdirectory of ~/.ghc with the correct target and
-- GHC version suffix exists.
--
-- i.e. if ~.ghc$UNIQUE_SUBDIR exists we use that otherwise we use
-- $XDG_DATA_HOME/$UNIQUE_SUBDIR
--
-- UNIQUE_SUBDIR is typically a combination of the target platform and
-- GHC version
versionedAppDir :: String -> ArchOS -> MaybeT IO FilePath
-- | Should we use `-XLinker -rpath` when linking or not? See Note
-- [-fno-use-rpaths]
useXLinkerRPath :: DynFlags -> OS -> Bool
updatePlatformConstants :: DynFlags -> Maybe PlatformConstants -> IO DynFlags
-- | Sets the DynFlags to be appropriate to the optimisation level
updOptLevel :: Int -> DynFlags -> DynFlags
-- | A list of unsafe flags under Safe Haskell. Tuple elements are: * name
-- of the flag * function to get srcspan that enabled the flag * function
-- to test if the flag is on * function to turn the flag off
unsafeFlagsForInfer :: [(String, DynFlags -> SrcSpan, DynFlags -> Bool, DynFlags -> DynFlags)]
-- | A list of unsafe flags under Safe Haskell. Tuple elements are: * name
-- of the flag * function to get srcspan that enabled the flag * function
-- to test if the flag is on * function to turn the flag off
unsafeFlags :: [(String, DynFlags -> SrcSpan, DynFlags -> Bool, DynFlags -> DynFlags)]
unSetGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
turnOn :: TurnOnFlag
turnOff :: TurnOnFlag
topDir :: DynFlags -> FilePath
tmpDir :: DynFlags -> String
-- | Get target profile
targetProfile :: DynFlags -> Profile
supportedLanguagesAndExtensions :: ArchOS -> [String]
-- | Find the smallest group in every hierarchy which a warning belongs to,
-- excluding Weverything.
smallestGroups :: WarningFlag -> [String]
-- | "unbuild" a Settings from a DynFlags. This shouldn't be
-- needed in the vast majority of code. But GHCi questionably uses this
-- to produce a default DynFlags from which to compute a flags
-- diff for printing.
settings :: DynFlags -> Settings
setUnsafeGlobalDynFlags :: DynFlags -> IO ()
setUnitId :: String -> DynFlags -> DynFlags
setTmpDir :: FilePath -> DynFlags -> DynFlags
setGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
setFlagsFromEnvFile :: FilePath -> String -> DynP ()
setDynamicTooFailed :: MonadIO m => DynFlags -> m ()
setDynamicNow :: DynFlags -> DynFlags
-- | Indicate if cost-centre profiling is enabled
sccProfilingEnabled :: DynFlags -> Bool
-- | Is the Safe Haskell safe language in use
safeLanguageOn :: DynFlags -> Bool
-- | Is the Safe Haskell safe inference mode active
safeInferOn :: DynFlags -> Bool
-- | Test if Safe Imports are on in some form
safeImportsOn :: DynFlags -> Bool
-- | Are all implicit imports required to be safe for this Safe Haskell
-- mode? Implicit imports are things in the prelude. e.g System.IO when
-- print is used.
safeImplicitImpsReq :: DynFlags -> Bool
-- | Is Safe Haskell on in some way (including inference mode)
safeHaskellOn :: DynFlags -> Bool
safeHaskellModeEnabled :: DynFlags -> Bool
-- | Are all direct imports required to be safe for this Safe Haskell mode?
-- Direct imports are when the code explicitly imports a module
safeDirectImpsReq :: DynFlags -> Bool
projectVersion :: DynFlags -> String
programName :: DynFlags -> String
-- | Pretty-print the difference between 2 DynFlags.
--
-- For now only their general flags but it could be extended. Useful
-- mostly for debugging.
pprDynFlagsDiff :: DynFlags -> DynFlags -> SDoc
-- | Are we building with -fPIE or -fPIC enabled?
positionIndependent :: DynFlags -> Bool
picPOpts :: DynFlags -> [String]
picCCOpts :: DynFlags -> [String]
pgm_windres :: DynFlags -> String
pgm_ranlib :: DynFlags -> String
pgm_otool :: DynFlags -> String
pgm_lo :: DynFlags -> (String, [Option])
pgm_lm :: DynFlags -> (String, [Option])
pgm_libtool :: DynFlags -> String
pgm_lcc :: DynFlags -> (String, [Option])
pgm_lc :: DynFlags -> (String, [Option])
pgm_l :: DynFlags -> (String, [Option])
pgm_install_name_tool :: DynFlags -> String
pgm_i :: DynFlags -> String
pgm_dll :: DynFlags -> (String, [Option])
pgm_c :: DynFlags -> String
pgm_ar :: DynFlags -> String
pgm_a :: DynFlags -> (String, [Option])
pgm_T :: DynFlags -> String
pgm_P :: DynFlags -> (String, [Option])
pgm_L :: DynFlags -> String
pgm_F :: DynFlags -> String
-- | Parses the dynamically set flags for GHC. This is the most general
-- form of the dynamic flag parser that the other methods simply wrap. It
-- allows saying which flags are valid flags and indicating if we are
-- parsing arguments from the command line or from a file pragma.
parseDynamicFlagsFull :: MonadIO m => [Flag (CmdLineP DynFlags)] -> Bool -> DynFlags -> [Located String] -> m (DynFlags, [Located String], [Warn])
-- | Parse dynamic flags from a list of command line arguments. Returns the
-- parsed DynFlags, the left-over arguments, and a list of
-- warnings. Throws a UsageError if errors occurred during parsing
-- (such as unknown flags or missing arguments).
parseDynamicFlagsCmdLine :: MonadIO m => DynFlags -> [Located String] -> m (DynFlags, [Located String], [Warn])
-- | Like parseDynamicFlagsCmdLine but does not allow the package
-- flags (-package, -hide-package, -ignore-package, -hide-all-packages,
-- -package-db). Used to parse flags set in a modules pragma.
parseDynamicFilePragma :: MonadIO m => DynFlags -> [Located String] -> m (DynFlags, [Located String], [Warn])
-- | Is the -fpackage-trust mode on
packageTrustOn :: DynFlags -> Bool
packageFlagsChanged :: DynFlags -> DynFlags -> Bool
outputFile :: DynFlags -> Maybe String
opt_windres :: DynFlags -> [String]
opt_lo :: DynFlags -> [String]
opt_lm :: DynFlags -> [String]
opt_lcc :: DynFlags -> [String]
opt_lc :: DynFlags -> [String]
opt_l :: DynFlags -> [String]
opt_i :: DynFlags -> [String]
opt_cxx :: DynFlags -> [String]
opt_c :: DynFlags -> [String]
opt_a :: DynFlags -> [String]
opt_P_signature :: DynFlags -> ([String], Fingerprint)
opt_P :: DynFlags -> [String]
opt_L :: DynFlags -> [String]
opt_F :: DynFlags -> [String]
objectSuf :: DynFlags -> String
-- | Indicate whether we need to generate source notes
needSourceNotes :: DynFlags -> Bool
-- | Resolve any internal inconsistencies in a set of DynFlags.
-- Returns the consistent DynFlags as well as a list of warnings
-- to report to the user.
makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Located String])
-- | The language extensions implied by the various language variants. When
-- updating this be sure to update the flag documentation in
-- docsusers_guideexts.
languageExtensions :: Maybe Language -> [Extension]
lang_set :: DynFlags -> Maybe Language -> DynFlags
isSseEnabled :: Platform -> Bool
isSse4_2Enabled :: DynFlags -> Bool
isSse2Enabled :: Platform -> Bool
isOneShot :: GhcMode -> Bool
isNoLink :: GhcLink -> Bool
isBmiEnabled :: DynFlags -> Bool
isBmi2Enabled :: DynFlags -> Bool
isAvxEnabled :: DynFlags -> Bool
isAvx512pfEnabled :: DynFlags -> Bool
isAvx512fEnabled :: DynFlags -> Bool
isAvx512erEnabled :: DynFlags -> Bool
isAvx512cdEnabled :: DynFlags -> Bool
isAvx2Enabled :: DynFlags -> Bool
-- | Used by runGhc to partially initialize a new DynFlags
-- value
initDynFlags :: DynFlags -> IO DynFlags
-- | Initialize the pretty-printing options using the default user style
initDefaultSDocContext :: DynFlags -> SDocContext
impliedXFlags :: [(Extension, TurnOnFlag, Extension)]
impliedOffGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]
impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]
hiSuf :: DynFlags -> String
hasNoStateHack :: DynFlags -> Bool
hasNoOptCoercion :: DynFlags -> Bool
-- | Unset a GeneralFlag
gopt_unset :: DynFlags -> GeneralFlag -> DynFlags
-- | Set a GeneralFlag
gopt_set :: DynFlags -> GeneralFlag -> DynFlags
-- | Test whether a GeneralFlag is set
--
-- Note that dynamicNow (i.e., dynamic objects built with
-- `-dynamic-too`) always implicitly enables Opt_PIC,
-- Opt_ExternalDynamicRefs, and disables Opt_SplitSections.
gopt :: GeneralFlag -> DynFlags -> Bool
globalPackageDatabasePath :: DynFlags -> FilePath
glasgowExtsFlags :: [Extension]
ghciUsagePath :: DynFlags -> FilePath
ghcUsagePath :: DynFlags -> FilePath
-- | Gets the verbosity flag for the current verbosity level. This is fed
-- to other tools, so GHC-specific verbosity flags like
-- -ddump-most are not included
getVerbFlags :: DynFlags -> [String]
-- | Retrieve the options corresponding to a particular opt_*
-- field in the correct order
getOpts :: DynFlags -> (DynFlags -> [a]) -> [a]
-- | Concatenate and flatten the list of global and quoted includes
-- returning just a flat list of paths.
flattenIncludes :: IncludeSpecs -> [String]
flagsPackage :: [Flag (CmdLineP DynFlags)]
-- | Make a list of flags for shell completion. Filter all available flags
-- into two groups, for interactive GHC vs all other.
flagsForCompletion :: Bool -> [String]
flagsDynamic :: [Flag (CmdLineP DynFlags)]
flagsAll :: [Flag (CmdLineP DynFlags)]
flagSpecOf :: WarningFlag -> Maybe (FlagSpec WarningFlag)
-- | These -f<blah> flags can all be reversed with
-- -fno-<blah>
fLangFlags :: [FlagSpec Extension]
-- | These -f<blah> flags can all be reversed with
-- -fno-<blah>
fFlags :: [FlagSpec GeneralFlag]
extraGccViaCFlags :: DynFlags -> [String]
dynamicTooState :: MonadIO m => DynFlags -> m DynamicTooState
dynamicOutputHi :: DynFlags -> FilePath -> FilePath
-- | Compute the path of the dynamic object corresponding to an object
-- file.
dynamicOutputFile :: DynFlags -> FilePath -> FilePath
-- | Some modules have dependencies on others through the DynFlags rather
-- than textual imports
dynFlagDependencies :: DynFlags -> [ModuleName]
-- | Unset a DumpFlag
dopt_unset :: DynFlags -> DumpFlag -> DynFlags
-- | Set a DumpFlag
dopt_set :: DynFlags -> DumpFlag -> DynFlags
-- | Test whether a DumpFlag is set
dopt :: DumpFlag -> DynFlags -> Bool
defaultFlushOut :: FlushOut
defaultFlushErr :: FlushErr
defaultFatalMessager :: FatalMessager
-- | The normal DynFlags. Note that they are not suitable for use in
-- this form and must be fully initialized by runGhc first.
defaultDynFlags :: Settings -> LlvmConfig -> DynFlags
compilerInfo :: DynFlags -> [(String, String)]
-- | All dynamic flags option strings without the deprecated ones. These
-- are the user facing strings for enabling and disabling options.
allNonDeprecatedFlags :: [String]
-- | Append to the list of includes a path that shall be included using
-- `-iquote` when the C compiler is called. These paths only apply when
-- quoted includes are used. e.g. #include "foo.h"
addQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
addPluginModuleName :: String -> DynFlags -> DynFlags
-- | These includes are not considered while fingerprinting the flags for
-- iface | See note [Implicit include paths]
addImplicitQuoteInclude :: IncludeSpecs -> [String] -> IncludeSpecs
-- | Append to the list of includes a path that shall be included using
-- `-I` when the C compiler is called. These paths override system search
-- paths.
addGlobalInclude :: IncludeSpecs -> [String] -> IncludeSpecs
type CompleteMatches = [CompleteMatch]
-- | A list of conlikes which represents a complete pattern match. These
-- arise from COMPLETE signatures. See also Note [Implementation
-- of COMPLETE pragmas].
data CompleteMatch
-- | Source Unpackedness
--
-- What unpackedness the user requested
data SrcUnpackedness
-- | {-# UNPACK #-} specified
SrcUnpack :: SrcUnpackedness
-- | {-# NOUNPACK #-} specified
SrcNoUnpack :: SrcUnpackedness
-- | no unpack pragma
NoSrcUnpack :: SrcUnpackedness
-- | Source Strictness
--
-- What strictness annotation the user wrote
data SrcStrictness
-- | Lazy, ie ~
SrcLazy :: SrcStrictness
-- | Strict, ie !
SrcStrict :: SrcStrictness
-- | no strictness annotation
NoSrcStrict :: SrcStrictness
-- | Haskell Source Bang
--
-- Bangs on data constructor arguments as the user wrote them in the
-- source code.
--
-- (HsSrcBang _ SrcUnpack SrcLazy) and (HsSrcBang _
-- SrcUnpack NoSrcStrict) (without StrictData) makes no sense, we
-- emit a warning (in checkValidDataCon) and treat it like (HsSrcBang
-- _ NoSrcUnpack SrcLazy)
data HsSrcBang
HsSrcBang :: SourceText -> SrcUnpackedness -> SrcStrictness -> HsSrcBang
-- | Haskell Implementation Bang
--
-- Bangs of data constructor arguments as generated by the compiler after
-- consulting HsSrcBang, flags, etc.
data HsImplBang
-- | Lazy field, or one with an unlifted type
HsLazy :: HsImplBang
-- | Strict but not unpacked field
HsStrict :: HsImplBang
-- | Strict and unpacked field co :: arg-ty ~ product-ty HsBang
HsUnpack :: Maybe Coercion -> HsImplBang
-- | A set of CoercionHoles
type HoleSet = UniqSet CoercionHole
-- | This describes how a "map" operation over a type/coercion should
-- behave
data TyCoMapper env (m :: Type -> Type)
TyCoMapper :: (env -> TyVar -> m Type) -> (env -> CoVar -> m Coercion) -> (env -> CoercionHole -> m Coercion) -> (env -> TyCoVar -> ArgFlag -> m (env, TyCoVar)) -> (TyCon -> m TyCon) -> TyCoMapper env (m :: Type -> Type)
[tcm_tyvar] :: TyCoMapper env (m :: Type -> Type) -> env -> TyVar -> m Type
[tcm_covar] :: TyCoMapper env (m :: Type -> Type) -> env -> CoVar -> m Coercion
-- | What to do with coercion holes. See Note [Coercion holes] in
-- GHC.Core.TyCo.Rep.
[tcm_hole] :: TyCoMapper env (m :: Type -> Type) -> env -> CoercionHole -> m Coercion
-- | The returned env is used in the extended scope
[tcm_tycobinder] :: TyCoMapper env (m :: Type -> Type) -> env -> TyCoVar -> ArgFlag -> m (env, TyCoVar)
-- | This is used only for TcTyCons a) To zonk TcTyCons b) To turn TcTyCons
-- into TyCons. See Note [Type checking recursive type and class
-- declarations] in GHC.Tc.TyCl
[tcm_tycon] :: TyCoMapper env (m :: Type -> Type) -> TyCon -> m TyCon
-- | Is this type a custom user error? If so, give us the kind and the
-- error message.
userTypeError_maybe :: Type -> Maybe Type
-- | Scale a payload by Many
unrestricted :: a -> Scaled a
typeKind :: HasDebugCallStack => Type -> Kind
-- | Scale a payload by Many; used for type arguments in core
tymult :: a -> Scaled a
-- | All type constructors occurring in the type; looking through type
-- synonyms, but not newtypes. When it finds a Class, it returns the
-- class TyCon.
tyConsOfType :: Type -> UniqSet TyCon
tyConBindersTyCoBinders :: [TyConBinder] -> [TyCoBinder]
-- | Given a TyCon and a list of argument types to which the
-- TyCon is applied, determine each argument's visibility
-- (Inferred, Specified, or Required).
--
-- Wrinkle: consider the following scenario:
--
--
-- T :: forall k. k -> k
-- tyConArgFlags T [forall m. m -> m -> m, S, R, Q]
--
--
-- After substituting, we get
--
--
-- T (forall m. m -> m -> m) :: (forall m. m -> m -> m) -> forall n. n -> n -> n
--
--
-- Thus, the first argument is invisible, S is visible,
-- R is invisible again, and Q is visible.
tyConArgFlags :: TyCon -> [Type] -> [ArgFlag]
-- | Retrieve the tycon heading this type, if there is one. Does not
-- look through synonyms.
tyConAppTyConPicky_maybe :: Type -> Maybe TyCon
tyConAppTyCon :: Type -> TyCon
-- | Does a TyCon (that is applied to some number of arguments) need
-- to be ascribed with an explicit kind signature to resolve ambiguity if
-- rendered as a source-syntax type? (See Note [When does a tycon
-- application need an explicit kind signature?] for a full
-- explanation of what this function checks for.)
tyConAppNeedsKindSig :: Bool -> TyCon -> Int -> Bool
-- | The same as snd . splitTyConApp
tyConAppArgs_maybe :: Type -> Maybe [Type]
tyConAppArgs :: Type -> [Type]
tyConAppArgN :: Int -> Type -> Type
tyCoBinderVar_maybe :: TyCoBinder -> Maybe TyCoVar
tyCoBinderType :: TyCoBinder -> Type
tyBinderType :: TyBinder -> Type
tcTypeKind :: HasDebugCallStack => Type -> Kind
-- | Split a type constructor application into its type constructor and
-- applied types. Note that this may fail in the case of a FunTy
-- with an argument of unknown kind FunTy (e.g. FunTy (a :: k)
-- Int. since the kind of a isn't of the form TYPE
-- rep). Consequently, you may need to zonk your type before using
-- this function.
--
-- This does *not* split types headed with (=>), as that's not a TyCon
-- in the type-checker.
--
-- If you only need the TyCon, consider using
-- tcTyConAppTyCon_maybe.
tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type])
tcReturnsConstraintKind :: Kind -> Bool
-- | Like tcSplitTyConApp_maybe, but doesn't look through synonyms.
-- This assumes the synonyms have already been dealt with.
--
-- Moreover, for a FunTy, it only succeeds if the argument types have
-- enough info to extract the runtime-rep arguments that the funTyCon
-- requires. This will usually be true; but may be temporarily false
-- during canonicalization: see Note [Decomposing FunTy] in
-- GHC.Tc.Solver.Canonical and Note [The Purely Kinded Type Invariant
-- (PKTI)] in GHC.Tc.Gen.HsType, Wrinkle around FunTy
tcRepSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
-- | Does the AppTy split as in tcSplitAppTy_maybe, but assumes
-- that any coreView stuff is already done. Refuses to look through (c
-- => t)
tcRepSplitAppTy_maybe :: Type -> Maybe (Type, Type)
-- | Is this kind equivalent to TYPE r (for some unknown r)?
--
-- This considers Constraint to be distinct from *.
tcIsRuntimeTypeKind :: Kind -> Bool
-- | Is this kind equivalent to Type?
--
-- This considers Constraint to be distinct from Type.
-- For a version that treats them as the same type, see
-- isLiftedTypeKind.
tcIsLiftedTypeKind :: Kind -> Bool
tcIsConstraintKind :: Kind -> Bool
-- | Is this kind equivalent to TYPE (BoxedRep l) for some l
-- :: Levity?
--
-- This considers Constraint to be distinct from Type.
-- For a version that treats them as the same type, see
-- isLiftedTypeKind.
tcIsBoxedTypeKind :: Kind -> Bool
stripCoercionTy :: Type -> Coercion
splitVisVarsOfTypes :: [Type] -> Pair TyCoVarSet
-- | Retrieve the free variables in this type, splitting them based on
-- whether they are used visibly or invisibly. Invisible ones come first.
splitVisVarsOfType :: Type -> Pair TyCoVarSet
-- | Attempts to tease a type apart into a type constructor and the
-- application of a number of arguments to that constructor. Panics if
-- that is not possible. See also splitTyConApp_maybe
splitTyConApp :: Type -> (TyCon, [Type])
-- | Split off all TyCoBinders to a type, splitting both proper foralls and
-- functions
splitPiTys :: Type -> ([TyCoBinder], Type)
-- | Attempts to take a forall type apart; works with proper foralls and
-- functions
splitPiTy_maybe :: Type -> Maybe (TyCoBinder, Type)
-- | Takes a forall type apart, or panics
splitPiTy :: Type -> (TyCoBinder, Type)
-- | Attempts to tease a list type apart and gives the type of the elements
-- if successful (looks through type synonyms)
splitListTyConApp_maybe :: Type -> Maybe Type
-- | Same as splitInvisPiTys, but stop when - you have found
-- n TyCoBinders, - or you run out of invisible binders
splitInvisPiTysN :: Int -> Type -> ([TyCoBinder], Type)
-- | Like splitPiTys, but returns only *invisible* binders,
-- including constraints. Stops at the first visible binder.
splitInvisPiTys :: Type -> ([TyCoBinder], Type)
splitFunTys :: Type -> ([Scaled Type], Type)
-- | Attempts to extract the multiplicity, argument and result types from a
-- type
splitFunTy_maybe :: Type -> Maybe (Mult, Type, Type)
-- | Attempts to extract the multiplicity, argument and result types from a
-- type, and panics if that is not possible. See also
-- splitFunTy_maybe
splitFunTy :: Type -> (Mult, Type, Type)
-- | Like splitForAllTyCoVar_maybe, but only returns Just if it is a
-- tyvar binder.
splitForAllTyVar_maybe :: Type -> Maybe (TyCoVar, Type)
-- | Take a ForAllTy apart, returning the list of tycovars and the result
-- type. This always succeeds, even if it returns only an empty list.
-- Note that the result type returned may have free variables that were
-- bound by a forall.
splitForAllTyCoVars :: Type -> ([TyCoVar], Type)
-- | Attempts to take a forall type apart, but only if it's a proper
-- forall, with a named binder
splitForAllTyCoVar_maybe :: Type -> Maybe (TyCoVar, Type)
-- | Like splitPiTys but split off only named binders and
-- returns TyCoVarBinders rather than TyCoBinders
splitForAllTyCoVarBinders :: Type -> ([TyCoVarBinder], Type)
-- | Take a forall type apart, or panics if that is not possible.
splitForAllTyCoVar :: Type -> (TyCoVar, Type)
-- | Like splitForAllTyCoVars, but only splits ForAllTys with
-- Required type variable binders. Furthermore, each returned
-- tyvar is annotated with ().
splitForAllReqTVBinders :: Type -> ([ReqTVBinder], Type)
-- | Like splitForAllTyCoVars, but only splits ForAllTys with
-- Invisible type variable binders. Furthermore, each returned
-- tyvar is annotated with its Specificity.
splitForAllInvisTVBinders :: Type -> ([InvisTVBinder], Type)
-- | Like splitForAllTyCoVar_maybe, but only returns Just if it is a
-- covar binder.
splitForAllCoVar_maybe :: Type -> Maybe (TyCoVar, Type)
splitCastTy_maybe :: Type -> Maybe (Type, Coercion)
-- | Recursively splits a type as far as is possible, leaving a residual
-- type being applied to and the type arguments applied to it. Never
-- fails, even if that means returning an empty list of type
-- applications.
splitAppTys :: Type -> (Type, [Type])
-- | Attempt to take a type application apart, whether it is a function,
-- type constructor, or plain type application. Note that type family
-- applications are NEVER unsaturated by this!
splitAppTy_maybe :: Type -> Maybe (Type, Type)
-- | Attempts to take a type application apart, as in
-- splitAppTy_maybe, and panics if this is not possible
splitAppTy :: Type -> (Type, Type)
seqTypes :: [Type] -> ()
seqType :: Type -> ()
scaledSet :: Scaled a -> b -> Scaled b
-- | Looking past all pi-types, is the end result potentially levity
-- polymorphic? Example: True for (forall r (a :: TYPE r). String ->
-- a) Example: False for (forall r1 r2 (a :: TYPE r1) (b :: TYPE r2). a
-- -> b -> Type)
resultIsLevPoly :: Type -> Bool
-- | Like splitTyConApp_maybe, but doesn't look through synonyms.
-- This assumes the synonyms have already been dealt with.
repSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
-- | Like splitAppTys, but doesn't look through type synonyms
repSplitAppTys :: HasDebugCallStack => Type -> (Type, [Type])
-- | Does the AppTy split as in splitAppTy_maybe, but assumes that
-- any Core view stuff is already done
repSplitAppTy_maybe :: HasDebugCallStack => Type -> Maybe (Type, Type)
-- | Attempts to obtain the type variable underlying a Type, without
-- any expansion
repGetTyVar_maybe :: Type -> Maybe TyVar
-- | Render a type corresponding to a user type error into a SDoc.
pprUserTypeErrorTy :: Type -> SDoc
pickyIsLiftedTypeKind :: Kind -> Bool
-- | (piResultTys f_ty [ty1, .., tyn]) gives the type of (f ty1 .. tyn)
-- where f :: f_ty piResultTys is interesting because: 1.
-- f_ty may have more for-alls than there are args 2. Less
-- obviously, it may have fewer for-alls For case 2. think of:
-- piResultTys (forall a.a) [forall b.b, Int] This really can happen, but
-- only (I think) in situations involving undefined. For example:
-- undefined :: forall a. a Term: undefined (forall b. b->b)
-- Int This term should have type (Int -> Int), but notice that
-- there are more type args than foralls in undefineds type.
piResultTys :: HasDebugCallStack => Type -> [Type] -> Type
-- | Given a list of things paired with their visibilities, partition the
-- things into (invisible things, visible things).
partitionInvisibles :: [(a, ArgFlag)] -> ([a], [a])
occCheckExpand :: [Var] -> Type -> Maybe Type
nonDetCmpTypesX :: RnEnv2 -> [Type] -> [Type] -> Ordering
nonDetCmpTypes :: [Type] -> [Type] -> Ordering
nonDetCmpTypeX :: RnEnv2 -> Type -> Type -> Ordering
nonDetCmpType :: Type -> Type -> Ordering
-- | Compare two TyCons. NB: This should never see
-- Constraint (as recognized by Kind.isConstraintKindCon) which
-- is considered a synonym for Type in Core. See Note [Kind
-- Constraint and kind Type] in GHC.Core.Type. See Note
-- [nonDetCmpType nondeterminism]
nonDetCmpTc :: TyCon -> TyCon -> Ordering
-- | Unwrap one layer of newtype on a type constructor and its
-- arguments, using an eta-reduced version of the newtype if
-- possible. This requires tys to have at least newTyConInstArity
-- tycon elements.
newTyConInstRhs :: TyCon -> [Type] -> Type
-- | Like mkForAllTys, but assumes all variables are dependent and visible
mkVisForAllTys :: [TyVar] -> Type -> Type
-- | Given a list of type-level vars and the free vars of a result kind,
-- makes TyCoBinders, preferring anonymous binders if the variable is, in
-- fact, not dependent. e.g. mkTyConBindersPreferAnon
-- (k:*),(b:k),(c:k) We want (k:*) Named, (b:k) Anon, (c:k) Anon
--
-- All non-coercion binders are visible.
mkTyConBindersPreferAnon :: [TyVar] -> TyCoVarSet -> [TyConBinder]
-- | Like mkForAllTys, but assumes all variables are dependent and
-- Inferred, a common case
mkTyCoInvForAllTys :: [TyCoVar] -> Type -> Type
-- | Make a dependent forall over an Inferred variable
mkTyCoInvForAllTy :: TyCoVar -> Type -> Type
mkStrLitTy :: FastString -> Type
-- | Like mkForAllTys, but assumes all variables are dependent and
-- Specified, a common case
mkSpecForAllTys :: [TyVar] -> Type -> Type
-- | Like mkForAllTy, but assumes the variable is dependent and
-- Specified, a common case
mkSpecForAllTy :: TyVar -> Type -> Type
mkScaled :: Mult -> a -> Scaled a
mkNumLitTy :: Integer -> Type
-- | Like mkTyCoInvForAllTys, but tvs should be a list of tyvar
mkInfForAllTys :: [TyVar] -> Type -> Type
-- | Like mkTyCoInvForAllTy, but tv should be a tyvar
mkInfForAllTy :: TyVar -> Type -> Type
-- | Given a family instance TyCon and its arg types, return the
-- corresponding family type. E.g:
--
--
-- data family T a
-- data instance T (Maybe b) = MkT b
--
--
-- Where the instance tycon is :RTL, so:
--
--
-- mkFamilyTyConApp :RTL Int = T (Maybe Int)
--
mkFamilyTyConApp :: TyCon -> [Type] -> Type
mkCoercionTy :: Coercion -> Type
mkCharLitTy :: Char -> Type
mkAppTys :: Type -> [Type] -> Type
-- | Make an anonymous binder
mkAnonBinder :: AnonArgFlag -> Scaled Type -> TyCoBinder
-- | Returns:
--
--
-- - False if the type is guaranteed lifted or
-- - True if it is unlifted, OR we aren't sure (e.g. in a
-- levity-polymorphic case)
--
mightBeUnliftedType :: Type -> Bool
mapTyCoX :: Monad m => TyCoMapper env m -> (env -> Type -> m Type, env -> [Type] -> m [Type], env -> Coercion -> m Coercion, env -> [Coercion] -> m [Coercion])
mapTyCo :: Monad m => TyCoMapper () m -> (Type -> m Type, [Type] -> m [Type], Coercion -> m Coercion, [Coercion] -> m [Coercion])
-- | Scale a payload by One
linear :: a -> Scaled a
-- | Given a kind (TYPE rr), extract its RuntimeRep classifier rr. For
-- example, kindRep_maybe * = Just LiftedRep Returns
-- Nothing if the kind is not of form (TYPE rr) Treats * and
-- Constraint as the same
kindRep_maybe :: HasDebugCallStack => Kind -> Maybe Type
-- | Extract the RuntimeRep classifier of a type from its kind. For
-- example, kindRep * = LiftedRep; Panics if this is not
-- possible. Treats * and Constraint as the same
kindRep :: HasDebugCallStack => Kind -> Type
-- | Determine whether a type could be the type of a join point of given
-- total arity, according to the polymorphism rule. A join point cannot
-- be polymorphic in its return type, since given join j a b x y
-- z = e1 in e2, the types of e1 and e2 must be the same, and a and b are
-- not in scope for e2. (See Note [The polymorphism rule of join points]
-- in GHC.Core.) Returns False also if the type simply doesn't
-- have enough arguments.
--
-- Note that we need to know how many arguments (type *and* value) the
-- putative join point takes; for instance, if j :: forall a. a -> Int
-- then j could be a binary join point returning an Int, but it could
-- *not* be a unary join point returning a -> Int.
--
-- TODO: See Note [Excess polymorphism and join points]
isValidJoinPointType :: JoinArity -> Type -> Bool
-- | Returns True if the kind classifies unlifted types (like 'Int#') and
-- False otherwise. Note that this returns False for levity-polymorphic
-- kinds, which may be specialized to a kind that classifies unlifted
-- types.
isUnliftedTypeKind :: Kind -> Bool
-- | See Type#type_classification for what an unlifted type is.
-- Panics on levity polymorphic types; See mightBeUnliftedType for
-- a more approximate predicate that behaves better in the presence of
-- levity polymorphism.
isUnliftedType :: HasDebugCallStack => Type -> Bool
isUnliftedRuntimeRep :: Type -> Bool
isUnliftedLevity :: Type -> Bool
isUnboxedTupleType :: Type -> Bool
isUnboxedSumType :: Type -> Bool
-- | Returns True if a type is levity polymorphic. Should be the same as
-- (isKindLevPoly . typeKind) but much faster. Precondition: The type has
-- kind (TYPE blah)
isTypeLevPoly :: Type -> Bool
isTyVarTy :: Type -> Bool
isTauTy :: Type -> Bool
-- | Computes whether an argument (or let right hand side) should be
-- computed strictly or lazily, based only on its type. Currently, it's
-- just isUnliftedType. Panics on levity-polymorphic types.
isStrictType :: HasDebugCallStack => Type -> Bool
-- | Is this a symbol literal. We also look through type synonyms.
isStrLitTy :: Type -> Maybe FastString
-- | Is a tyvar of type RuntimeRep?
isRuntimeRepVar :: TyVar -> Bool
-- | Is this a type of kind RuntimeRep? (e.g. LiftedRep)
isRuntimeRepKindedTy :: Type -> Bool
-- | Returns true of types that are opaque to Haskell.
isPrimitiveType :: Type -> Bool
-- | Is this a function or forall?
isPiTy :: Type -> Bool
isOneDataConTy :: Mult -> Bool
-- | Is this a numeric literal. We also look through type synonyms.
isNumLitTy :: Type -> Maybe Integer
-- | Is a tyvar of type Multiplicity?
isMultiplicityVar :: TyVar -> Bool
isManyDataConTy :: Mult -> Bool
-- | Is this a type literal (symbol, numeric, or char)?
isLitTy :: Type -> Maybe TyLit
-- | isLinear t returns True of a if t is a type
-- of (curried) function where at least one argument is linear (or
-- otherwise non-unrestricted). We use this function to check whether it
-- is safe to eta reduce an Id in CorePrep. It is always safe to return
-- True, because True deactivates the optimisation.
isLinearType :: Type -> Bool
-- | Returns Just True if this type is surely lifted, Just False if it is
-- surely unlifted, Nothing if we can't be sure (i.e., it is levity
-- polymorphic), and panics if the kind does not have the shape TYPE r.
isLiftedType_maybe :: HasDebugCallStack => Type -> Maybe Bool
isLiftedRuntimeRep :: Type -> Bool
isLiftedLevity :: Type -> Bool
-- | Is a tyvar of type Levity?
isLevityVar :: TyVar -> Bool
-- | Is this the type Levity?
isLevityTy :: Type -> Bool
-- | Tests whether the given kind (which should look like TYPE x)
-- is something other than a constructor tree (that is, constructors at
-- every node). E.g. True of TYPE k, TYPE (F Int) False of TYPE
-- 'LiftedRep
isKindLevPoly :: Kind -> Bool
-- | Is this a function?
isFunTy :: Type -> Bool
-- | Like isForAllTy, but returns True only if it is a tyvar binder
isForAllTy_ty :: Type -> Bool
-- | Like isForAllTy, but returns True only if it is a covar binder
isForAllTy_co :: Type -> Bool
-- | Checks whether this is a proper forall (with a named binder)
isForAllTy :: Type -> Bool
isFamFreeTy :: Type -> Bool
-- | Check whether a type is a data family type
isDataFamilyAppType :: Type -> Bool
isCoercionTy_maybe :: Type -> Maybe Coercion
-- | Does this type classify a core (unlifted) Coercion? At either role
-- nominal or representational (t1 ~# t2) or (t1 ~R# t2) See Note [Types
-- for coercions, predicates, and evidence] in GHC.Core.TyCo.Rep
isCoVarType :: Type -> Bool
-- | Is this a char literal? We also look through type synonyms.
isCharLitTy :: Type -> Maybe Char
-- | Returns True if the kind classifies types which are allocated on the
-- GC'd heap and False otherwise. Note that this returns False for
-- levity-polymorphic kinds, which may be specialized to a kind that
-- classifies AddrRep or even unboxed kinds.
isBoxedTypeKind :: Kind -> Bool
-- | See Type#type_classification for what a boxed type is. Panics
-- on levity polymorphic types; See mightBeUnliftedType for a more
-- approximate predicate that behaves better in the presence of levity
-- polymorphism.
isBoxedType :: Type -> Bool
-- | See isBoxedRuntimeRep_maybe.
isBoxedRuntimeRep :: Type -> Bool
isAtomicTy :: Type -> Bool
-- | Does this binder bind a variable that is not erased? Returns
-- True for anonymous binders.
isAnonTyCoBinder :: TyCoBinder -> Bool
-- | See Type#type_classification for what an algebraic type is.
-- Should only be applied to types, as opposed to e.g. partially
-- saturated type constructors
isAlgType :: Type -> Bool
irrelevantMult :: Scaled a -> a
invisibleTyBndrCount :: Type -> Int
-- | Attempts to obtain the type variable underlying a Type
getTyVar_maybe :: Type -> Maybe TyVar
-- | Attempts to obtain the type variable underlying a Type, and
-- panics with the given message if this is not a type variable type. See
-- also getTyVar_maybe
getTyVar :: String -> Type -> TyVar
-- | Extract the RuntimeRep classifier of a type. For instance,
-- getRuntimeRep_maybe Int = LiftedRep. Returns Nothing
-- if this is not possible.
getRuntimeRep_maybe :: HasDebugCallStack => Type -> Maybe Type
-- | Extract the RuntimeRep classifier of a type. For instance,
-- getRuntimeRep_maybe Int = LiftedRep. Panics if this is not
-- possible.
getRuntimeRep :: HasDebugCallStack => Type -> Type
-- | If the type is a tyvar, possibly under a cast, returns it, along with
-- the coercion. Thus, the co is :: kind tv ~N kind ty
getCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN)
-- | Extract the function result type and panic if that is not possible
funResultTy :: Type -> Type
-- | Just like piResultTys but for a single argument Try not to
-- iterate piResultTy, because it's inefficient to substitute one
-- variable at a time; instead use 'piResultTys"
--
-- Extract the function argument type and panic if that is not possible
funArgTy :: Type -> Type
-- | Given a TyCon and a list of argument types, filter out any
-- invisible (i.e., Inferred or Specified) arguments.
filterOutInvisibleTypes :: TyCon -> [Type] -> [Type]
-- | Given a TyCon and a list of argument types, filter out any
-- Inferred arguments.
filterOutInferredTypes :: TyCon -> [Type] -> [Type]
-- | Expand out all type synonyms. Actually, it'd suffice to expand out
-- just the ones that discard type variables (e.g. type Funny a = Int)
-- But we don't know which those are currently, so we just expand all.
--
-- expandTypeSynonyms only expands out type synonyms mentioned in
-- the type, not in the kinds of any TyCon or TyVar mentioned in the
-- type.
--
-- Keep this synchronized with synonymTyConsOfType
expandTypeSynonyms :: Type -> Type
eqVarBndrs :: RnEnv2 -> [Var] -> [Var] -> Maybe RnEnv2
-- | Type equality on lists of types, looking through type synonyms but not
-- newtypes.
eqTypes :: [Type] -> [Type] -> Bool
-- | Compare types with respect to a (presumably) non-empty RnEnv2.
eqTypeX :: RnEnv2 -> Type -> Type -> Bool
-- | Type equality on source types. Does not look through newtypes
-- or PredTypes, but it does look through type synonyms. This
-- first checks that the kinds of the types are equal and then checks
-- whether the types are equal, ignoring casts and coercions. (The kind
-- check is a recursive call, but since all kinds have type
-- Type, there is no need to check the types of kinds.) See also
-- Note [Non-trivial definitional equality] in GHC.Core.TyCo.Rep.
eqType :: Type -> Type -> Bool
-- | Drops prefix of RuntimeRep constructors in TyConApps. Useful
-- for e.g. dropping 'LiftedRep arguments of unboxed tuple TyCon
-- applications:
--
-- dropRuntimeRepArgs [ 'LiftedRep, 'IntRep , String, Int# ] == [String,
-- Int#]
dropRuntimeRepArgs :: [Type] -> [Type]
-- | Drops all ForAllTys
dropForAlls :: Type -> Type
-- | Get the type on the LHS of a coercion induced by a type/data family
-- instance.
coAxNthLHS :: forall (br :: BranchFlag). CoAxiom br -> Int -> Type
-- | Does this classify a type allowed to have values? Responds True to
-- things like *, #, TYPE Lifted, TYPE v, Constraint.
--
-- True of any sub-kind of OpenTypeKind
classifiesTypeWithValues :: Kind -> Bool
buildSynTyCon :: Name -> [KnotTied TyConBinder] -> Kind -> [Role] -> KnotTied Type -> TyCon
-- | Extract a relevant type, if there is one.
binderRelevantType_maybe :: TyCoBinder -> Maybe Type
applyTysX :: [TyVar] -> Type -> [Type] -> Type
-- | Given a Type and a list of argument types to which the
-- Type is applied, determine each argument's visibility
-- (Inferred, Specified, or Required).
--
-- Most of the time, the arguments will be Required, but not
-- always. Consider f :: forall a. a -> Type. In f Type
-- Bool, the first argument (Type) is Specified and
-- the second argument (Bool) is Required. It is
-- precisely this sort of higher-rank situation in which
-- appTyArgFlags comes in handy, since f Type Bool would
-- be represented in Core using AppTys. (See also #15792).
appTyArgFlags :: Type -> [Type] -> [ArgFlag]
pattern One :: Mult
pattern Many :: Mult
-- | The FUN type constructor.
--
--
-- FUN :: forall (m :: Multiplicity) ->
-- forall {rep1 :: RuntimeRep} {rep2 :: RuntimeRep}.
-- TYPE rep1 -> TYPE rep2 -> *
--
--
-- The runtime representations quantification is left inferred. This
-- means they cannot be specified with -XTypeApplications.
--
-- This is a deliberate choice to allow future extensions to the function
-- arrow. To allow visible application a type synonym can be defined:
--
--
-- type Arr :: forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep).
-- TYPE rep1 -> TYPE rep2 -> Type
-- type Arr = FUN 'Many
--
funTyCon :: TyCon
-- | A substitution of Types for TyVars and Kinds for
-- KindVars
type TvSubstEnv = TyVarEnv Type
-- | Type & coercion substitution
--
-- The following invariants must hold of a TCvSubst:
--
--
-- - The in-scope set is needed only to guide the generation of
-- fresh uniques
-- - In particular, the kind of the type variables in the
-- in-scope set is not relevant
-- - The substitution is only applied ONCE! This is because in general
-- such application will not reach a fixed point.
--
data TCvSubst
TCvSubst :: InScopeSet -> TvSubstEnv -> CvSubstEnv -> TCvSubst
zipTyEnv :: HasDebugCallStack => [TyVar] -> [Type] -> TvSubstEnv
-- | Generates the in-scope set for the TCvSubst from the types in
-- the incoming environment. No CoVars, please!
zipTvSubst :: HasDebugCallStack => [TyVar] -> [Type] -> TCvSubst
zipTCvSubst :: HasDebugCallStack => [TyCoVar] -> [Type] -> TCvSubst
zipCoEnv :: HasDebugCallStack => [CoVar] -> [Coercion] -> CvSubstEnv
zapTCvSubst :: TCvSubst -> TCvSubst
unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
substVarBndrs :: HasCallStack => TCvSubst -> [TyCoVar] -> (TCvSubst, [TyCoVar])
substVarBndr :: HasCallStack => TCvSubst -> TyCoVar -> (TCvSubst, TyCoVar)
-- | Type substitution, see zipTvSubst
substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type]
-- | Substitute within several Types disabling the sanity checks.
-- The problems that the sanity checks in substTys catch are described in
-- Note [The substitution invariant]. The goal of #11371 is to migrate
-- all the calls of substTysUnchecked to substTys and remove this
-- function. Please don't use in new code.
substTysUnchecked :: TCvSubst -> [Type] -> [Type]
-- | Substitute within several Types The substitution has to satisfy
-- the invariants described in Note [The substitution invariant].
substTys :: HasCallStack => TCvSubst -> [Type] -> [Type]
-- | Type substitution, see zipTvSubst. Disables sanity checks. The
-- problems that the sanity checks in substTy catch are described in Note
-- [The substitution invariant]. The goal of #11371 is to migrate all the
-- calls of substTyUnchecked to substTy and remove this function. Please
-- don't use in new code.
substTyWithUnchecked :: [TyVar] -> [Type] -> Type -> Type
-- | Type substitution, see zipTvSubst
substTyWith :: HasCallStack => [TyVar] -> [Type] -> Type -> Type
substTyVars :: TCvSubst -> [TyVar] -> [Type]
substTyVarBndrs :: HasCallStack => TCvSubst -> [TyVar] -> (TCvSubst, [TyVar])
substTyVarBndr :: HasCallStack => TCvSubst -> TyVar -> (TCvSubst, TyVar)
substTyVar :: TCvSubst -> TyVar -> Type
-- | Substitute within a Type disabling the sanity checks. The
-- problems that the sanity checks in substTy catch are described in Note
-- [The substitution invariant]. The goal of #11371 is to migrate all the
-- calls of substTyUnchecked to substTy and remove this function. Please
-- don't use in new code.
substTyUnchecked :: TCvSubst -> Type -> Type
substTyCoBndr :: TCvSubst -> TyCoBinder -> (TCvSubst, TyCoBinder)
-- | Substitute within a Type after adding the free variables of the
-- type to the in-scope set. This is useful for the case when the free
-- variables aren't already in the in-scope set or easily available. See
-- also Note [The substitution invariant].
substTyAddInScope :: TCvSubst -> Type -> Type
-- | Substitute within a Type The substitution has to satisfy the
-- invariants described in Note [The substitution invariant].
substTy :: HasCallStack => TCvSubst -> Type -> Type
-- | Substitute within a ThetaType disabling the sanity checks. The
-- problems that the sanity checks in substTys catch are described in
-- Note [The substitution invariant]. The goal of #11371 is to migrate
-- all the calls of substThetaUnchecked to substTheta and remove this
-- function. Please don't use in new code.
substThetaUnchecked :: TCvSubst -> ThetaType -> ThetaType
-- | Substitute within a ThetaType The substitution has to satisfy
-- the invariants described in Note [The substitution invariant].
substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType
substScaledTysUnchecked :: TCvSubst -> [Scaled Type] -> [Scaled Type]
substScaledTys :: HasCallStack => TCvSubst -> [Scaled Type] -> [Scaled Type]
substScaledTyUnchecked :: HasCallStack => TCvSubst -> Scaled Type -> Scaled Type
substScaledTy :: HasCallStack => TCvSubst -> Scaled Type -> Scaled Type
-- | Coercion substitution, see zipTvSubst. Disables sanity checks.
-- The problems that the sanity checks in substCo catch are described in
-- Note [The substitution invariant]. The goal of #11371 is to migrate
-- all the calls of substCoUnchecked to substCo and remove this function.
-- Please don't use in new code.
substCoWithUnchecked :: [TyVar] -> [Type] -> Coercion -> Coercion
-- | Substitute within a Coercion disabling sanity checks. The
-- problems that the sanity checks in substCo catch are described in Note
-- [The substitution invariant]. The goal of #11371 is to migrate all the
-- calls of substCoUnchecked to substCo and remove this function. Please
-- don't use in new code.
substCoUnchecked :: TCvSubst -> Coercion -> Coercion
setTvSubstEnv :: TCvSubst -> TvSubstEnv -> TCvSubst
notElemTCvSubst :: Var -> TCvSubst -> Bool
-- | Generates the in-scope set for the TCvSubst from the types in
-- the incoming environment. No CoVars, please!
mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst
mkTCvSubst :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> TCvSubst
mkEmptyTCvSubst :: InScopeSet -> TCvSubst
lookupTyVar :: TCvSubst -> TyVar -> Maybe Type
isInScope :: Var -> TCvSubst -> Bool
isEmptyTCvSubst :: TCvSubst -> Bool
getTvSubstEnv :: TCvSubst -> TvSubstEnv
-- | Returns the free variables of the types in the range of a substitution
-- as a non-deterministic set.
getTCvSubstRangeFVs :: TCvSubst -> VarSet
getTCvInScope :: TCvSubst -> InScopeSet
extendTvSubstWithClone :: TCvSubst -> TyVar -> TyVar -> TCvSubst
extendTvSubstList :: TCvSubst -> [Var] -> [Type] -> TCvSubst
extendTvSubstBinderAndInScope :: TCvSubst -> TyCoBinder -> Type -> TCvSubst
extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
extendTvSubst :: TCvSubst -> TyVar -> Type -> TCvSubst
extendTCvSubstWithClone :: TCvSubst -> TyCoVar -> TyCoVar -> TCvSubst
extendTCvSubstList :: TCvSubst -> [Var] -> [Type] -> TCvSubst
extendTCvSubst :: TCvSubst -> TyCoVar -> Type -> TCvSubst
extendTCvInScopeSet :: TCvSubst -> VarSet -> TCvSubst
extendTCvInScopeList :: TCvSubst -> [Var] -> TCvSubst
extendTCvInScope :: TCvSubst -> Var -> TCvSubst
extendCvSubst :: TCvSubst -> CoVar -> Coercion -> TCvSubst
emptyTvSubstEnv :: TvSubstEnv
emptyTCvSubst :: TCvSubst
-- | (compose env1 env2)(x) is env1(env2(x)); i.e. apply
-- env2 then env1. It assumes that both are idempotent.
-- Typically, env1 is the refinement to a base substitution
-- env2
composeTCvSubstEnv :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv)
-- | Composes two substitutions, applying the second one provided first,
-- like in function composition.
composeTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar])
cloneTyVarBndr :: TCvSubst -> TyVar -> Unique -> (TCvSubst, TyVar)
-- | This tidies up a type for printing in an error message, or in an
-- interface file.
--
-- It doesn't change the uniques at all, just the print names.
tidyVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
tidyVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
-- | Tidy a list of Types
--
-- See Note [Strictness in tidyType and friends]
tidyTypes :: TidyEnv -> [Type] -> [Type]
-- | Tidy a Type
--
-- See Note [Strictness in tidyType and friends]
tidyType :: TidyEnv -> Type -> Type
tidyTyCoVarOcc :: TidyEnv -> TyCoVar -> TyCoVar
tidyTyCoVarBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis])
tidyTyCoVarBinder :: TidyEnv -> VarBndr TyCoVar vis -> (TidyEnv, VarBndr TyCoVar vis)
-- | Calls tidyType on a top-level type (i.e. with an empty tidying
-- environment)
tidyTopType :: Type -> Type
-- | Grabs the free type variables, tidies them and then uses
-- tidyType to work over the type itself
tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type])
tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type)
tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
-- | Treat a new TyCoVar as a binder, and give it a fresh tidy name
-- using the environment if one has not already been allocated. See also
-- tidyVarBndr
tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind)
tidyKind :: TidyEnv -> Kind -> Kind
-- | Add the free TyVars to the env in tidy form, so that we can
-- tidy the type they are free in
tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
-- | Get the free vars of types in scoped order
tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar]
tyCoVarsOfTypes :: [Type] -> TyCoVarSet
-- | Get the free vars of a type in scoped order
tyCoVarsOfTypeWellScoped :: Type -> [TyVar]
-- | tyCoFVsOfType that returns free variables of a type in a
-- deterministic set. For explanation of why using VarSet is not
-- deterministic see Note [Deterministic FV] in GHC.Utils.FV.
tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet
tyCoVarsOfType :: Type -> TyCoVarSet
tyCoFVsVarBndrs :: [Var] -> FV -> FV
tyCoFVsVarBndr :: Var -> FV -> FV
-- | The worker for tyCoFVsOfType and tyCoFVsOfTypeList.
-- The previous implementation used unionVarSet which is O(n+m)
-- and can make the function quadratic. It's exported, so that it can be
-- composed with other functions that compute free variables. See Note
-- [FV naming conventions] in GHC.Utils.FV.
--
-- Eta-expanded because that makes it run faster (apparently) See Note
-- [FV eta expansion] in GHC.Utils.FV for explanation.
tyCoFVsOfType :: Type -> FV
tyCoFVsBndr :: TyCoVarBinder -> FV -> FV
-- | Do a topological sort on a list of tyvars, so that binders occur
-- before occurrences E.g. given [ a::k, k::*, b::k ] it'll return a
-- well-scoped list [ k::*, a::k, b::k ]
--
-- This is a deterministic sorting operation (that is, doesn't depend on
-- Uniques).
--
-- It is also meant to be stable: that is, variables should not be
-- reordered unnecessarily. This is specified in Note [ScopedSort] See
-- also Note [Ordering of implicit variables] in GHC.Rename.HsType
scopedSort :: [TyCoVar] -> [TyCoVar]
noFreeVarsOfType :: Type -> Bool
coVarsOfTypes :: [Type] -> CoVarSet
coVarsOfType :: Type -> CoVarSet
-- | Add the kind variables free in the kinds of the tyvars in the given
-- set. Returns a deterministically ordered list.
closeOverKindsList :: [TyVar] -> [TyVar]
-- | Add the kind variables free in the kinds of the tyvars in the given
-- set. Returns a deterministic set.
closeOverKindsDSet :: DTyVarSet -> DTyVarSet
closeOverKinds :: TyCoVarSet -> TyCoVarSet
anyFreeVarsOfTypes :: (TyCoVar -> Bool) -> [Type] -> Bool
anyFreeVarsOfType :: (TyCoVar -> Bool) -> Type -> Bool
data TyCoFolder env a
TyCoFolder :: (Type -> Maybe Type) -> (env -> TyVar -> a) -> (env -> CoVar -> a) -> (env -> CoercionHole -> a) -> (env -> TyCoVar -> ArgFlag -> env) -> TyCoFolder env a
[tcf_view] :: TyCoFolder env a -> Type -> Maybe Type
[tcf_tyvar] :: TyCoFolder env a -> env -> TyVar -> a
[tcf_covar] :: TyCoFolder env a -> env -> CoVar -> a
-- | What to do with coercion holes. See Note [Coercion holes] in
-- GHC.Core.TyCo.Rep.
[tcf_hole] :: TyCoFolder env a -> env -> CoercionHole -> a
-- | The returned env is used in the extended scope
[tcf_tycobinder] :: TyCoFolder env a -> env -> TyCoVar -> ArgFlag -> env
-- | A type labeled KnotTied might have knot-tied tycons in it. See
-- Note [Type checking recursive type and class declarations] in
-- GHC.Tc.TyCl
type KnotTied ty = ty
-- | The key representation of types within the compiler
type KindOrType = Type
-- | A coercion to be filled in by the type-checker. See Note [Coercion
-- holes]
data CoercionHole
typeSize :: Type -> Int
mkVisFunTysMany :: [Type] -> Type -> Type
-- | Make nested arrow types
mkVisFunTys :: [Scaled Type] -> Type -> Type
-- | Special, common, case: Arrow type with mult Many
mkVisFunTyMany :: Type -> Type -> Type
infixr 3 `mkVisFunTyMany`
mkVisFunTy :: Mult -> Type -> Type -> Type
infixr 3 `mkVisFunTy`
mkTyVarTys :: [TyVar] -> [Type]
mkTyVarTy :: TyVar -> Type
mkPiTys :: [TyCoBinder] -> Type -> Type
mkPiTy :: TyCoBinder -> Type -> Type
mkInvisFunTysMany :: [Type] -> Type -> Type
mkInvisFunTyMany :: Type -> Type -> Type
infixr 3 `mkInvisFunTyMany`
mkInvisFunTy :: Mult -> Type -> Type -> Type
infixr 3 `mkInvisFunTy`
-- | Wraps foralls over the type using the provided InvisTVBinders
-- from left to right
mkInvisForAllTys :: [InvisTVBinder] -> Type -> Type
mkFunTy :: AnonArgFlag -> Mult -> Type -> Type -> Type
infixr 3 `mkFunTy`
-- | Wraps foralls over the type using the provided TyCoVars from
-- left to right
mkForAllTys :: [TyCoVarBinder] -> Type -> Type
-- | Does this binder bind a visible argument?
isVisibleBinder :: TyCoBinder -> Bool
isNamedBinder :: TyCoBinder -> Bool
-- | Does this binder bind an invisible argument?
isInvisibleBinder :: TyCoBinder -> Bool
foldTyCo :: Monoid a => TyCoFolder env a -> env -> (Type -> a, [Type] -> a, Coercion -> a, [Coercion] -> a)
isLiftedTypeKindTyConName :: Name -> Bool
-- | Returns True for the TyCon of the Constraint
-- kind.
isConstraintKindCon :: TyCon -> Bool
zipName :: Name
zipIdKey :: Unique
wordTyConKey :: Unique
wordPrimTyConKey :: Unique
wordDataConKey :: Unique
word8X64PrimTyConKey :: Unique
word8X32PrimTyConKey :: Unique
word8X16PrimTyConKey :: Unique
word8TyConName :: Name
word8TyConKey :: Unique
word8PrimTyConKey :: Unique
word8DataConKey :: Unique
word64X8PrimTyConKey :: Unique
word64X4PrimTyConKey :: Unique
word64X2PrimTyConKey :: Unique
word64TyConName :: Name
word64TyConKey :: Unique
word64PrimTyConKey :: Unique
word32X8PrimTyConKey :: Unique
word32X4PrimTyConKey :: Unique
word32X16PrimTyConKey :: Unique
word32TyConName :: Name
word32TyConKey :: Unique
word32PrimTyConKey :: Unique
word16X8PrimTyConKey :: Unique
word16X32PrimTyConKey :: Unique
word16X16PrimTyConKey :: Unique
word16TyConName :: Name
word16TyConKey :: Unique
word16PrimTyConKey :: Unique
wildCardName :: Name
wildCardKey :: Unique
weakPrimTyConKey :: Unique
voidPrimIdKey :: Unique
voidArgIdKey :: Unique
vecRepDataConKey :: Unique
vecElemTyConKey :: Unique
vecElemDataConKeys :: [Unique]
vecCountTyConKey :: Unique
vecCountDataConKeys :: [Unique]
varQual_RDR :: Module -> FastString -> RdrName
varQual :: Module -> FastString -> Unique -> Name
v1TyConName :: Name
v1TyConKey :: Unique
unsafeReflDataConName :: Name
unsafeReflDataConKey :: Unique
unsafeRangeSize_RDR :: RdrName
unsafeIndex_RDR :: RdrName
unsafeEqualityTyConName :: Name
unsafeEqualityTyConKey :: Unique
unsafeEqualityProofName :: Name
unsafeEqualityProofIdKey :: Unique
unsafeCoercePrimName :: Name
unsafeCoercePrimIdKey :: Unique
unrestrictedFunTyConKey :: Unique
unpackCString_RDR :: RdrName
unpackCStringUtf8_RDR :: RdrName
unpackCStringUtf8Name :: Name
unpackCStringUtf8IdKey :: Unique
unpackCStringName :: Name
unpackCStringIdKey :: Unique
unpackCStringFoldr_RDR :: RdrName
unpackCStringFoldrUtf8_RDR :: RdrName
unpackCStringFoldrUtf8Name :: Name
unpackCStringFoldrUtf8IdKey :: Unique
unpackCStringFoldrName :: Name
unpackCStringFoldrIdKey :: Unique
unpackCStringAppendIdKey :: Unique
unliftedTypeKindTyConKey :: Unique
unliftedRepTyConKey :: Unique
unliftedDataConKey :: Unique
unknownTyConKey :: Unique
unknown3TyConKey :: Unique
unknown2TyConKey :: Unique
unknown1TyConKey :: Unique
unboundKey :: Unique
unRec1_RDR :: RdrName
unPar1_RDR :: RdrName
unK1_RDR :: RdrName
unComp1_RDR :: RdrName
uWordTyConName :: Name
uWordTyConKey :: Unique
uWordHash_RDR :: RdrName
uWordDataCon_RDR :: RdrName
uRecTyConName :: Name
uRecTyConKey :: Unique
uNSAFE_COERCE :: Module
uIntTyConName :: Name
uIntTyConKey :: Unique
uIntHash_RDR :: RdrName
uIntDataCon_RDR :: RdrName
uFloatTyConName :: Name
uFloatTyConKey :: Unique
uFloatHash_RDR :: RdrName
uFloatDataCon_RDR :: RdrName
uDoubleTyConName :: Name
uDoubleTyConKey :: Unique
uDoubleHash_RDR :: RdrName
uDoubleDataCon_RDR :: RdrName
uCharTyConName :: Name
uCharTyConKey :: Unique
uCharHash_RDR :: RdrName
uCharDataCon_RDR :: RdrName
uAddrTyConName :: Name
uAddrTyConKey :: Unique
uAddrHash_RDR :: RdrName
uAddrDataCon_RDR :: RdrName
u1TyConName :: Name
u1TyConKey :: Unique
u1DataCon_RDR :: RdrName
typeableClassName :: Name
typeableClassKey :: Unique
typeUnconsSymbolTyFamNameKey :: Unique
typeSymbolTypeRepName :: Name
typeSymbolTypeRepKey :: Unique
typeSymbolKindConNameKey :: Unique
typeSymbolCmpTyFamNameKey :: Unique
typeSymbolAppendFamNameKey :: Unique
typeRepTyConName :: Name
typeRepTyConKey :: Unique
typeRepIdName :: Name
typeRepIdKey :: Unique
typeNatTypeRepName :: Name
typeNatTypeRepKey :: Unique
typeNatToCharTyFamNameKey :: Unique
typeNatSubTyFamNameKey :: Unique
typeNatMulTyFamNameKey :: Unique
typeNatModTyFamNameKey :: Unique
typeNatLogTyFamNameKey :: Unique
typeNatExpTyFamNameKey :: Unique
typeNatDivTyFamNameKey :: Unique
typeNatCmpTyFamNameKey :: Unique
typeNatAddTyFamNameKey :: Unique
typeLitSymbolDataConName :: Name
typeLitSymbolDataConKey :: Unique
typeLitSortTyConName :: Name
typeLitSortTyConKey :: Unique
typeLitNatDataConName :: Name
typeLitNatDataConKey :: Unique
typeLitCharDataConName :: Name
typeLitCharDataConKey :: Unique
typeLeqCharTyFamNameKey :: Unique
typeErrorVAppendDataConName :: Name
typeErrorVAppendDataConKey :: Unique
typeErrorTextDataConName :: Name
typeErrorTextDataConKey :: Unique
typeErrorShowTypeDataConName :: Name
typeErrorShowTypeDataConKey :: Unique
typeErrorIdKey :: Unique
typeErrorAppendDataConName :: Name
typeErrorAppendDataConKey :: Unique
typeConsSymbolTyFamNameKey :: Unique
typeConKey :: Unique
typeCharTypeRepName :: Name
typeCharTypeRepKey :: Unique
typeCharToNatTyFamNameKey :: Unique
typeCharKindConNameKey :: Unique
typeCharCmpTyFamNameKey :: Unique
tupleRepDataConKey :: Unique
trueDataConKey :: Unique
traverse_RDR :: RdrName
traversableClassName :: Name
traversableClassKey :: Unique
traceName :: Name
traceKey :: Unique
trTyConTyConName :: Name
trTyConTyConKey :: Unique
trTyConDataConName :: Name
trTyConDataConKey :: Unique
trTYPEKey :: Unique
trTYPE'PtrRepLiftedKey :: Unique
trRuntimeRepKey :: Unique
trNameTyConName :: Name
trNameTyConKey :: Unique
trNameSDataConName :: Name
trNameSDataConKey :: Unique
trNameDDataConName :: Name
trNameDDataConKey :: Unique
trModuleTyConName :: Name
trModuleTyConKey :: Unique
trModuleDataConName :: Name
trModuleDataConKey :: Unique
trLiftedRepKey :: Unique
trGhcPrimModuleName :: Name
trGhcPrimModuleKey :: Unique
tr'PtrRepLiftedKey :: Unique
to_RDR :: RdrName
toRational_RDR :: RdrName
toRationalName :: Name
toRationalClassOpKey :: Unique
toList_RDR :: RdrName
toListName :: Name
toListClassOpKey :: Unique
toInteger_RDR :: RdrName
toIntegerName :: Name
toIntegerClassOpKey :: Unique
toEnum_RDR :: RdrName
toDynName :: Name
toDynIdKey :: Unique
toAnnotationWrapperName :: Name
toAnnotationWrapperIdKey :: Unique
to1_RDR :: RdrName
times_RDR :: RdrName
threadIdPrimTyConKey :: Unique
thenMName :: Name
thenMClassOpKey :: Unique
thenIOName :: Name
thenIOIdKey :: Unique
thenAName :: Name
thenAClassOpKey :: Unique
tcQual_RDR :: Module -> FastString -> RdrName
tcQual :: Module -> FastString -> Unique -> Name
tYPETyConKey :: Unique
tYPEABLE_INTERNAL :: Module
tYPEABLE :: Module
tVarPrimTyConKey :: Unique
symbol_RDR :: RdrName
sumTyConName :: Name
sumTyConKey :: Unique
sumRepDataConKey :: Unique
succ_RDR :: RdrName
stringTyConKey :: Unique
step_RDR :: RdrName
staticPtrTyConName :: Name
staticPtrTyConKey :: Unique
staticPtrInfoTyConName :: Name
staticPtrInfoTyConKey :: Unique
staticPtrInfoDataConName :: Name
staticPtrInfoDataConKey :: Unique
staticPtrDataConName :: Name
staticPtrDataConKey :: Unique
statePrimTyConKey :: Unique
starKindRepName :: Name
starKindRepKey :: Unique
starArrStarKindRepName :: Name
starArrStarKindRepKey :: Unique
starArrStarArrStarKindRepName :: Name
starArrStarArrStarKindRepKey :: Unique
standardClassKeys :: [Unique]
stablePtrTyConName :: Name
stablePtrTyConKey :: Unique
stablePtrPrimTyConKey :: Unique
stableNameTyConKey :: Unique
stableNamePrimTyConKey :: Unique
stableNameDataConKey :: Unique
srcLocDataConName :: Name
srcLocDataConKey :: Unique
specTyConName :: Name
specTyConKey :: Unique
sourceUnpackDataConName :: Name
sourceUnpackDataConKey :: Unique
sourceStrictDataConName :: Name
sourceStrictDataConKey :: Unique
sourceNoUnpackDataConName :: Name
sourceNoUnpackDataConKey :: Unique
sourceLazyDataConName :: Name
sourceLazyDataConKey :: Unique
someTypeRepTyConName :: Name
someTypeRepTyConKey :: Unique
someTypeRepDataConName :: Name
someTypeRepDataConKey :: Unique
sndName :: Name
sndIdKey :: Unique
smallMutableArrayPrimTyConKey :: Unique
smallArrayPrimTyConKey :: Unique
shows_RDR :: RdrName
showsPrec_RDR :: RdrName
showString_RDR :: RdrName
showSpace_RDR :: RdrName
showParen_RDR :: RdrName
showCommaSpace_RDR :: RdrName
showClassName :: Name
showClassKey :: Unique
setFieldName :: Name
setFieldClassOpKey :: Unique
seqIdKey :: Unique
semigroupClassName :: Name
semigroupClassKey :: Unique
selectorClassName :: Name
selectorClassKey :: Unique
selName_RDR :: RdrName
sappendName :: Name
sappendClassOpKey :: Unique
sYSTEM_IO :: Module
sTyConName :: Name
sTyConKey :: Unique
s1TyConName :: Name
s1TyConKey :: Unique
runtimeRepTyConKey :: Unique
runtimeRepSimpleDataConKeys :: [Unique]
runtimeErrorIdKey :: Unique
runRWName :: Name
runRWKey :: Unique
runMainKey :: Unique
runMainIOName :: Name
rootMainKey :: Unique
right_RDR :: RdrName
rightSectionKey :: Unique
rightDataConName :: Name
rightDataConKey :: Unique
rightAssociativeDataConName :: Name
rightAssociativeDataConKey :: Unique
rightAssocDataCon_RDR :: RdrName
returnM_RDR :: RdrName
returnMName :: Name
returnMClassOpKey :: Unique
returnIO_RDR :: RdrName
returnIOName :: Name
returnIOIdKey :: Unique
reset_RDR :: RdrName
replace_RDR :: RdrName
repTyConName :: Name
repTyConKey :: Unique
rep1TyConName :: Name
rep1TyConKey :: Unique
recSelErrorIdKey :: Unique
recConErrorIdKey :: Unique
rec1TyConName :: Name
rec1TyConKey :: Unique
rec1DataCon_RDR :: RdrName
rec0TyConName :: Name
rec0TyConKey :: Unique
realWorldTyConKey :: Unique
realWorldPrimIdKey :: Unique
realToFracName :: Name
realToFracIdKey :: Unique
realFracClassName :: Name
realFracClassKey :: Unique
realFloatClassName :: Name
realFloatClassKey :: Unique
realClassName :: Name
realClassKey :: Unique
readSymField_RDR :: RdrName
readPrec_RDR :: RdrName
readList_RDR :: RdrName
readListPrec_RDR :: RdrName
readListPrecDefault_RDR :: RdrName
readListDefault_RDR :: RdrName
readField_RDR :: RdrName
readFieldHash_RDR :: RdrName
readClassName :: Name
readClassKey :: Unique
rationalTyConName :: Name
rationalTyConKey :: Unique
rationalToFloatName :: Name
rationalToFloatIdKey :: Unique
rationalToDoubleName :: Name
rationalToDoubleIdKey :: Unique
ratioTyConName :: Name
ratioTyConKey :: Unique
ratioDataCon_RDR :: RdrName
ratioDataConName :: Name
ratioDataConKey :: Unique
range_RDR :: RdrName
randomGenClassName :: Name
randomGenClassKey :: Unique
randomClassName :: Name
randomClassKey :: Unique
raiseUnderflowIdKey :: Unique
raiseOverflowIdKey :: Unique
raiseDivZeroIdKey :: Unique
rTyConName :: Name
rTyConKey :: Unique
rOOT_MAIN :: Module
rEAD_PREC :: Module
rANDOM :: Module
r1DataCon_RDR :: RdrName
pushCallStackName :: Name
pushCallStackKey :: Unique
pure_RDR :: RdrName
pureAName :: Name
pureAClassOpKey :: Unique
punc_RDR :: RdrName
ptrTyConName :: Name
ptrTyConKey :: Unique
proxyPrimTyConKey :: Unique
proxyHashKey :: Unique
prodTyConName :: Name
prodTyConKey :: Unique
prodDataCon_RDR :: RdrName
printName :: Name
printIdKey :: Unique
pretendNameIsInScope :: Name -> Bool
prefixIDataConName :: Name
prefixIDataConKey :: Unique
prefixDataCon_RDR :: RdrName
pred_RDR :: RdrName
prec_RDR :: RdrName
plus_RDR :: RdrName
pluginTyConName :: Name
pluginTyConKey :: Unique
pfail_RDR :: RdrName
patErrorIdKey :: Unique
parens_RDR :: RdrName
par1TyConName :: Name
par1TyConKey :: Unique
par1DataCon_RDR :: RdrName
packageName_RDR :: RdrName
pRELUDE_NAME :: ModuleName
pRELUDE :: Module
pLUGINS :: Module
otherwiseIdName :: Name
otherwiseIdKey :: Unique
orderingTyConName :: Name
orderingTyConKey :: Unique
ordLTDataConName :: Name
ordLTDataConKey :: Unique
ordGTDataConName :: Name
ordGTDataConKey :: Unique
ordEQDataConName :: Name
ordEQDataConKey :: Unique
ordClass_RDR :: RdrName
ordClassName :: Name
ordClassKey :: Unique
opaqueTyConName :: Name
opaqueTyConKey :: Unique
oneShotKey :: Unique
oneDataConKey :: Unique
numericClassKeys :: [Unique]
numClass_RDR :: RdrName
numClassName :: Name
numClassKey :: Unique
null_RDR :: RdrName
nullAddrIdKey :: Unique
nothingDataConKey :: Unique
not_RDR :: RdrName
notAssociativeDataConName :: Name
notAssociativeDataConKey :: Unique
notAssocDataCon_RDR :: RdrName
nonExhaustiveGuardsErrorIdKey :: Unique
nonEmptyTyConKey :: Unique
nonEmptyDataConKey :: Unique
noinlineIdKey :: Unique
noSourceUnpackednessDataConName :: Name
noSourceUnpackednessDataConKey :: Unique
noSourceStrictnessDataConName :: Name
noSourceStrictnessDataConKey :: Unique
noSelTyConName :: Name
noSelTyConKey :: Unique
noMethodBindingErrorIdKey :: Unique
nilDataConKey :: Unique
newStablePtr_RDR :: RdrName
newStablePtrName :: Name
newStablePtrIdKey :: Unique
negateName :: Name
negateClassOpKey :: Unique
naturalXorName :: Name
naturalXorIdKey :: Unique
naturalTyConKey :: Unique
naturalToWordName :: Name
naturalToWordIdKey :: Unique
naturalToWordClampName :: Name
naturalToWordClampIdKey :: Unique
naturalToFloatName :: Name
naturalToFloatIdKey :: Unique
naturalToDoubleName :: Name
naturalToDoubleIdKey :: Unique
naturalTestBitName :: Name
naturalTestBitIdKey :: Unique
naturalSubUnsafeName :: Name
naturalSubUnsafeIdKey :: Unique
naturalSubThrowName :: Name
naturalSubThrowIdKey :: Unique
naturalSubName :: Name
naturalSubIdKey :: Unique
naturalSizeInBaseName :: Name
naturalSizeInBaseIdKey :: Unique
naturalSignumName :: Name
naturalSignumIdKey :: Unique
naturalShiftRName :: Name
naturalShiftRIdKey :: Unique
naturalShiftLName :: Name
naturalShiftLIdKey :: Unique
naturalRemName :: Name
naturalRemIdKey :: Unique
naturalQuotRemName :: Name
naturalQuotRemIdKey :: Unique
naturalQuotName :: Name
naturalQuotIdKey :: Unique
naturalPowModName :: Name
naturalPowModIdKey :: Unique
naturalPopCountName :: Name
naturalPopCountIdKey :: Unique
naturalOrName :: Name
naturalOrIdKey :: Unique
naturalNegateName :: Name
naturalNegateIdKey :: Unique
naturalNeName :: Name
naturalNeIdKey :: Unique
naturalNSDataConKey :: Unique
naturalNBDataConKey :: Unique
naturalMulName :: Name
naturalMulIdKey :: Unique
naturalLtName :: Name
naturalLtIdKey :: Unique
naturalLogBaseWordName :: Name
naturalLogBaseWordIdKey :: Unique
naturalLogBaseName :: Name
naturalLogBaseIdKey :: Unique
naturalLog2Name :: Name
naturalLog2IdKey :: Unique
naturalLeName :: Name
naturalLeIdKey :: Unique
naturalLcmName :: Name
naturalLcmIdKey :: Unique
naturalGtName :: Name
naturalGtIdKey :: Unique
naturalGeName :: Name
naturalGeIdKey :: Unique
naturalGcdName :: Name
naturalGcdIdKey :: Unique
naturalEqName :: Name
naturalEqIdKey :: Unique
naturalCompareName :: Name
naturalCompareIdKey :: Unique
naturalBitName :: Name
naturalBitIdKey :: Unique
naturalAndNotName :: Name
naturalAndNotIdKey :: Unique
naturalAndName :: Name
naturalAndIdKey :: Unique
naturalAddName :: Name
naturalAddIdKey :: Unique
mzipName :: Name
mzipIdKey :: Unique
mutableByteArrayPrimTyConKey :: Unique
mutableArrayPrimTyConKey :: Unique
mutableArrayArrayPrimTyConKey :: Unique
mutVarPrimTyConKey :: Unique
multiplicityTyConKey :: Unique
multMulTyConKey :: Unique
monoidClassName :: Name
monoidClassKey :: Unique
monadPlusClassName :: Name
monadPlusClassKey :: Unique
monadFixClassName :: Name
monadFixClassKey :: Unique
monadFailClassName :: Name
monadFailClassKey :: Unique
monadClass_RDR :: RdrName
monadClassName :: Name
monadClassKey :: Unique
moduleName_RDR :: RdrName
modIntName :: Name
modIntIdKey :: Unique
mk_known_key_name :: NameSpace -> Module -> FastString -> Unique -> Name
mkUnboundName :: OccName -> Name
mkTyConKey :: Unique
mkTrTypeName :: Name
mkTrTypeKey :: Unique
mkTrFunName :: Name
mkTrFunKey :: Unique
mkTrConName :: Name
mkTrConKey :: Unique
mkTrAppName :: Name
mkTrAppKey :: Unique
mkThisGhcModule_ :: ModuleName -> Module
mkThisGhcModule :: FastString -> Module
mkRationalBase2Name :: Name
mkRationalBase2IdKey :: Unique
mkRationalBase10Name :: Name
mkRationalBase10IdKey :: Unique
mkPrimModule :: FastString -> Module
mkMainModule_ :: ModuleName -> Module
mkMainModule :: FastString -> Module
mkInteractiveModule :: Int -> Module
mkBignumModule :: FastString -> Module
mkBaseModule_ :: ModuleName -> Module
mkBaseModule :: FastString -> Module
minus_RDR :: RdrName
minusName :: Name
minusClassOpKey :: Unique
minBound_RDR :: RdrName
mfixName :: Name
mfixIdKey :: Unique
metaSelDataConName :: Name
metaSelDataConKey :: Unique
metaDataDataConName :: Name
metaDataDataConKey :: Unique
metaConsDataConName :: Name
metaConsDataConKey :: Unique
mempty_RDR :: RdrName
memptyName :: Name
memptyClassOpKey :: Unique
mconcatName :: Name
mconcatClassOpKey :: Unique
maybeTyConKey :: Unique
maxBound_RDR :: RdrName
mappend_RDR :: RdrName
mappendName :: Name
mappendClassOpKey :: Unique
map_RDR :: RdrName
mapName :: Name
mapIdKey :: Unique
manyDataConKey :: Unique
makeStaticName :: Name
makeStaticKey :: Unique
main_RDR_Unqual :: RdrName
magicDictKey :: Unique
mVarPrimTyConKey :: Unique
mONAD_ZIP :: Module
mONAD_FIX :: Module
mONAD_FAIL :: Module
mONAD :: Module
mAIN_NAME :: ModuleName
m1TyConName :: Name
m1TyConKey :: Unique
m1DataCon_RDR :: RdrName
lt_RDR :: RdrName
ltTag_RDR :: RdrName
loopAName :: Name
loopAIdKey :: Unique
listTyConKey :: Unique
liftedTypeKindTyConKey :: Unique
liftedRepTyConKey :: Unique
liftedDataConKey :: Unique
liftMName :: Name
liftMIdKey :: Unique
liftA2_RDR :: RdrName
lexP_RDR :: RdrName
levityTyConKey :: Unique
left_RDR :: RdrName
leftSectionKey :: Unique
leftDataConName :: Name
leftDataConKey :: Unique
leftAssociativeDataConName :: Name
leftAssociativeDataConKey :: Unique
leftAssocDataCon_RDR :: RdrName
le_RDR :: RdrName
lazyIdKey :: Unique
lEX :: Module
l1DataCon_RDR :: RdrName
knownSymbolClassNameKey :: Unique
knownSymbolClassName :: Name
knownNatClassNameKey :: Unique
knownNatClassName :: Name
knownCharClassNameKey :: Unique
knownCharClassName :: Name
kindRepVarDataConName :: Name
kindRepVarDataConKey :: Unique
kindRepTypeLitSDataConName :: Name
kindRepTypeLitSDataConKey :: Unique
kindRepTypeLitDDataConName :: Name
kindRepTypeLitDDataConKey :: Unique
kindRepTyConName :: Name
kindRepTyConKey :: Unique
kindRepTyConAppDataConName :: Name
kindRepTyConAppDataConKey :: Unique
kindRepTYPEDataConName :: Name
kindRepTYPEDataConKey :: Unique
kindRepFunDataConName :: Name
kindRepFunDataConKey :: Unique
kindRepAppDataConName :: Name
kindRepAppDataConKey :: Unique
kindConKey :: Unique
k1TyConName :: Name
k1TyConKey :: Unique
k1DataCon_RDR :: RdrName
justDataConKey :: Unique
joinMName :: Name
joinMIdKey :: Unique
ixClassName :: Name
ixClassKey :: Unique
itName :: Unique -> SrcSpan -> Name
isUnboundName :: Name -> Bool
isStringClassName :: Name
isStringClassKey :: Unique
isNewtypeName_RDR :: RdrName
isListClassName :: Name
isListClassKey :: Unique
ipClassName :: Name
ipClassKey :: Unique
ioTyConName :: Name
ioTyConKey :: Unique
ioPortPrimTyConKey :: Unique
ioDataCon_RDR :: RdrName
ioDataConName :: Name
ioDataConKey :: Unique
interactiveClassNames :: [Name]
interactiveClassKeys :: [Unique]
integralClassName :: Name
integralClassKey :: Unique
integerXorName :: Name
integerXorIdKey :: Unique
integerTyConKey :: Unique
integerToWordName :: Name
integerToWordIdKey :: Unique
integerToWord64Name :: Name
integerToWord64IdKey :: Unique
integerToNaturalThrowName :: Name
integerToNaturalThrowIdKey :: Unique
integerToNaturalName :: Name
integerToNaturalIdKey :: Unique
integerToNaturalClampName :: Name
integerToNaturalClampIdKey :: Unique
integerToIntName :: Name
integerToIntIdKey :: Unique
integerToInt64Name :: Name
integerToInt64IdKey :: Unique
integerToFloatName :: Name
integerToFloatIdKey :: Unique
integerToDoubleName :: Name
integerToDoubleIdKey :: Unique
integerTestBitName :: Name
integerTestBitIdKey :: Unique
integerSubName :: Name
integerSubIdKey :: Unique
integerSignumName :: Name
integerSignumIdKey :: Unique
integerShiftRName :: Name
integerShiftRIdKey :: Unique
integerShiftLName :: Name
integerShiftLIdKey :: Unique
integerRemName :: Name
integerRemIdKey :: Unique
integerQuotRemName :: Name
integerQuotRemIdKey :: Unique
integerQuotName :: Name
integerQuotIdKey :: Unique
integerPopCountName :: Name
integerPopCountIdKey :: Unique
integerOrName :: Name
integerOrIdKey :: Unique
integerNegateName :: Name
integerNegateIdKey :: Unique
integerNeName :: Name
integerNeIdKey :: Unique
integerMul_RDR :: RdrName
integerMulName :: Name
integerMulIdKey :: Unique
integerModName :: Name
integerModIdKey :: Unique
integerLtName :: Name
integerLtIdKey :: Unique
integerLeName :: Name
integerLeIdKey :: Unique
integerLcmName :: Name
integerLcmIdKey :: Unique
integerISDataConKey :: Unique
integerIPDataConKey :: Unique
integerINDataConKey :: Unique
integerGtName :: Name
integerGtIdKey :: Unique
integerGeName :: Name
integerGeIdKey :: Unique
integerGcdName :: Name
integerGcdIdKey :: Unique
integerFromWordName :: Name
integerFromWordIdKey :: Unique
integerFromWord64Name :: Name
integerFromWord64IdKey :: Unique
integerFromNaturalName :: Name
integerFromNaturalIdKey :: Unique
integerFromInt64Name :: Name
integerFromInt64IdKey :: Unique
integerEqName :: Name
integerEqIdKey :: Unique
integerEncodeFloatName :: Name
integerEncodeFloatIdKey :: Unique
integerEncodeDoubleName :: Name
integerEncodeDoubleIdKey :: Unique
integerDivName :: Name
integerDivModName :: Name
integerDivModIdKey :: Unique
integerDivIdKey :: Unique
integerComplementName :: Name
integerComplementIdKey :: Unique
integerCompareName :: Name
integerCompareIdKey :: Unique
integerBitName :: Name
integerBitIdKey :: Unique
integerAndName :: Name
integerAndIdKey :: Unique
integerAdd_RDR :: RdrName
integerAddName :: Name
integerAddIdKey :: Unique
integerAbsName :: Name
integerAbsIdKey :: Unique
intTyConKey :: Unique
intPrimTyConKey :: Unique
intDataConKey :: Unique
int8X64PrimTyConKey :: Unique
int8X32PrimTyConKey :: Unique
int8X16PrimTyConKey :: Unique
int8TyConName :: Name
int8TyConKey :: Unique
int8PrimTyConKey :: Unique
int64X8PrimTyConKey :: Unique
int64X4PrimTyConKey :: Unique
int64X2PrimTyConKey :: Unique
int64TyConName :: Name
int64TyConKey :: Unique
int64PrimTyConKey :: Unique
int32X8PrimTyConKey :: Unique
int32X4PrimTyConKey :: Unique
int32X16PrimTyConKey :: Unique
int32TyConName :: Name
int32TyConKey :: Unique
int32PrimTyConKey :: Unique
int16X8PrimTyConKey :: Unique
int16X32PrimTyConKey :: Unique
int16X16PrimTyConKey :: Unique
int16TyConName :: Name
int16TyConKey :: Unique
int16PrimTyConKey :: Unique
inrDataConKey :: Unique
inlineIdName :: Name
inlineIdKey :: Unique
inlDataConKey :: Unique
infixIDataConName :: Name
infixIDataConKey :: Unique
infixDataCon_RDR :: RdrName
index_RDR :: RdrName
inRange_RDR :: RdrName
ident_RDR :: RdrName
heqTyConKey :: Unique
heqSCSelIdKey :: Unique
heqDataConKey :: Unique
hasFieldClassNameKey :: Unique
hasFieldClassName :: Name
guardMName :: Name
guardMIdKey :: Unique
gt_RDR :: RdrName
gtTag_RDR :: RdrName
groupWithName :: Name
groupWithIdKey :: Unique
ghciStepIoMName :: Name
ghciStepIoMClassOpKey :: Unique
ghciIoClassName :: Name
ghciIoClassKey :: Unique
getTag_RDR :: RdrName
getFieldName :: Name
getFieldClassOpKey :: Unique
genericTyConNames :: [Name]
genericClassNames :: [Name]
genUnitDataConKey :: Unique
genClassName :: Name
genClassKey :: Unique
gen1ClassName :: Name
gen1ClassKey :: Unique
ge_RDR :: RdrName
geName :: Name
geClassOpKey :: Unique
gHC_WORD :: Module
gHC_TYPES :: Module
gHC_TYPENATS_INTERNAL :: Module
gHC_TYPENATS :: Module
gHC_TYPELITS_INTERNAL :: Module
gHC_TYPELITS :: Module
gHC_TUPLE :: Module
gHC_TOP_HANDLER :: Module
gHC_STATICPTR_INTERNAL :: Module
gHC_STATICPTR :: Module
gHC_STACK_TYPES :: Module
gHC_STACK :: Module
gHC_STABLE :: Module
gHC_ST :: Module
gHC_SRCLOC :: Module
gHC_SHOW :: Module
gHC_RECORDS :: Module
gHC_REAL :: Module
gHC_READ :: Module
gHC_PTR :: Module
gHC_PRIM_PANIC :: Module
gHC_PRIM_EXCEPTION :: Module
gHC_PRIMOPWRAPPERS :: Module
gHC_PRIM :: Module
gHC_OVER_LABELS :: Module
gHC_NUM_NATURAL :: Module
gHC_NUM_INTEGER :: Module
gHC_NUM_BIGNAT :: Module
gHC_NUM :: Module
gHC_MAYBE :: Module
gHC_MAGIC :: Module
gHC_LIST :: Module
gHC_IX :: Module
gHC_IO_Exception :: Module
gHC_IO :: Module
gHC_INT :: Module
gHC_GHCI_HELPERS :: Module
gHC_GHCI :: Module
gHC_GENERICS :: Module
gHC_FLOAT :: Module
gHC_FINGERPRINT_TYPE :: Module
gHC_EXTS :: Module
gHC_ERR :: Module
gHC_ENUM :: Module
gHC_DESUGAR :: Module
gHC_CSTRING :: Module
gHC_CONC :: Module
gHC_CLASSES :: Module
gHC_BASE :: Module
gENERICS :: Module
functorClassName :: Name
functorClassKey :: Unique
funTyConKey :: Unique
funPtrTyConName :: Name
funPtrTyConKey :: Unique
fstName :: Name
fstIdKey :: Unique
frontendPluginTyConName :: Name
frontendPluginTyConKey :: Unique
from_RDR :: RdrName
fromString_RDR :: RdrName
fromStringName :: Name
fromStringClassOpKey :: Unique
fromStaticPtrName :: Name
fromStaticPtrClassOpKey :: Unique
fromRational_RDR :: RdrName
fromRationalName :: Name
fromRationalClassOpKey :: Unique
fromList_RDR :: RdrName
fromListName :: Name
fromListN_RDR :: RdrName
fromListNName :: Name
fromListNClassOpKey :: Unique
fromListClassOpKey :: Unique
fromLabelClassOpName :: Name
fromLabelClassOpKey :: Unique
fromIntegral_RDR :: RdrName
fromIntegralName :: Name
fromIntegralIdKey :: Unique
fromInteger_RDR :: RdrName
fromIntegerName :: Name
fromIntegerClassOpKey :: Unique
fromEnum_RDR :: RdrName
from1_RDR :: RdrName
fractionalClassName :: Name
fractionalClassKeys :: [Unique]
fractionalClassKey :: Unique
foreignObjPrimTyConKey :: Unique
foldr_RDR :: RdrName
foldrName :: Name
foldrIdKey :: Unique
foldable_foldr_RDR :: RdrName
foldableClassName :: Name
foldableClassKey :: Unique
foldMap_RDR :: RdrName
fmap_RDR :: RdrName
fmapName :: Name
fmapClassOpKey :: Unique
floatingClassName :: Name
floatingClassKey :: Unique
floatX8PrimTyConKey :: Unique
floatX4PrimTyConKey :: Unique
floatX16PrimTyConKey :: Unique
floatTyConKey :: Unique
floatPrimTyConKey :: Unique
floatDataConKey :: Unique
firstAName :: Name
firstAIdKey :: Unique
fingerprintDataConName :: Name
fingerprintDataConKey :: Unique
filterName :: Name
filterIdKey :: Unique
falseDataConKey :: Unique
failM_RDR :: RdrName
failMName :: Name
failMClassOpKey :: Unique
failIOName :: Name
failIOIdKey :: Unique
expectP_RDR :: RdrName
error_RDR :: RdrName
errorMessageTypeErrorFamName :: Name
errorMessageTypeErrorFamKey :: Unique
errorIdKey :: Unique
eq_RDR :: RdrName
eqTyConKey :: Unique
eqTag_RDR :: RdrName
eqString_RDR :: RdrName
eqStringName :: Name
eqStringIdKey :: Unique
eqSCSelIdKey :: Unique
eqReprPrimTyConKey :: Unique
eqPrimTyConKey :: Unique
eqPhantPrimTyConKey :: Unique
eqName :: Name
eqDataConKey :: Unique
eqClass_RDR :: RdrName
eqClassOpKey :: Unique
eqClassName :: Name
eqClassKey :: Unique
enumFrom_RDR :: RdrName
enumFromTo_RDR :: RdrName
enumFromToName :: Name
enumFromToClassOpKey :: Unique
enumFromThen_RDR :: RdrName
enumFromThenTo_RDR :: RdrName
enumFromThenToName :: Name
enumFromThenToClassOpKey :: Unique
enumFromThenName :: Name
enumFromThenClassOpKey :: Unique
enumFromName :: Name
enumFromClassOpKey :: Unique
enumClass_RDR :: RdrName
enumClassName :: Name
enumClassKey :: Unique
emptyCallStackName :: Name
emptyCallStackKey :: Unique
eitherTyConName :: Name
eitherTyConKey :: Unique
doubleX8PrimTyConKey :: Unique
doubleX4PrimTyConKey :: Unique
doubleX2PrimTyConKey :: Unique
doubleTyConKey :: Unique
doublePrimTyConKey :: Unique
doubleDataConKey :: Unique
dollarName :: Name
dollarIdKey :: Unique
divIntName :: Name
divIntIdKey :: Unique
derivableClassKeys :: [Unique]
decidedUnpackDataConName :: Name
decidedUnpackDataConKey :: Unique
decidedStrictDataConName :: Name
decidedStrictDataConKey :: Unique
decidedLazyDataConName :: Name
decidedLazyDataConKey :: Unique
dcQual :: Module -> FastString -> Unique -> Name
datatypeName_RDR :: RdrName
datatypeClassName :: Name
datatypeClassKey :: Unique
dataToTag_RDR :: RdrName
dataQual_RDR :: Module -> FastString -> RdrName
dataClassName :: Name
dataClassKey :: Unique
dYNAMIC :: Module
dTyConName :: Name
dTyConKey :: Unique
dEBUG_TRACE :: Module
dATA_TYPE_EQUALITY :: Module
dATA_TUPLE :: Module
dATA_TRAVERSABLE :: Module
dATA_STRING :: Module
dATA_LIST :: Module
dATA_FOLDABLE :: Module
dATA_EITHER :: Module
dATA_COERCE :: Module
dATA_ARRAY_PARALLEL_PRIM_NAME :: ModuleName
dATA_ARRAY_PARALLEL_NAME :: ModuleName
d1TyConName :: Name
d1TyConKey :: Unique
cstringLengthName :: Name
cstringLengthIdKey :: Unique
crossDataConKey :: Unique
constructorClassName :: Name
constructorClassKey :: Unique
constraintKindTyConKey :: Unique
considerAccessibleName :: Name
considerAccessibleIdKey :: Unique
consDataConKey :: Unique
concatName :: Name
concatIdKey :: Unique
conName_RDR :: RdrName
conIsRecord_RDR :: RdrName
conFixity_RDR :: RdrName
compose_RDR :: RdrName
composeAName :: Name
composeAIdKey :: Unique
compare_RDR :: RdrName
compactPrimTyConKey :: Unique
compTyConName :: Name
compTyConKey :: Unique
comp1DataCon_RDR :: RdrName
coercionTokenIdKey :: Unique
coercibleTyConKey :: Unique
coercibleSCSelIdKey :: Unique
coercibleDataConKey :: Unique
coerceKey :: Unique
clsQual_RDR :: Module -> FastString -> RdrName
clsQual :: Module -> FastString -> Unique -> Name
choose_RDR :: RdrName
choiceAName :: Name
choiceAIdKey :: Unique
charTyConKey :: Unique
charPrimTyConKey :: Unique
charDataConKey :: Unique
callStackTyConName :: Name
callStackTyConKey :: Unique
cTyConName :: Name
cTyConKey :: Unique
cONTROL_EXCEPTION_BASE :: Module
cONTROL_APPLICATIVE :: Module
c1TyConName :: Name
c1TyConKey :: Unique
byteArrayPrimTyConKey :: Unique
build_RDR :: RdrName
buildName :: Name
buildIdKey :: Unique
breakpointName :: Name
breakpointIdKey :: Unique
breakpointCondName :: Name
breakpointCondIdKey :: Unique
boxityConKey :: Unique
boxedRepDataConKey :: Unique
boundedClassName :: Name
boundedClassKey :: Unique
boolTyConKey :: Unique
bnnVarQual :: String -> Unique -> Name
bniVarQual :: String -> Unique -> Name
bnbVarQual :: String -> Unique -> Name
bitIntegerIdKey :: Unique
bindM_RDR :: RdrName
bindMName :: Name
bindMClassOpKey :: Unique
bindIO_RDR :: RdrName
bindIOName :: Name
bindIOIdKey :: Unique
bignatFromWordListName :: Name
bignatFromWordListIdKey :: Unique
bcoPrimTyConKey :: Unique
basicKnownKeyNames :: [Name]
augmentName :: Name
augmentIdKey :: Unique
assertName :: Name
assertIdKey :: Unique
assertErrorName :: Name
assertErrorIdKey :: Unique
arrayPrimTyConKey :: Unique
arrayArrayPrimTyConKey :: Unique
arrAName :: Name
arrAIdKey :: Unique
applicativeClassName :: Name
applicativeClassKey :: Unique
append_RDR :: RdrName
appendName :: Name
appendIdKey :: Unique
appAName :: Name
appAIdKey :: Unique
ap_RDR :: RdrName
apAName :: Name
apAClassOpKey :: Unique
anyTyConKey :: Unique
anyBoxConKey :: Unique
and_RDR :: RdrName
alternativeClassName :: Name
alternativeClassKey :: Unique
alt_RDR :: RdrName
all_RDR :: RdrName
allNameStrings :: [String]
addrPrimTyConKey :: Unique
absentSumFieldErrorIdKey :: Unique
absentErrorIdKey :: Unique
aRROW :: Module
type FunDep a = ([a], [a])
type DefMethInfo = Maybe (Name, DefMethSpec Type)
type ClassOpItem = (Id, DefMethInfo)
type ClassMinimalDef = BooleanFormula Name
data ClassATItem
ATI :: TyCon -> Maybe (Type, ATValidityInfo) -> ClassATItem
data Class
-- | Information about an associated type family default implementation.
-- This is used solely for validity checking. See Note [Type-checking
-- default assoc decls] in GHC.Tc.TyCl.
data ATValidityInfo
NoATVI :: ATValidityInfo
ATVI :: SrcSpan -> [Type] -> ATValidityInfo
pprFundeps :: Outputable a => [FunDep a] -> SDoc
pprFunDep :: Outputable a => FunDep a -> SDoc
pprDefMethInfo :: DefMethInfo -> SDoc
mkClass :: Name -> [TyVar] -> [FunDep TyVar] -> [PredType] -> [Id] -> [ClassATItem] -> [ClassOpItem] -> ClassMinimalDef -> TyCon -> Class
mkAbstractClass :: Name -> [TyVar] -> [FunDep TyVar] -> TyCon -> Class
isAbstractClass :: Class -> Bool
classTvsFds :: Class -> ([TyVar], [FunDep TyVar])
classSCTheta :: Class -> [PredType]
classSCSelIds :: Class -> [Id]
classSCSelId :: Class -> Int -> Id
classOpItems :: Class -> [ClassOpItem]
classMinimalDef :: Class -> ClassMinimalDef
classMethods :: Class -> [Id]
classHasFds :: Class -> Bool
classExtraBigSig :: Class -> ([TyVar], [FunDep TyVar], [PredType], [Id], [ClassATItem], [ClassOpItem])
classBigSig :: Class -> ([TyVar], [PredType], [Id], [ClassOpItem])
classArity :: Class -> Arity
classAllSelIds :: Class -> [Id]
classATs :: Class -> [TyCon]
classATItems :: Class -> [ClassATItem]
data Role
Nominal :: Role
Representational :: Role
Phantom :: Role
-- | Located Haskell Documentation String
type LHsDocString = Located HsDocString
-- | Haskell Documentation String
--
-- Internally this is a UTF8-Encoded ByteString.
data HsDocString
-- | Maps of docs that were added via Template Haskell's putDoc.
data ExtractedTHDocs
ExtractedTHDocs :: Maybe HsDocString -> DeclDocMap -> ArgDocMap -> DeclDocMap -> ExtractedTHDocs
-- | The added module header documentation, if it exists.
[ethd_mod_header] :: ExtractedTHDocs -> Maybe HsDocString
-- | The documentation added to declarations.
[ethd_decl_docs] :: ExtractedTHDocs -> DeclDocMap
-- | The documentation added to function arguments.
[ethd_arg_docs] :: ExtractedTHDocs -> ArgDocMap
-- | The documentation added to class and family instances.
[ethd_inst_docs] :: ExtractedTHDocs -> DeclDocMap
-- | Docs for declarations: functions, data types, instances, methods etc.
newtype DeclDocMap
DeclDocMap :: Map Name HsDocString -> DeclDocMap
-- | Docs for arguments. E.g. function arguments, method arguments.
newtype ArgDocMap
ArgDocMap :: Map Name (IntMap HsDocString) -> ArgDocMap
unpackHDS :: HsDocString -> String
ppr_mbDoc :: Maybe LHsDocString -> SDoc
-- | Create a HsDocString from a UTF8-encoded ByteString.
mkHsDocStringUtf8ByteString :: ByteString -> HsDocString
mkHsDocString :: String -> HsDocString
isEmptyDocString :: HsDocString -> Bool
-- | Return the contents of a HsDocString as a UTF8-encoded
-- ByteString.
hsDocStringToByteString :: HsDocString -> ByteString
emptyDeclDocMap :: DeclDocMap
emptyArgDocMap :: ArgDocMap
-- | Concat docstrings with two newlines in between.
--
-- Empty docstrings are skipped.
--
-- If all inputs are empty, Nothing is returned.
concatDocs :: [HsDocString] -> Maybe HsDocString
-- | Join two docstrings.
--
-- Non-empty docstrings are joined with two newlines in between,
-- resulting in separate paragraphs.
appendDocs :: HsDocString -> HsDocString -> HsDocString
-- | Captures the location of punctuation occuring between items, normally
-- in a list. It is captured as a trailing annotation.
data TrailingAnn
-- | Trailing ';'
AddSemiAnn :: EpaLocation -> TrailingAnn
-- | Trailing ','
AddCommaAnn :: EpaLocation -> TrailingAnn
-- | Trailing '|'
AddVbarAnn :: EpaLocation -> TrailingAnn
-- | Trailing ->
AddRarrowAnn :: EpaLocation -> TrailingAnn
-- | Trailing ->, unicode variant
AddRarrowAnnU :: EpaLocation -> TrailingAnn
-- | Trailing ⊸
AddLollyAnnU :: EpaLocation -> TrailingAnn
type SrcSpanAnnP = SrcAnn AnnPragma
type SrcSpanAnnN = SrcAnn NameAnn
type SrcSpanAnnL = SrcAnn AnnList
type SrcSpanAnnC = SrcAnn AnnContext
type SrcSpanAnnA = SrcAnn AnnListItem
-- | The 'SrcSpanAnn'' type wraps a normal SrcSpan, together with an
-- extra annotation type. This is mapped to a specific GenLocated
-- usage in the AST through the XRec and Anno type
-- families.
data SrcSpanAnn' a
SrcSpanAnn :: !a -> !SrcSpan -> SrcSpanAnn' a
[ann] :: SrcSpanAnn' a -> !a
[locA] :: SrcSpanAnn' a -> !SrcSpan
-- | We mostly use 'SrcSpanAnn'' with an 'EpAnn''
type SrcAnn ann = SrcSpanAnn' EpAnn ann
-- | Detail of the "brackets" used in an AnnParen exact print
-- annotation.
data ParenType
-- | '(', ')'
AnnParens :: ParenType
-- | '(#', '#)'
AnnParensHash :: ParenType
-- | '[', ']'
AnnParensSquare :: ParenType
data NoEpAnns
NoEpAnns :: NoEpAnns
-- | exact print annotations for a RdrName. There are many kinds
-- of adornment that can be attached to a given RdrName. This
-- type captures them, as detailed on the individual constructors.
data NameAnn
-- | Used for a name with an adornment, so `foo`, (bar)
NameAnn :: NameAdornment -> EpaLocation -> EpaLocation -> EpaLocation -> [TrailingAnn] -> NameAnn
[nann_adornment] :: NameAnn -> NameAdornment
[nann_open] :: NameAnn -> EpaLocation
[nann_name] :: NameAnn -> EpaLocation
[nann_close] :: NameAnn -> EpaLocation
[nann_trailing] :: NameAnn -> [TrailingAnn]
-- | Used for (,,,), or @()#
NameAnnCommas :: NameAdornment -> EpaLocation -> [EpaLocation] -> EpaLocation -> [TrailingAnn] -> NameAnn
[nann_adornment] :: NameAnn -> NameAdornment
[nann_open] :: NameAnn -> EpaLocation
[nann_commas] :: NameAnn -> [EpaLocation]
[nann_close] :: NameAnn -> EpaLocation
[nann_trailing] :: NameAnn -> [TrailingAnn]
-- | Used for (), (##), []
NameAnnOnly :: NameAdornment -> EpaLocation -> EpaLocation -> [TrailingAnn] -> NameAnn
[nann_adornment] :: NameAnn -> NameAdornment
[nann_open] :: NameAnn -> EpaLocation
[nann_close] :: NameAnn -> EpaLocation
[nann_trailing] :: NameAnn -> [TrailingAnn]
-- | Used for ->, as an identifier
NameAnnRArrow :: EpaLocation -> [TrailingAnn] -> NameAnn
[nann_name] :: NameAnn -> EpaLocation
[nann_trailing] :: NameAnn -> [TrailingAnn]
-- | Used for an item with a leading '. The annotation for
-- unquoted item is stored in nann_quoted.
NameAnnQuote :: EpaLocation -> SrcSpanAnnN -> [TrailingAnn] -> NameAnn
[nann_quote] :: NameAnn -> EpaLocation
[nann_quoted] :: NameAnn -> SrcSpanAnnN
[nann_trailing] :: NameAnn -> [TrailingAnn]
-- | Used when adding a TrailingAnn to an existing LocatedN
-- which has no Api Annotation (via the EpAnnNotUsed constructor.
NameAnnTrailing :: [TrailingAnn] -> NameAnn
[nann_trailing] :: NameAnn -> [TrailingAnn]
-- | A NameAnn can capture the locations of surrounding adornments,
-- such as parens or backquotes. This data type identifies what
-- particular pair are being used.
data NameAdornment
-- | '(' ')'
NameParens :: NameAdornment
-- | '(#' '#)'
NameParensHash :: NameAdornment
-- | '`'
NameBackquotes :: NameAdornment
-- | '[' ']'
NameSquare :: NameAdornment
type LocatedP = GenLocated SrcSpanAnnP
type LocatedN = GenLocated SrcSpanAnnN
type LocatedL = GenLocated SrcSpanAnnL
type LocatedC = GenLocated SrcSpanAnnC
-- | General representation of a GenLocated type carrying a
-- parameterised annotation type.
type LocatedAn an = GenLocated SrcAnn an
type LocatedA = GenLocated SrcSpanAnnA
type LEpaComment = GenLocated Anchor EpaComment
-- | Certain tokens can have alternate representations when unicode syntax
-- is enabled. This flag is attached to those tokens in the lexer so that
-- the original source representation can be reproduced in the
-- corresponding EpAnnotation
data IsUnicodeSyntax
UnicodeSyntax :: IsUnicodeSyntax
NormalSyntax :: IsUnicodeSyntax
-- | Some template haskell tokens have two variants, one with an e
-- the other not:
--
--
-- [| or [e|
-- [|| or [e||
--
--
-- This type indicates whether the e is present or not.
data HasE
HasE :: HasE
NoE :: HasE
-- | The anchor for an AnnKeywordId. The Parser inserts the
-- EpaSpan variant, giving the exact location of the
-- original item in the parsed source. This can be replaced by the
-- EpaDelta version, to provide a position for the item
-- relative to the end of the previous item in the source. This is useful
-- when editing an AST prior to exact printing the changed one. The list
-- of comments in the EpaDelta variant captures any
-- comments between the prior output and the thing being marked here,
-- since we cannot otherwise sort the relative order.
data EpaLocation
EpaSpan :: !RealSrcSpan -> EpaLocation
EpaDelta :: !DeltaPos -> ![LEpaComment] -> EpaLocation
data EpaCommentTok
-- | something beginning '-- |'
EpaDocCommentNext :: String -> EpaCommentTok
-- | something beginning '-- ^'
EpaDocCommentPrev :: String -> EpaCommentTok
-- | something beginning '-- $'
EpaDocCommentNamed :: String -> EpaCommentTok
-- | a section heading
EpaDocSection :: Int -> String -> EpaCommentTok
-- | doc options (prune, ignore-exports, etc)
EpaDocOptions :: String -> EpaCommentTok
-- | comment starting by "--"
EpaLineComment :: String -> EpaCommentTok
-- | comment in {- -}
EpaBlockComment :: String -> EpaCommentTok
-- | empty comment, capturing location of EOF
EpaEofComment :: EpaCommentTok
data EpaComment
EpaComment :: EpaCommentTok -> RealSrcSpan -> EpaComment
[ac_tok] :: EpaComment -> EpaCommentTok
-- | The location of the prior token, used in exact printing. The
-- EpaComment appears as an LEpaComment containing its
-- location. The difference between the end of the prior token and the
-- start of this location is used for the spacing when exact printing the
-- comment.
[ac_prior_tok] :: EpaComment -> RealSrcSpan
-- | When we are parsing we add comments that belong a particular AST
-- element, and print them together with the element, interleaving them
-- into the output stream. But when editing the AST to move fragments
-- around it is useful to be able to first separate the comments into
-- those occuring before the AST element and those following it. The
-- EpaCommentsBalanced constructor is used to do this. The GHC
-- parser will only insert the EpaComments form.
data EpAnnComments
EpaComments :: ![LEpaComment] -> EpAnnComments
[priorComments] :: EpAnnComments -> ![LEpaComment]
EpaCommentsBalanced :: ![LEpaComment] -> ![LEpaComment] -> EpAnnComments
[priorComments] :: EpAnnComments -> ![LEpaComment]
[followingComments] :: EpAnnComments -> ![LEpaComment]
type EpAnnCO = EpAnn NoEpAnns
-- | The exact print annotations (EPAs) are kept in the HsSyn AST for the
-- GhcPs phase. We do not always have EPAs though, only for code that has
-- been parsed as they do not exist for generated code. This type
-- captures that they may be missing.
--
-- A goal of the annotations is that an AST can be edited, including
-- moving subtrees from one place to another, duplicating them, and so
-- on. This means that each fragment must be self-contained. To this end,
-- each annotated fragment keeps track of the anchor position it was
-- originally captured at, being simply the start span of the topmost
-- element of the ast fragment. This gives us a way to later re-calculate
-- all Located items in this layer of the AST, as well as any annotations
-- captured. The comments associated with the AST fragment are also
-- captured here.
--
-- The ann type parameter allows this general structure to be
-- specialised to the specific set of locations of original exact print
-- annotation elements. So for HsLet we have
--
-- type instance XLet GhcPs = EpAnn AnnsLet data AnnsLet = AnnsLet {
-- alLet :: EpaLocation, alIn :: EpaLocation } deriving Data
--
-- The spacing between the items under the scope of a given EpAnn is
-- normally derived from the original Anchor. But if a sub-element
-- is not in its original position, the required spacing can be directly
-- captured in the anchor_op field of the entry Anchor.
-- This allows us to freely move elements around, and stitch together new
-- AST fragments out of old ones, and have them still printed out in a
-- precise way.
data EpAnn ann
EpAnn :: !Anchor -> !ann -> !EpAnnComments -> EpAnn ann
-- | Base location for the start of the syntactic element holding the
-- annotations.
[entry] :: EpAnn ann -> !Anchor
-- | Annotations added by the Parser
[anns] :: EpAnn ann -> !ann
-- | Comments enclosed in the SrcSpan of the element this EpAnn is
-- attached to
[comments] :: EpAnn ann -> !EpAnnComments
-- | No Annotation for generated code, e.g. from TH, deriving, etc.
EpAnnNotUsed :: EpAnn ann
-- | Spacing between output items when exact printing. It captures the
-- spacing from the current print position on the page to the position
-- required for the thing about to be printed. This is either on the same
-- line in which case is is simply the number of spaces to emit, or it is
-- some number of lines down, with a given column offset. The exact
-- printing algorithm keeps track of the column offset pertaining to the
-- current anchor position, so the deltaColumn is the additional
-- spaces to add in this case. See
-- https://gitlab.haskell.org/ghc/ghc/wikis/api-annotations for
-- details.
data DeltaPos
SameLine :: !Int -> DeltaPos
[deltaColumn] :: DeltaPos -> !Int
DifferentLine :: !Int -> !Int -> DeltaPos
-- | deltaLine should always be > 0
[deltaLine] :: DeltaPos -> !Int
[deltaColumn] :: DeltaPos -> !Int
-- | Captures the sort order of sub elements. This is needed when the
-- sub-elements have been split (as in a HsLocalBind which holds separate
-- binds and sigs) or for infix patterns where the order has been
-- re-arranged. It is captured explicitly so that after the Delta phase a
-- SrcSpan is used purely as an index into the annotations, allowing
-- transformations of the AST including the introduction of new Located
-- items or re-arranging existing ones.
data AnnSortKey
NoAnnSortKey :: AnnSortKey
AnnSortKey :: [RealSrcSpan] -> AnnSortKey
-- | exact print annotation used for capturing the locations of annotations
-- in pragmas.
data AnnPragma
AnnPragma :: AddEpAnn -> AddEpAnn -> [AddEpAnn] -> AnnPragma
[apr_open] :: AnnPragma -> AddEpAnn
[apr_close] :: AnnPragma -> AddEpAnn
[apr_rest] :: AnnPragma -> [AddEpAnn]
-- | exact print annotation for an item having surrounding "brackets", such
-- as tuples or lists
data AnnParen
AnnParen :: ParenType -> EpaLocation -> EpaLocation -> AnnParen
[ap_adornment] :: AnnParen -> ParenType
[ap_open] :: AnnParen -> EpaLocation
[ap_close] :: AnnParen -> EpaLocation
-- | Annotation for items appearing in a list. They can have one or more
-- trailing punctuations items, such as commas or semicolons.
data AnnListItem
AnnListItem :: [TrailingAnn] -> AnnListItem
[lann_trailing] :: AnnListItem -> [TrailingAnn]
-- | Annotation for the "container" of a list. This captures surrounding
-- items such as braces if present, and introductory keywords such as
-- 'where'.
data AnnList
AnnList :: Maybe Anchor -> Maybe AddEpAnn -> Maybe AddEpAnn -> [AddEpAnn] -> [TrailingAnn] -> AnnList
-- | start point of a list having layout
[al_anchor] :: AnnList -> Maybe Anchor
[al_open] :: AnnList -> Maybe AddEpAnn
[al_close] :: AnnList -> Maybe AddEpAnn
-- | context, such as 'where' keyword
[al_rest] :: AnnList -> [AddEpAnn]
-- | items appearing after the list, such as '=>' for a context
[al_trailing] :: AnnList -> [TrailingAnn]
-- | 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
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
-- | Exact print annotation for the Context data type.
data AnnContext
AnnContext :: Maybe (IsUnicodeSyntax, EpaLocation) -> [EpaLocation] -> [EpaLocation] -> AnnContext
-- | location and encoding of the '=>', if present.
[ac_darrow] :: AnnContext -> Maybe (IsUnicodeSyntax, EpaLocation)
-- | zero or more opening parentheses.
[ac_open] :: AnnContext -> [EpaLocation]
-- | zero or more closing parentheses.
[ac_close] :: AnnContext -> [EpaLocation]
-- | If tools modify the parsed source, the MovedAnchor variant can
-- directly provide the spacing for this item relative to the previous
-- one when printing. This allows AST fragments with a particular anchor
-- to be freely moved, without worrying about recalculating the
-- appropriate anchor span.
data AnchorOperation
UnchangedAnchor :: AnchorOperation
MovedAnchor :: DeltaPos -> AnchorOperation
-- | An Anchor records the base location for the start of the
-- syntactic element holding the annotations, and is used as the point of
-- reference for calculating delta positions for contained annotations.
-- It is also normally used as the reference point for the spacing of the
-- element relative to its container. If it is moved, that relationship
-- is tracked in the anchor_op instead.
data Anchor
Anchor :: RealSrcSpan -> AnchorOperation -> Anchor
-- | Base location for the start of the syntactic element holding the
-- annotations.
[anchor] :: Anchor -> RealSrcSpan
[anchor_op] :: Anchor -> AnchorOperation
-- | Captures an annotation, storing the AnnKeywordId and
-- its location. The parser only ever inserts EpaLocation
-- fields with a RealSrcSpan being the original location of the
-- annotation in the source file. The EpaLocation can
-- also store a delta position if the AST has been modified and needs to
-- be pretty printed again. The usual way an AddEpAnn is created
-- is using the mj ("make jump") function, and then it can be
-- inserted into the appropriate annotation.
data AddEpAnn
AddEpAnn :: AnnKeywordId -> EpaLocation -> AddEpAnn
-- | The annotations need to all come after the anchor. Make sure this is
-- the case.
widenSpan :: SrcSpan -> [AddEpAnn] -> SrcSpan
widenLocatedAn :: SrcSpanAnn' an -> [AddEpAnn] -> SrcSpanAnn' an
widenAnchorR :: Anchor -> RealSrcSpan -> Anchor
widenAnchor :: Anchor -> [AddEpAnn] -> Anchor
-- | Convert a normal annotation into its unicode equivalent one
unicodeAnn :: AnnKeywordId -> AnnKeywordId
-- | Transfer comments and trailing items from the annotations in the first
-- SrcSpanAnnA argument to those in the second.
transferAnnsA :: SrcSpanAnnA -> SrcSpanAnnA -> (SrcSpanAnnA, SrcSpanAnnA)
spanAsAnchor :: SrcSpan -> Anchor
sortLocatedA :: [GenLocated (SrcSpanAnn' a) e] -> [GenLocated (SrcSpanAnn' a) e]
setPriorComments :: EpAnnComments -> [LEpaComment] -> EpAnnComments
setFollowingComments :: EpAnnComments -> [LEpaComment] -> EpAnnComments
-- | Replace any existing comments on a SrcAnn, used for
-- manipulating the AST prior to exact printing the changed one.
setCommentsSrcAnn :: Monoid ann => SrcAnn ann -> EpAnnComments -> SrcAnn ann
-- | Replace any existing comments, used for manipulating the AST prior to
-- exact printing the changed one.
setCommentsEpAnn :: Monoid a => SrcSpan -> EpAnn a -> EpAnnComments -> EpAnn a
-- | Remove the comments, leaving the exact print annotations payload
removeCommentsA :: SrcAnn ann -> SrcAnn ann
realSrcSpan :: SrcSpan -> RealSrcSpan
realSpanAsAnchor :: RealSrcSpan -> Anchor
reLocN :: LocatedN a -> Located a
reLocL :: LocatedN e -> LocatedA e
reLocC :: LocatedN e -> LocatedC e
reLocA :: Located e -> LocatedAn ann e
reLoc :: LocatedAn a e -> Located e
reAnnL :: ann -> EpAnnComments -> Located e -> GenLocated (SrcAnn ann) e
reAnnC :: AnnContext -> EpAnnComments -> Located a -> LocatedC a
reAnn :: [TrailingAnn] -> EpAnnComments -> Located a -> LocatedA a
placeholderRealSpan :: RealSrcSpan
-- | Maps the ParenType to the related opening and closing
-- AnnKeywordId. Used when actually printing the item.
parenTypeKws :: ParenType -> (AnnKeywordId, AnnKeywordId)
noSrcSpanA :: SrcAnn ann
noLocA :: a -> LocatedAn an a
noComments :: EpAnnCO
noAnnSrcSpan :: SrcSpan -> SrcAnn ann
-- | Short form for EpAnnNotUsed
noAnn :: EpAnn a
-- | Helper function (temporary) during transition of names Discards any
-- annotations
na2la :: SrcSpanAnn' a -> SrcAnn ann
n2l :: LocatedN a -> LocatedA a
mapLocA :: (a -> b) -> GenLocated SrcSpan a -> GenLocated (SrcAnn ann) b
la2r :: SrcSpanAnn' a -> RealSrcSpan
-- | Helper function (temporary) during transition of names Discards any
-- annotations
la2na :: SrcSpanAnn' a -> SrcSpanAnnN
-- | Helper function (temporary) during transition of names Discards any
-- annotations
la2la :: LocatedAn ann1 a2 -> LocatedAn ann2 a2
-- | Helper function (temporary) during transition of names Discards any
-- annotations
l2n :: LocatedAn a1 a2 -> LocatedN a2
l2l :: SrcSpanAnn' a -> SrcAnn ann
getLocAnn :: Located a -> SrcSpanAnnA
getLocA :: GenLocated (SrcSpanAnn' a) e -> SrcSpan
getFollowingComments :: EpAnnComments -> [LEpaComment]
getDeltaLine :: DeltaPos -> Int
extraToAnnList :: AnnList -> [AddEpAnn] -> AnnList
-- | Used in the parser only, extract the SrcSpan from an
-- EpaLocation. The parser will never insert a DeltaPos, so
-- the partial function is safe.
epaLocationRealSrcSpan :: EpaLocation -> RealSrcSpan
epaLocationFromSrcAnn :: SrcAnn ann -> EpaLocation
epAnnComments :: EpAnn an -> EpAnnComments
epAnnAnnsL :: EpAnn a -> [a]
epAnnAnns :: EpAnn [AddEpAnn] -> [AddEpAnn]
emptyComments :: EpAnnComments
-- | Smart constructor for a DeltaPos. It preserves the invariant
-- that for the DifferentLine constructor deltaLine is
-- always > 0.
deltaPos :: Int -> Int -> DeltaPos
-- | Remove the exact print annotations payload, leaving only the anchor
-- and comments.
commentsOnlyA :: Monoid ann => SrcAnn ann -> SrcAnn ann
comment :: RealSrcSpan -> EpAnnComments -> EpAnnCO
combineSrcSpansA :: Semigroup a => SrcAnn a -> SrcAnn a -> SrcAnn a
combineLocsA :: Semigroup a => GenLocated (SrcAnn a) e1 -> GenLocated (SrcAnn a) e2 -> SrcAnn a
annParen2AddEpAnn :: EpAnn AnnParen -> [AddEpAnn]
-- | Helper function used in the parser to add a comma location to an
-- existing annotation.
addTrailingCommaToN :: SrcSpan -> EpAnn NameAnn -> EpaLocation -> EpAnn NameAnn
-- | Helper function used in the parser to add a TrailingAnn items
-- to an existing annotation.
addTrailingAnnToL :: SrcSpan -> TrailingAnn -> EpAnnComments -> EpAnn AnnList -> EpAnn AnnList
-- | Helper function used in the parser to add a TrailingAnn items
-- to an existing annotation.
addTrailingAnnToA :: SrcSpan -> TrailingAnn -> EpAnnComments -> EpAnn AnnListItem -> EpAnn AnnListItem
-- | Add additional comments to a SrcAnn, used for manipulating the
-- AST prior to exact printing the changed one.
addCommentsToSrcAnn :: Monoid ann => SrcAnn ann -> EpAnnComments -> SrcAnn ann
-- | Add additional comments, used for manipulating the AST prior to exact
-- printing the changed one.
addCommentsToEpAnn :: Monoid a => SrcSpan -> EpAnn a -> EpAnnComments -> EpAnn a
addCLocAA :: GenLocated (SrcSpanAnn' a1) e1 -> GenLocated (SrcSpanAnn' a2) e2 -> e3 -> GenLocated (SrcAnn ann) e3
-- | Combine locations from two Located things and add them to a
-- third thing
addCLocA :: GenLocated (SrcSpanAnn' a) e1 -> GenLocated SrcSpan e2 -> e3 -> GenLocated (SrcAnn ann) e3
addAnnsA :: SrcSpanAnnA -> [TrailingAnn] -> EpAnnComments -> SrcSpanAnnA
addAnns :: EpAnn [AddEpAnn] -> [AddEpAnn] -> EpAnnComments -> EpAnn [AddEpAnn]
-- | BuiltInSyntax is for things like (:), [] and tuples,
-- which have special syntactic forms. They aren't in scope as such.
data BuiltInSyntax
BuiltInSyntax :: BuiltInSyntax
UserSyntax :: BuiltInSyntax
wiredInNameTyThing_maybe :: Name -> Maybe TyThing
-- | Compare Names lexicographically This only works for Names that
-- originate in the source code or have been tidied.
stableNameCmp :: Name -> Name -> Ordering
setNameLoc :: Name -> SrcSpan -> Name
pprPrefixName :: NamedThing a => a -> SDoc
-- | Print the string of Name unqualifiedly directly.
pprNameUnqualified :: Name -> SDoc
pprNameDefnLoc :: Name -> SDoc
pprModulePrefix :: PprStyle -> Module -> OccName -> SDoc
pprInfixName :: (Outputable a, NamedThing a) => a -> SDoc
pprDefinedAt :: Name -> SDoc
-- | Get a string representation of a Name that's unique and stable
-- across recompilations. Used for deterministic generation of binds for
-- derived instances. eg.
-- "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal$String"
nameStableString :: Name -> String
nameSrcSpan :: Name -> SrcSpan
nameSrcLoc :: Name -> SrcLoc
nameNameSpace :: Name -> NameSpace
nameModule_maybe :: Name -> Maybe Module
nameModule :: HasDebugCallStack => Name -> Module
-- | Returns True if the name is (a) Internal (b) External but from the
-- specified module (c) External but from the interactive
-- package
--
-- The key idea is that False means: the entity is defined in some other
-- module you can find the details (type, fixity, instances) in some
-- interface file those details will be stored in the EPT or HPT
--
-- True means: the entity is defined in this module or earlier in the
-- GHCi session you can find details (type, fixity, instances) in the
-- TcGblEnv or TcLclEnv
--
-- The isInteractiveModule part is because successive interactions of a
-- GHCi session each give rise to a fresh module (Ghci1, Ghci2, etc), but
-- they all come from the magic interactive package; and all the
-- details are kept in the TcLclEnv, TcGblEnv, NOT in the HPT or EPT. See
-- Note [The interactive package] in GHC.Runtime.Context
nameIsLocalOrFrom :: Module -> Name -> Bool
nameIsHomePackageImport :: Module -> Name -> Bool
nameIsHomePackage :: Module -> Name -> Bool
-- | Returns True if the Name comes from some other package: neither this
-- package nor the interactive package.
nameIsFromExternalPackage :: HomeUnit -> Name -> Bool
-- | Create a name which is actually defined by the compiler itself
mkWiredInName :: Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name
mkSystemVarName :: Unique -> FastString -> Name
mkSystemNameAt :: Unique -> OccName -> SrcSpan -> Name
-- | Create a name brought into being by the compiler
mkSystemName :: Unique -> OccName -> Name
mkSysTvName :: Unique -> FastString -> Name
-- | Create a name which is (for now at least) local to the current module
-- and hence does not need a Module to disambiguate it from other
-- Names
mkInternalName :: Unique -> OccName -> SrcSpan -> Name
-- | Make a name for a foreign call
mkFCallName :: Unique -> String -> Name
-- | Create a name which definitely originates in the given module
mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name
mkDerivedInternalName :: (OccName -> OccName) -> Unique -> Name -> Name
mkClonedInternalName :: Unique -> Name -> Name
-- | Make the Name into an internal name, regardless of what it was
-- to begin with
localiseName :: Name -> Name
isWiredInName :: Name -> Bool
isWiredIn :: NamedThing thing => thing -> Bool
isVarName :: Name -> Bool
isValName :: Name -> Bool
isTyVarName :: Name -> Bool
isTyConName :: Name -> Bool
isSystemName :: Name -> Bool
isInternalName :: Name -> Bool
isHoleName :: Name -> Bool
isExternalName :: Name -> Bool
-- | Will the Name come from a dynamically linked package?
isDynLinkName :: Platform -> Module -> Name -> Bool
isDataConName :: Name -> Bool
isBuiltInSyntax :: Name -> Bool
getSrcSpan :: NamedThing a => a -> SrcSpan
getSrcLoc :: NamedThing a => a -> SrcLoc
getOccString :: NamedThing a => a -> String
getOccFS :: NamedThing a => a -> FastString
type TidyOccEnv = UniqFM FastString Int
type OccSet = UniqSet OccName
data OccEnv a
data NameSpace
unitOccSet :: OccName -> OccSet
unitOccEnv :: OccName -> a -> OccEnv a
unionOccSets :: OccSet -> OccSet -> OccSet
unionManyOccSets :: [OccSet] -> OccSet
tvName :: NameSpace
tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
tcName :: NameSpace
tcClsName :: NameSpace
-- | Haskell 98 encourages compilers to suppress warnings about unused
-- names in a pattern if they start with _: this implements that
-- test
startsWithUnderscore :: OccName -> Bool
srcDataName :: NameSpace
setOccNameSpace :: NameSpace -> OccName -> OccName
promoteOccName :: OccName -> Maybe OccName
pprOccName :: OccName -> SDoc
pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc
pprNonVarNameSpace :: NameSpace -> SDoc
pprNameSpaceBrief :: NameSpace -> SDoc
pprNameSpace :: NameSpace -> SDoc
plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a
plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
-- | Wrap parens around an operator
parenSymOcc :: OccName -> SDoc -> SDoc
occEnvElts :: OccEnv a -> [a]
nameSpacesRelated :: NameSpace -> NameSpace -> Bool
mkWorkerOcc :: OccName -> OccName
mkVarOcc :: String -> OccName
mkTyVarOccFS :: FastString -> OccName
mkTyVarOcc :: String -> OccName
mkTyConRepOcc :: OccName -> OccName
mkTcOccFS :: FastString -> OccName
mkTcOcc :: String -> OccName
mkTag2ConOcc :: OccName -> OccName
mkSuperDictSelOcc :: Int -> OccName -> OccName
mkSuperDictAuxOcc :: Int -> OccName -> OccName
mkSpecOcc :: OccName -> OccName
mkRepEqOcc :: OccName -> OccName
mkOccSet :: [OccName] -> OccSet
mkOccNameFS :: NameSpace -> FastString -> OccName
mkOccName :: NameSpace -> String -> OccName
mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a
mkOccEnv :: [(OccName, a)] -> OccEnv a
mkNewTyCoOcc :: OccName -> OccName
mkMethodOcc :: OccName -> OccName
mkMaxTagOcc :: OccName -> OccName
mkMatcherOcc :: OccName -> OccName
mkLocalOcc :: Unique -> OccName -> OccName
-- | Derive a name for the representation type constructor of a
-- data/newtype instance.
mkInstTyTcOcc :: String -> OccSet -> OccName
mkInstTyCoOcc :: OccName -> OccName
mkIPOcc :: OccName -> OccName
mkGenR :: OccName -> OccName
mkGen1R :: OccName -> OccName
mkForeignExportOcc :: OccName -> OccName
mkEqPredCoOcc :: OccName -> OccName
mkDictOcc :: OccName -> OccName
mkDefaultMethodOcc :: OccName -> OccName
mkDataTOcc :: OccName -> OccName
mkDataOccFS :: FastString -> OccName
mkDataOcc :: String -> OccName
mkDataConWrapperOcc :: OccName -> OccName
mkDataConWorkerOcc :: OccName -> OccName
mkDataCOcc :: OccName -> OccName
mkDFunOcc :: String -> Bool -> OccSet -> OccName
mkCon2TagOcc :: OccName -> OccName
mkClsOccFS :: FastString -> OccName
mkClsOcc :: String -> OccName
mkClassOpAuxOcc :: OccName -> OccName
mkClassDataConOcc :: OccName -> OccName
mkBuilderOcc :: OccName -> OccName
minusOccSet :: OccSet -> OccSet -> OccSet
mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b
lookupOccEnv :: OccEnv a -> OccName -> Maybe a
isVarOcc :: OccName -> Bool
isVarNameSpace :: NameSpace -> Bool
-- | Value OccNamess are those that are either in the
-- variable or data constructor namespaces
isValOcc :: OccName -> Bool
isValNameSpace :: NameSpace -> Bool
-- | Is an OccName one of a Typeable TyCon or
-- Module binding? This is needed as these bindings are renamed
-- differently. See Note [Grand plan for Typeable] in
-- GHC.Tc.Instance.Typeable.
isTypeableBindOcc :: OccName -> Bool
isTvOcc :: OccName -> Bool
isTvNameSpace :: NameSpace -> Bool
isTcOcc :: OccName -> Bool
isTcClsNameSpace :: NameSpace -> Bool
-- | Test if the OccName is that for any operator (whether it is a
-- data constructor or variable or whatever)
isSymOcc :: OccName -> Bool
isEmptyOccSet :: OccSet -> Bool
-- | Test for definitions internally generated by GHC. This predicate is
-- used to suppress printing of internal definitions in some debug prints
isDerivedOccName :: OccName -> Bool
isDefaultMethodOcc :: OccName -> Bool
-- | Test if the OccName is a data constructor that starts with a
-- symbol (e.g. :, or [])
isDataSymOcc :: OccName -> Bool
isDataOcc :: OccName -> Bool
isDataConNameSpace :: NameSpace -> Bool
intersectOccSet :: OccSet -> OccSet -> OccSet
initTidyOccEnv :: [OccName] -> TidyOccEnv
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt
extendOccSetList :: OccSet -> [OccName] -> OccSet
extendOccSet :: OccSet -> OccName -> OccSet
extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a
extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b
extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a
extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a
emptyTidyOccEnv :: TidyOccEnv
emptyOccSet :: OccSet
emptyOccEnv :: OccEnv a
elemOccSet :: OccName -> OccSet -> Bool
elemOccEnv :: OccName -> OccEnv a -> Bool
demoteOccName :: OccName -> Maybe OccName
delTidyOccEnvList :: TidyOccEnv -> [FastString] -> TidyOccEnv
delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a
delFromOccEnv :: OccEnv a -> OccName -> OccEnv a
dataName :: NameSpace
clsName :: NameSpace
avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt
type TyVarBinder = VarBndr TyVar ArgFlag
-- | Variable Binder
--
-- A TyCoVarBinder is the binder of a ForAllTy It's convenient to
-- define this synonym here rather its natural home in
-- GHC.Core.TyCo.Rep, because it's used in
-- GHC.Core.DataCon.hs-boot
--
-- A TyVarBinder is a binder with only TyVar
type TyCoVarBinder = VarBndr TyCoVar ArgFlag
tyVarSpecToBinders :: [VarBndr a Specificity] -> [VarBndr a ArgFlag]
tyVarKind :: TyVar -> Kind
-- | Do these denote the same level of visibility? Required
-- arguments are visible, others are not. So this function equates
-- Specified and Inferred. Used for printing.
sameVis :: ArgFlag -> ArgFlag -> Bool
-- | Make many named binders Input vars should be type variables
mkTyVarBinders :: vis -> [TyVar] -> [VarBndr TyVar vis]
-- | Make a named binder var should be a type variable
mkTyVarBinder :: vis -> TyVar -> VarBndr TyVar vis
-- | Make many named binders
mkTyCoVarBinders :: vis -> [TyCoVar] -> [VarBndr TyCoVar vis]
-- | Make a named binder
mkTyCoVarBinder :: vis -> TyCoVar -> VarBndr TyCoVar vis
-- | Does this ArgFlag classify an argument that is written in
-- Haskell?
isVisibleArgFlag :: ArgFlag -> Bool
-- | Is this a type-level (i.e., computationally irrelevant, thus erasable)
-- variable? Satisfies isTyVar = not . isId.
isTyVar :: Var -> Bool
-- | Does this ArgFlag classify an argument that is not written in
-- Haskell?
isInvisibleArgFlag :: ArgFlag -> Bool
binderVars :: [VarBndr tv argf] -> [tv]
binderVar :: VarBndr tv argf -> tv
binderType :: VarBndr TyCoVar argf -> Type
binderArgFlag :: VarBndr tv argf -> argf
wordRepDataConTy :: Type
word8RepDataConTy :: Type
word8ElemRepDataConTy :: Type
word64RepDataConTy :: Type
word64ElemRepDataConTy :: Type
word32RepDataConTy :: Type
word32ElemRepDataConTy :: Type
word16RepDataConTy :: Type
word16ElemRepDataConTy :: Type
vecRepDataConTyCon :: TyCon
vecElemTyCon :: TyCon
vecCountTyCon :: TyCon
vec8DataConTy :: Type
vec64DataConTy :: Type
vec4DataConTy :: Type
vec32DataConTy :: Type
vec2DataConTy :: Type
vec16DataConTy :: Type
unrestrictedFunTyCon :: TyCon
-- |
-- type UnliftedType = TYPE ('BoxedRep 'Unlifted)
--
unliftedTypeKindTyCon :: TyCon
unliftedTypeKind :: Kind
-- |
-- type UnliftedRep = 'BoxedRep 'Unlifted
--
unliftedRepTyCon :: TyCon
unliftedRepTy :: Type
unliftedDataConTy :: Type
unitTy :: Type
-- | Specialization of unboxedTupleSumKind for tuples
unboxedTupleKind :: [Type] -> Kind
typeSymbolKind :: Kind
tupleTyConName :: TupleSort -> Arity -> Name
tupleTyCon :: Boxity -> Arity -> TyCon
tupleRepDataConTyCon :: TyCon
tupleDataCon :: Boxity -> Arity -> DataCon
-- | Type constructor for n-ary unboxed sum.
sumTyCon :: Arity -> TyCon
-- | Data constructor for i-th alternative of a n-ary unboxed sum.
sumDataCon :: ConTag -> Arity -> DataCon
runtimeRepTyCon :: TyCon
runtimeRepTy :: Type
promotedTupleDataCon :: Boxity -> Arity -> TyCon
oneDataConTyCon :: TyCon
oneDataConTy :: Type
naturalTy :: Type
multiplicityTyCon :: TyCon
multiplicityTy :: Type
multMulTyCon :: TyCon
-- | Make a *promoted* list.
mkPromotedListTy :: Kind -> [Type] -> Type
-- | Build the type of a small tuple that holds the specified type of thing
-- Flattens 1-tuples. See Note [One-tuples].
mkBoxedTupleTy :: [Type] -> Type
manyDataConTyCon :: TyCon
manyDataConTy :: Type
listTyCon :: TyCon
liftedTypeKindTyCon :: TyCon
liftedTypeKind :: Kind
-- |
-- type LiftedRep = 'BoxedRep 'Lifted
--
liftedRepTyCon :: TyCon
liftedRepTy :: Type
liftedDataConTyCon :: TyCon
liftedDataConTy :: Type
levityTyCon :: TyCon
integerTy :: Type
intRepDataConTy :: Type
int8RepDataConTy :: Type
int8ElemRepDataConTy :: Type
int64RepDataConTy :: Type
int64ElemRepDataConTy :: Type
int32RepDataConTy :: Type
int32ElemRepDataConTy :: Type
int16RepDataConTy :: Type
int16ElemRepDataConTy :: Type
heqTyCon :: TyCon
floatRepDataConTy :: Type
floatElemRepDataConTy :: Type
doubleRepDataConTy :: Type
doubleElemRepDataConTy :: Type
constraintKind :: Kind
coercibleTyCon :: TyCon
charTy :: Type
cTupleTyConName :: Arity -> Name
cTupleSelIdName :: ConTag -> Arity -> Name
cTupleDataConName :: Arity -> Name
cTupleDataCon :: Arity -> DataCon
boxedRepDataConTyCon :: TyCon
anyTypeOfKind :: Kind -> Type
addrRepDataConTy :: Type
-- | The same as fst . splitTyConApp
tyConAppTyCon_maybe :: Type -> Maybe TyCon
-- | Gives the typechecker view of a type. This unwraps synonyms but leaves
-- Constraint alone. c.f. coreView, which turns
-- Constraint into Type. Returns Nothing if no
-- unwrapping happens. See also Note [coreView vs tcView]
tcView :: Type -> Maybe Type
-- | Given a RuntimeRep, applies TYPE to it. See Note
-- [TYPE and RuntimeRep] in GHC.Builtin.Types.Prim.
tYPE :: Type -> Type
-- | Attempts to tease a type apart into a type constructor and the
-- application of a number of arguments to that constructor
splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
piResultTy :: HasDebugCallStack => Type -> Type -> Type
-- | Given a TyCon and a list of argument types, partition the
-- arguments into:
--
--
-- - Inferred or Specified (i.e., invisible) arguments
-- and
-- - Required (i.e., visible) arguments
--
partitionInvisibleTypes :: TyCon -> [Type] -> ([Type], [Type])
-- | Create the plain type constructor type which has been applied to no
-- type arguments at all.
mkTyConTy :: TyCon -> Type
-- | A key function: builds a TyConApp or FunTy as
-- appropriate to its arguments. Applies its arguments to the constructor
-- from left to right.
mkTyConApp :: TyCon -> [Type] -> Type
-- | Make a CastTy. The Coercion must be nominal. Checks the
-- Coercion for reflexivity, dropping it if it's reflexive. See Note
-- [Respecting definitional equality] in GHC.Core.TyCo.Rep
mkCastTy :: Type -> Coercion -> Type
-- | Applies a type to another, as in e.g. k a
mkAppTy :: Type -> Type -> Type
-- | Is this the type RuntimeRep?
isRuntimeRepTy :: Type -> Bool
isPredTy :: HasDebugCallStack => Type -> Bool
-- | Is this the type Multiplicity?
isMultiplicityTy :: Type -> Bool
-- | This version considers Constraint to be the same as *. Returns True if
-- the argument is equivalent to Type/Constraint and False otherwise. See
-- Note [Kind Constraint and kind Type]
isLiftedTypeKind :: Kind -> Bool
isCoercionTy :: Type -> Bool
-- | This function strips off the top layer only of a type synonym
-- application (if any) its underlying representation type. Returns
-- Nothing if there is nothing to look through. This function
-- considers Constraint to be a synonym of Type.
--
-- By being non-recursive and inlined, this case analysis gets
-- efficiently joined onto the case analysis that the caller is already
-- doing
coreView :: Type -> Maybe Type
data Type
-- | A TyCoBinder represents an argument to a function. TyCoBinders
-- can be dependent (Named) or nondependent (Anon). They
-- may also be visible or not. See Note [TyCoBinders]
data TyCoBinder
-- | A collection of PredTypes
type ThetaType = [PredType]
-- | A shorthand for data with an attached Mult element (the
-- multiplicity).
data Scaled a
-- | A type of the form p of constraint kind represents a value
-- whose type is the Haskell predicate p, where a predicate is
-- what occurs before the => in a Haskell type.
--
-- We use PredType as documentation to mark those types that we
-- guarantee to have this kind.
--
-- It can be expanded into its representation, but:
--
--
-- - The type checker must treat it as opaque
-- - The rest of the compiler treats it as transparent
--
--
-- Consider these examples:
--
--
-- f :: (Eq a) => a -> Int
-- g :: (?x :: Int -> Int) => a -> Int
-- h :: (r\l) => {r} => {l::Int | r}
--
--
-- Here the Eq a and ?x :: Int -> Int and
-- rl are all called "predicates"
type PredType = Type
-- | Mult is a type alias for Type.
--
-- Mult must contain Type because multiplicity variables are mere type
-- variables (of kind Multiplicity) in Haskell. So the simplest
-- implementation is to make Mult be Type.
--
-- Multiplicities can be formed with: - One: GHC.Types.One (= oneDataCon)
-- - Many: GHC.Types.Many (= manyDataCon) - Multiplication:
-- GHC.Types.MultMul (= multMulTyCon)
--
-- So that Mult feels a bit more structured, we provide pattern synonyms
-- and smart constructors for these.
type Mult = Type
-- | The key type representing kinds in the compiler.
type Kind = Type
-- | Like mkTyCoForAllTy, but does not check the occurrence of the
-- binder See Note [Unused coercion variable in ForAllTy]
mkForAllTy :: TyCoVar -> ArgFlag -> Type -> Type
data Bag a
unitBag :: a -> Bag a
unionManyBags :: [Bag a] -> Bag a
unionBags :: Bag a -> Bag a -> Bag a
snocBag :: Bag a -> a -> Bag a
infixl 3 `snocBag`
partitionBagWith :: (a -> Either b c) -> Bag a -> (Bag b, Bag c)
partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
nonEmptyToBag :: NonEmpty a -> Bag a
mapMaybeBag :: (a -> Maybe b) -> Bag a -> Bag b
mapBagM_ :: Monad m => (a -> m b) -> Bag a -> m ()
mapBagM :: Monad m => (a -> m b) -> Bag a -> m (Bag b)
mapBag :: (a -> b) -> Bag a -> Bag b
mapAndUnzipBagM :: Monad m => (a -> m (b, c)) -> Bag a -> m (Bag b, Bag c)
mapAccumBagLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> Bag x -> m (acc, Bag y)
mapAccumBagL :: (acc -> x -> (acc, y)) -> acc -> Bag x -> (acc, Bag y)
listToBag :: [a] -> Bag a
lengthBag :: Bag a -> Int
isSingletonBag :: Bag a -> Bool
isEmptyBag :: Bag a -> Bool
foldBag :: (r -> r -> r) -> (a -> r) -> r -> Bag a -> r
flatMapBagPairM :: Monad m => (a -> m (Bag b, Bag c)) -> Bag a -> m (Bag b, Bag c)
flatMapBagM :: Monad m => (a -> m (Bag b)) -> Bag a -> m (Bag b)
filterBagM :: Monad m => (a -> m Bool) -> Bag a -> m (Bag a)
filterBag :: (a -> Bool) -> Bag a -> Bag a
emptyBag :: Bag a
elemBag :: Eq a => a -> Bag a -> Bool
consBag :: a -> Bag a -> Bag a
infixr 3 `consBag`
concatMapBagPair :: (a -> (Bag b, Bag c)) -> Bag a -> (Bag b, Bag c)
concatMapBag :: (a -> Bag b) -> Bag a -> Bag b
concatBag :: Bag (Bag a) -> Bag a
catBagMaybes :: Bag (Maybe a) -> Bag a
bagToList :: Bag a -> [a]
anyBagM :: Monad m => (a -> m Bool) -> Bag a -> m Bool
anyBag :: (a -> Bool) -> Bag a -> Bool
allBag :: (a -> Bool) -> Bag a -> Bool
data WarningFlag
Opt_WarnDuplicateExports :: WarningFlag
Opt_WarnDuplicateConstraints :: WarningFlag
Opt_WarnRedundantConstraints :: WarningFlag
Opt_WarnHiShadows :: WarningFlag
Opt_WarnImplicitPrelude :: WarningFlag
Opt_WarnIncompletePatterns :: WarningFlag
Opt_WarnIncompleteUniPatterns :: WarningFlag
Opt_WarnIncompletePatternsRecUpd :: WarningFlag
Opt_WarnOverflowedLiterals :: WarningFlag
Opt_WarnEmptyEnumerations :: WarningFlag
Opt_WarnMissingFields :: WarningFlag
Opt_WarnMissingImportList :: WarningFlag
Opt_WarnMissingMethods :: WarningFlag
Opt_WarnMissingSignatures :: WarningFlag
Opt_WarnMissingLocalSignatures :: WarningFlag
Opt_WarnNameShadowing :: WarningFlag
Opt_WarnOverlappingPatterns :: WarningFlag
Opt_WarnTypeDefaults :: WarningFlag
Opt_WarnMonomorphism :: WarningFlag
Opt_WarnUnusedTopBinds :: WarningFlag
Opt_WarnUnusedLocalBinds :: WarningFlag
Opt_WarnUnusedPatternBinds :: WarningFlag
Opt_WarnUnusedImports :: WarningFlag
Opt_WarnUnusedMatches :: WarningFlag
Opt_WarnUnusedTypePatterns :: WarningFlag
Opt_WarnUnusedForalls :: WarningFlag
Opt_WarnUnusedRecordWildcards :: WarningFlag
Opt_WarnRedundantBangPatterns :: WarningFlag
Opt_WarnRedundantRecordWildcards :: WarningFlag
Opt_WarnWarningsDeprecations :: WarningFlag
Opt_WarnDeprecatedFlags :: WarningFlag
Opt_WarnMissingMonadFailInstances :: WarningFlag
Opt_WarnSemigroup :: WarningFlag
Opt_WarnDodgyExports :: WarningFlag
Opt_WarnDodgyImports :: WarningFlag
Opt_WarnOrphans :: WarningFlag
Opt_WarnAutoOrphans :: WarningFlag
Opt_WarnIdentities :: WarningFlag
Opt_WarnTabs :: WarningFlag
Opt_WarnUnrecognisedPragmas :: WarningFlag
Opt_WarnDodgyForeignImports :: WarningFlag
Opt_WarnUnusedDoBind :: WarningFlag
Opt_WarnWrongDoBind :: WarningFlag
Opt_WarnAlternativeLayoutRuleTransitional :: WarningFlag
Opt_WarnUnsafe :: WarningFlag
Opt_WarnSafe :: WarningFlag
Opt_WarnTrustworthySafe :: WarningFlag
Opt_WarnMissedSpecs :: WarningFlag
Opt_WarnAllMissedSpecs :: WarningFlag
Opt_WarnUnsupportedCallingConventions :: WarningFlag
Opt_WarnUnsupportedLlvmVersion :: WarningFlag
Opt_WarnMissedExtraSharedLib :: WarningFlag
Opt_WarnInlineRuleShadowing :: WarningFlag
Opt_WarnTypedHoles :: WarningFlag
Opt_WarnPartialTypeSignatures :: WarningFlag
Opt_WarnMissingExportedSignatures :: WarningFlag
Opt_WarnUntickedPromotedConstructors :: WarningFlag
Opt_WarnDerivingTypeable :: WarningFlag
Opt_WarnDeferredTypeErrors :: WarningFlag
Opt_WarnDeferredOutOfScopeVariables :: WarningFlag
Opt_WarnNonCanonicalMonadInstances :: WarningFlag
Opt_WarnNonCanonicalMonadFailInstances :: WarningFlag
Opt_WarnNonCanonicalMonoidInstances :: WarningFlag
Opt_WarnMissingPatternSynonymSignatures :: WarningFlag
Opt_WarnUnrecognisedWarningFlags :: WarningFlag
Opt_WarnSimplifiableClassConstraints :: WarningFlag
Opt_WarnCPPUndef :: WarningFlag
Opt_WarnUnbangedStrictPatterns :: WarningFlag
Opt_WarnMissingHomeModules :: WarningFlag
Opt_WarnPartialFields :: WarningFlag
Opt_WarnMissingExportList :: WarningFlag
Opt_WarnInaccessibleCode :: WarningFlag
Opt_WarnStarIsType :: WarningFlag
Opt_WarnStarBinder :: WarningFlag
Opt_WarnImplicitKindVars :: WarningFlag
Opt_WarnSpaceAfterBang :: WarningFlag
Opt_WarnMissingDerivingStrategies :: WarningFlag
Opt_WarnPrepositiveQualifiedModule :: WarningFlag
Opt_WarnUnusedPackages :: WarningFlag
Opt_WarnInferredSafeImports :: WarningFlag
Opt_WarnMissingSafeHaskellMode :: WarningFlag
Opt_WarnCompatUnqualifiedImports :: WarningFlag
Opt_WarnDerivingDefaults :: WarningFlag
Opt_WarnInvalidHaddock :: WarningFlag
Opt_WarnOperatorWhitespaceExtConflict :: WarningFlag
Opt_WarnOperatorWhitespace :: WarningFlag
Opt_WarnAmbiguousFields :: WarningFlag
Opt_WarnImplicitLift :: WarningFlag
Opt_WarnMissingKindSignatures :: WarningFlag
Opt_WarnUnicodeBidirectionalFormatCharacters :: WarningFlag
-- | Used when outputting warnings: if a reason is given, it is displayed.
-- If a warning isn't controlled by a flag, this is made explicit at the
-- point of use.
data WarnReason
NoReason :: WarnReason
-- | Warning was enabled with the flag
Reason :: !WarningFlag -> WarnReason
-- | Warning was made an error because of -Werror or -Werror=WarningFlag
ErrReason :: !Maybe WarningFlag -> WarnReason
data Language
Haskell98 :: Language
Haskell2010 :: Language
GHC2021 :: Language
-- | Enumerates the simple on-or-off dynamic flags
data GeneralFlag
-- | Append dump output to files instead of stdout.
Opt_DumpToFile :: GeneralFlag
Opt_D_faststring_stats :: GeneralFlag
Opt_D_dump_minimal_imports :: GeneralFlag
Opt_DoCoreLinting :: GeneralFlag
Opt_DoLinearCoreLinting :: GeneralFlag
Opt_DoStgLinting :: GeneralFlag
Opt_DoCmmLinting :: GeneralFlag
Opt_DoAsmLinting :: GeneralFlag
Opt_DoAnnotationLinting :: GeneralFlag
Opt_DoBoundsChecking :: GeneralFlag
Opt_NoLlvmMangler :: GeneralFlag
Opt_FastLlvm :: GeneralFlag
Opt_NoTypeableBinds :: GeneralFlag
Opt_DistinctConstructorTables :: GeneralFlag
Opt_InfoTableMap :: GeneralFlag
Opt_WarnIsError :: GeneralFlag
Opt_ShowWarnGroups :: GeneralFlag
Opt_HideSourcePaths :: GeneralFlag
Opt_PrintExplicitForalls :: GeneralFlag
Opt_PrintExplicitKinds :: GeneralFlag
Opt_PrintExplicitCoercions :: GeneralFlag
Opt_PrintExplicitRuntimeReps :: GeneralFlag
Opt_PrintEqualityRelations :: GeneralFlag
Opt_PrintAxiomIncomps :: GeneralFlag
Opt_PrintUnicodeSyntax :: GeneralFlag
Opt_PrintExpandedSynonyms :: GeneralFlag
Opt_PrintPotentialInstances :: GeneralFlag
Opt_PrintTypecheckerElaboration :: GeneralFlag
Opt_CallArity :: GeneralFlag
Opt_Exitification :: GeneralFlag
Opt_Strictness :: GeneralFlag
Opt_LateDmdAnal :: GeneralFlag
Opt_KillAbsence :: GeneralFlag
Opt_KillOneShot :: GeneralFlag
Opt_FullLaziness :: GeneralFlag
Opt_FloatIn :: GeneralFlag
Opt_LateSpecialise :: GeneralFlag
Opt_Specialise :: GeneralFlag
Opt_SpecialiseAggressively :: GeneralFlag
Opt_CrossModuleSpecialise :: GeneralFlag
Opt_InlineGenerics :: GeneralFlag
Opt_InlineGenericsAggressively :: GeneralFlag
Opt_StaticArgumentTransformation :: GeneralFlag
Opt_CSE :: GeneralFlag
Opt_StgCSE :: GeneralFlag
Opt_StgLiftLams :: GeneralFlag
Opt_LiberateCase :: GeneralFlag
Opt_SpecConstr :: GeneralFlag
Opt_SpecConstrKeen :: GeneralFlag
Opt_DoLambdaEtaExpansion :: GeneralFlag
Opt_IgnoreAsserts :: GeneralFlag
Opt_DoEtaReduction :: GeneralFlag
Opt_CaseMerge :: GeneralFlag
Opt_CaseFolding :: GeneralFlag
Opt_UnboxStrictFields :: GeneralFlag
Opt_UnboxSmallStrictFields :: GeneralFlag
Opt_DictsCheap :: GeneralFlag
Opt_EnableRewriteRules :: GeneralFlag
Opt_EnableThSpliceWarnings :: GeneralFlag
Opt_RegsGraph :: GeneralFlag
Opt_RegsIterative :: GeneralFlag
Opt_PedanticBottoms :: GeneralFlag
Opt_LlvmTBAA :: GeneralFlag
Opt_LlvmFillUndefWithGarbage :: GeneralFlag
Opt_IrrefutableTuples :: GeneralFlag
Opt_CmmSink :: GeneralFlag
Opt_CmmStaticPred :: GeneralFlag
Opt_CmmElimCommonBlocks :: GeneralFlag
Opt_AsmShortcutting :: GeneralFlag
Opt_OmitYields :: GeneralFlag
Opt_FunToThunk :: GeneralFlag
Opt_DictsStrict :: GeneralFlag
-- | deprecated, no effect and behaviour is now default. Allowed switching
-- of a special demand transformer for dictionary selectors
Opt_DmdTxDictSel :: GeneralFlag
Opt_Loopification :: GeneralFlag
-- | Use the cfg based block layout algorithm.
Opt_CfgBlocklayout :: GeneralFlag
-- | Layout based on last instruction per block.
Opt_WeightlessBlocklayout :: GeneralFlag
Opt_CprAnal :: GeneralFlag
Opt_WorkerWrapper :: GeneralFlag
Opt_SolveConstantDicts :: GeneralFlag
Opt_AlignmentSanitisation :: GeneralFlag
Opt_CatchBottoms :: GeneralFlag
Opt_NumConstantFolding :: GeneralFlag
Opt_SimplPreInlining :: GeneralFlag
Opt_IgnoreInterfacePragmas :: GeneralFlag
Opt_OmitInterfacePragmas :: GeneralFlag
Opt_ExposeAllUnfoldings :: GeneralFlag
Opt_WriteInterface :: GeneralFlag
Opt_WriteHie :: GeneralFlag
Opt_AutoSccsOnIndividualCafs :: GeneralFlag
Opt_ProfCountEntries :: GeneralFlag
Opt_Pp :: GeneralFlag
Opt_ForceRecomp :: GeneralFlag
Opt_IgnoreOptimChanges :: GeneralFlag
Opt_IgnoreHpcChanges :: GeneralFlag
Opt_ExcessPrecision :: GeneralFlag
Opt_EagerBlackHoling :: GeneralFlag
Opt_NoHsMain :: GeneralFlag
Opt_SplitSections :: GeneralFlag
Opt_StgStats :: GeneralFlag
Opt_HideAllPackages :: GeneralFlag
Opt_HideAllPluginPackages :: GeneralFlag
Opt_PrintBindResult :: GeneralFlag
Opt_Haddock :: GeneralFlag
Opt_HaddockOptions :: GeneralFlag
Opt_BreakOnException :: GeneralFlag
Opt_BreakOnError :: GeneralFlag
Opt_PrintEvldWithShow :: GeneralFlag
Opt_PrintBindContents :: GeneralFlag
Opt_GenManifest :: GeneralFlag
Opt_EmbedManifest :: GeneralFlag
Opt_SharedImplib :: GeneralFlag
Opt_BuildingCabalPackage :: GeneralFlag
Opt_IgnoreDotGhci :: GeneralFlag
Opt_GhciSandbox :: GeneralFlag
Opt_GhciHistory :: GeneralFlag
Opt_GhciLeakCheck :: GeneralFlag
Opt_ValidateHie :: GeneralFlag
Opt_LocalGhciHistory :: GeneralFlag
Opt_NoIt :: GeneralFlag
Opt_HelpfulErrors :: GeneralFlag
Opt_DeferTypeErrors :: GeneralFlag
Opt_DeferTypedHoles :: GeneralFlag
Opt_DeferOutOfScopeVariables :: GeneralFlag
-- |
-- -fPIC
--
Opt_PIC :: GeneralFlag
-- |
-- -fPIE
--
Opt_PIE :: GeneralFlag
-- |
-- -pie
--
Opt_PICExecutable :: GeneralFlag
Opt_ExternalDynamicRefs :: GeneralFlag
Opt_Ticky :: GeneralFlag
Opt_Ticky_Allocd :: GeneralFlag
Opt_Ticky_LNE :: GeneralFlag
Opt_Ticky_Dyn_Thunk :: GeneralFlag
Opt_RPath :: GeneralFlag
Opt_RelativeDynlibPaths :: GeneralFlag
-- |
-- -fcompact-unwind
--
Opt_CompactUnwind :: GeneralFlag
Opt_Hpc :: GeneralFlag
Opt_FamAppCache :: GeneralFlag
Opt_ExternalInterpreter :: GeneralFlag
Opt_OptimalApplicativeDo :: GeneralFlag
Opt_VersionMacros :: GeneralFlag
Opt_WholeArchiveHsLibs :: GeneralFlag
Opt_SingleLibFolder :: GeneralFlag
Opt_ExposeInternalSymbols :: GeneralFlag
Opt_KeepCAFs :: GeneralFlag
Opt_KeepGoing :: GeneralFlag
Opt_ByteCode :: GeneralFlag
Opt_LinkRts :: GeneralFlag
Opt_ErrorSpans :: GeneralFlag
Opt_DeferDiagnostics :: GeneralFlag
Opt_DiagnosticsShowCaret :: GeneralFlag
Opt_PprCaseAsLet :: GeneralFlag
Opt_PprShowTicks :: GeneralFlag
Opt_ShowHoleConstraints :: GeneralFlag
Opt_ShowValidHoleFits :: GeneralFlag
Opt_SortValidHoleFits :: GeneralFlag
Opt_SortBySizeHoleFits :: GeneralFlag
Opt_SortBySubsumHoleFits :: GeneralFlag
Opt_AbstractRefHoleFits :: GeneralFlag
Opt_UnclutterValidHoleFits :: GeneralFlag
Opt_ShowTypeAppOfHoleFits :: GeneralFlag
Opt_ShowTypeAppVarsOfHoleFits :: GeneralFlag
Opt_ShowDocsOfHoleFits :: GeneralFlag
Opt_ShowTypeOfHoleFits :: GeneralFlag
Opt_ShowProvOfHoleFits :: GeneralFlag
Opt_ShowMatchesOfHoleFits :: GeneralFlag
Opt_ShowLoadedModules :: GeneralFlag
Opt_HexWordLiterals :: GeneralFlag
Opt_SuppressCoercions :: GeneralFlag
Opt_SuppressVarKinds :: GeneralFlag
Opt_SuppressModulePrefixes :: GeneralFlag
Opt_SuppressTypeApplications :: GeneralFlag
Opt_SuppressIdInfo :: GeneralFlag
Opt_SuppressUnfoldings :: GeneralFlag
Opt_SuppressTypeSignatures :: GeneralFlag
Opt_SuppressUniques :: GeneralFlag
Opt_SuppressStgExts :: GeneralFlag
Opt_SuppressTicks :: GeneralFlag
-- | Suppress timestamps in dumps
Opt_SuppressTimestamps :: GeneralFlag
Opt_AutoLinkPackages :: GeneralFlag
Opt_ImplicitImportQualified :: GeneralFlag
Opt_KeepHscppFiles :: GeneralFlag
Opt_KeepHiDiffs :: GeneralFlag
Opt_KeepHcFiles :: GeneralFlag
Opt_KeepSFiles :: GeneralFlag
Opt_KeepTmpFiles :: GeneralFlag
Opt_KeepRawTokenStream :: GeneralFlag
Opt_KeepLlvmFiles :: GeneralFlag
Opt_KeepHiFiles :: GeneralFlag
Opt_KeepOFiles :: GeneralFlag
Opt_BuildDynamicToo :: GeneralFlag
Opt_DistrustAllPackages :: GeneralFlag
Opt_PackageTrust :: GeneralFlag
Opt_PluginTrustworthy :: GeneralFlag
Opt_G_NoStateHack :: GeneralFlag
Opt_G_NoOptCoercion :: GeneralFlag
-- | Debugging flags
data DumpFlag
Opt_D_dump_cmm :: DumpFlag
Opt_D_dump_cmm_from_stg :: DumpFlag
Opt_D_dump_cmm_raw :: DumpFlag
Opt_D_dump_cmm_verbose_by_proc :: DumpFlag
Opt_D_dump_cmm_verbose :: DumpFlag
Opt_D_dump_cmm_cfg :: DumpFlag
Opt_D_dump_cmm_cbe :: DumpFlag
Opt_D_dump_cmm_switch :: DumpFlag
Opt_D_dump_cmm_proc :: DumpFlag
Opt_D_dump_cmm_sp :: DumpFlag
Opt_D_dump_cmm_sink :: DumpFlag
Opt_D_dump_cmm_caf :: DumpFlag
Opt_D_dump_cmm_procmap :: DumpFlag
Opt_D_dump_cmm_split :: DumpFlag
Opt_D_dump_cmm_info :: DumpFlag
Opt_D_dump_cmm_cps :: DumpFlag
-- | Dump the cfg used for block layout.
Opt_D_dump_cfg_weights :: DumpFlag
Opt_D_dump_asm :: DumpFlag
Opt_D_dump_asm_native :: DumpFlag
Opt_D_dump_asm_liveness :: DumpFlag
Opt_D_dump_asm_regalloc :: DumpFlag
Opt_D_dump_asm_regalloc_stages :: DumpFlag
Opt_D_dump_asm_conflicts :: DumpFlag
Opt_D_dump_asm_stats :: DumpFlag
Opt_D_dump_asm_expanded :: DumpFlag
Opt_D_dump_c_backend :: DumpFlag
Opt_D_dump_llvm :: DumpFlag
Opt_D_dump_core_stats :: DumpFlag
Opt_D_dump_deriv :: DumpFlag
Opt_D_dump_ds :: DumpFlag
Opt_D_dump_ds_preopt :: DumpFlag
Opt_D_dump_foreign :: DumpFlag
Opt_D_dump_inlinings :: DumpFlag
Opt_D_dump_rule_firings :: DumpFlag
Opt_D_dump_rule_rewrites :: DumpFlag
Opt_D_dump_simpl_trace :: DumpFlag
Opt_D_dump_occur_anal :: DumpFlag
Opt_D_dump_parsed :: DumpFlag
Opt_D_dump_parsed_ast :: DumpFlag
Opt_D_dump_rn :: DumpFlag
Opt_D_dump_rn_ast :: DumpFlag
Opt_D_dump_simpl :: DumpFlag
Opt_D_dump_simpl_iterations :: DumpFlag
Opt_D_dump_spec :: DumpFlag
Opt_D_dump_prep :: DumpFlag
-- | Initial STG (CoreToStg output)
Opt_D_dump_stg_from_core :: DumpFlag
-- | STG after unarise
Opt_D_dump_stg_unarised :: DumpFlag
-- | Final STG (after stg2stg)
Opt_D_dump_stg_final :: DumpFlag
Opt_D_dump_call_arity :: DumpFlag
Opt_D_dump_exitify :: DumpFlag
Opt_D_dump_stranal :: DumpFlag
Opt_D_dump_str_signatures :: DumpFlag
Opt_D_dump_cpranal :: DumpFlag
Opt_D_dump_cpr_signatures :: DumpFlag
Opt_D_dump_tc :: DumpFlag
Opt_D_dump_tc_ast :: DumpFlag
Opt_D_dump_hie :: DumpFlag
Opt_D_dump_types :: DumpFlag
Opt_D_dump_rules :: DumpFlag
Opt_D_dump_cse :: DumpFlag
Opt_D_dump_worker_wrapper :: DumpFlag
Opt_D_dump_rn_trace :: DumpFlag
Opt_D_dump_rn_stats :: DumpFlag
Opt_D_dump_opt_cmm :: DumpFlag
Opt_D_dump_simpl_stats :: DumpFlag
Opt_D_dump_cs_trace :: DumpFlag
Opt_D_dump_tc_trace :: DumpFlag
Opt_D_dump_ec_trace :: DumpFlag
Opt_D_dump_if_trace :: DumpFlag
Opt_D_dump_vt_trace :: DumpFlag
Opt_D_dump_splices :: DumpFlag
Opt_D_th_dec_file :: DumpFlag
Opt_D_dump_BCOs :: DumpFlag
Opt_D_dump_ticked :: DumpFlag
Opt_D_dump_rtti :: DumpFlag
Opt_D_source_stats :: DumpFlag
Opt_D_verbose_stg2stg :: DumpFlag
Opt_D_dump_hi :: DumpFlag
Opt_D_dump_hi_diffs :: DumpFlag
Opt_D_dump_mod_cycles :: DumpFlag
Opt_D_dump_mod_map :: DumpFlag
Opt_D_dump_timings :: DumpFlag
Opt_D_dump_view_pattern_commoning :: DumpFlag
Opt_D_verbose_core2core :: DumpFlag
Opt_D_dump_debug :: DumpFlag
Opt_D_dump_json :: DumpFlag
Opt_D_ppr_debug :: DumpFlag
Opt_D_no_debug_output :: DumpFlag
Opt_D_dump_faststrings :: DumpFlag
optimisationFlags :: EnumSet GeneralFlag
-- | Flag to see whether we're type-checking terms or kind-checking types
data TypeOrKind
TypeLevel :: TypeOrKind
KindLevel :: TypeOrKind
data TupleSort
BoxedTuple :: TupleSort
UnboxedTuple :: TupleSort
ConstraintTuple :: TupleSort
data TopLevelFlag
TopLevel :: TopLevelFlag
NotTopLevel :: TopLevelFlag
data TailCallInfo
AlwaysTailCalled :: JoinArity -> TailCallInfo
NoTailCallInfo :: TailCallInfo
data SwapFlag
NotSwapped :: SwapFlag
IsSwapped :: SwapFlag
data SuccessFlag
Succeeded :: SuccessFlag
Failed :: SuccessFlag
data SpliceExplicitFlag
-- | = $(f x y)
ExplicitSplice :: SpliceExplicitFlag
-- | = f x y, i.e. a naked top level expression
ImplicitSplice :: SpliceExplicitFlag
type RuleName = FastString
-- | Rule Match Information
data RuleMatchInfo
ConLike :: RuleMatchInfo
FunLike :: RuleMatchInfo
-- | Representation Arity
--
-- The number of represented arguments that can be applied to a value
-- before it does "real work". So: fib 100 has representation arity 0 x
-- -> fib x has representation arity 1 (# x, y #) -> fib (x + y)
-- has representation arity 2
type RepArity = Int
-- | Recursivity Flag
data RecFlag
Recursive :: RecFlag
NonRecursive :: RecFlag
-- | Is a TyCon a promoted data constructor or just a normal type
-- constructor?
data PromotionFlag
NotPromoted :: PromotionFlag
IsPromoted :: PromotionFlag
-- | A general-purpose pretty-printing precedence type.
newtype PprPrec
PprPrec :: Int -> PprPrec
-- | Phase Number
type PhaseNum = Int
data OverlapMode
-- | This instance must not overlap another NoOverlap instance.
-- However, it may be overlapped by Overlapping instances, and it
-- may overlap Overlappable instances.
NoOverlap :: SourceText -> OverlapMode
-- | Silently ignore this instance if you find a more specific one that
-- matches the constraint you are trying to resolve
--
-- Example: constraint (Foo [Int]) instance Foo [Int] instance {-#
-- OVERLAPPABLE #-} Foo [a]
--
-- Since the second instance has the Overlappable flag, the first
-- instance will be chosen (otherwise its ambiguous which to choose)
Overlappable :: SourceText -> OverlapMode
-- | Silently ignore any more general instances that may be used to solve
-- the constraint.
--
-- Example: constraint (Foo [Int]) instance {-# OVERLAPPING #-} Foo [Int]
-- instance Foo [a]
--
-- Since the first instance has the Overlapping flag, the second---more
-- general---instance will be ignored (otherwise it is ambiguous which to
-- choose)
Overlapping :: SourceText -> OverlapMode
-- | Equivalent to having both Overlapping and Overlappable
-- flags.
Overlaps :: SourceText -> OverlapMode
-- | Behave like Overlappable and Overlapping, and in addition pick an
-- arbitrary one if there are multiple matching candidates, and don't
-- worry about later instantiation
--
-- Example: constraint (Foo [b]) instance {-# INCOHERENT -} Foo [Int]
-- instance Foo [a] Without the Incoherent flag, we'd complain that
-- instantiating b would change which instance was chosen. See
-- also note [Incoherent instances] in GHC.Core.InstEnv
Incoherent :: SourceText -> OverlapMode
-- | The semantics allowed for overlapping instances for a particular
-- instance. See Note [Safe Haskell isSafeOverlap] (in
-- GHC.Core.InstEnv) for a explanation of the isSafeOverlap
-- field.
--
--
data OverlapFlag
OverlapFlag :: OverlapMode -> Bool -> OverlapFlag
[overlapMode] :: OverlapFlag -> OverlapMode
[isSafeOverlap] :: OverlapFlag -> Bool
data Origin
FromSource :: Origin
Generated :: Origin
-- | If the Id is a lambda-bound variable then it may have
-- lambda-bound variable info. Sometimes we know whether the lambda
-- binding this variable is a "one-shot" lambda; that is, whether it is
-- applied at most once.
--
-- This information may be useful in optimisation, as computations may
-- safely be floated inside such a lambda without risk of duplicating
-- work.
--
-- See also Note [OneShotInfo overview] above.
data OneShotInfo
-- | No information
NoOneShotInfo :: OneShotInfo
-- | The lambda is applied at most once.
OneShotLam :: OneShotInfo
-- | identifier Occurrence Information
data OccInfo
-- | There are many occurrences, or unknown occurrences
ManyOccs :: !TailCallInfo -> OccInfo
[occ_tail] :: OccInfo -> !TailCallInfo
-- | Marks unused variables. Sometimes useful for lambda and case-bound
-- variables.
IAmDead :: OccInfo
-- | Occurs exactly once (per branch), not inside a rule
OneOcc :: !InsideLam -> {-# UNPACK #-} !BranchCount -> !InterestingCxt -> !TailCallInfo -> OccInfo
[occ_in_lam] :: OccInfo -> !InsideLam
[occ_n_br] :: OccInfo -> {-# UNPACK #-} !BranchCount
[occ_int_cxt] :: OccInfo -> !InterestingCxt
[occ_tail] :: OccInfo -> !TailCallInfo
-- | This identifier breaks a loop of mutually recursive functions. The
-- field marks whether it is only a loop breaker due to a reference in a
-- rule
IAmALoopBreaker :: !RulesOnly -> !TailCallInfo -> OccInfo
[occ_rules_only] :: OccInfo -> !RulesOnly
[occ_tail] :: OccInfo -> !TailCallInfo
data LeftOrRight
CLeft :: LeftOrRight
CRight :: LeftOrRight
-- | The number of arguments that a join point takes. Unlike the arity of a
-- function, this is a purely syntactic property and is fixed when the
-- join point is created (or converted from a value). Both type and value
-- arguments are counted.
type JoinArity = Int
-- | Interesting Context
data InterestingCxt
-- | Function: is applied Data value: scrutinised by a case with at least
-- one non-DEFAULT branch
IsInteresting :: InterestingCxt
NotInteresting :: InterestingCxt
-- | An integer or infinity
data IntWithInf
-- | Inside Lambda
data InsideLam
-- | Occurs inside a non-linear lambda Substituting a redex for this
-- occurrence is dangerous because it might duplicate work.
IsInsideLam :: InsideLam
NotInsideLam :: InsideLam
-- | Inline Specification
data InlineSpec
Inline :: InlineSpec
Inlinable :: InlineSpec
NoInline :: InlineSpec
NoUserInlinePrag :: InlineSpec
data InlinePragma
InlinePragma :: SourceText -> InlineSpec -> Maybe Arity -> Activation -> RuleMatchInfo -> InlinePragma
[inl_src] :: InlinePragma -> SourceText
[inl_inline] :: InlinePragma -> InlineSpec
[inl_sat] :: InlinePragma -> Maybe Arity
[inl_act] :: InlinePragma -> Activation
[inl_rule] :: InlinePragma -> RuleMatchInfo
data FunctionOrData
IsFunction :: FunctionOrData
IsData :: FunctionOrData
-- | FullArgCount is the number of type or value arguments in an
-- application, or the number of type or value binders in a lambda. Note:
-- it includes both type and value arguments!
type FullArgCount = Int
-- | Embedding Projection pair
data EP a
EP :: a -> a -> EP a
[fromEP] :: EP a -> a
[toEP] :: EP a -> a
-- | Default Method Specification
data DefMethSpec ty
VanillaDM :: DefMethSpec ty
GenericDM :: ty -> DefMethSpec ty
-- | A *zero-indexed* constructor tag
type ConTagZ = Int
-- | A *one-index* constructor tag
--
-- Type of the tags associated with each constructor possibility or
-- superclass selector
type ConTag = Int
data CompilerPhase
InitialPhase :: CompilerPhase
Phase :: PhaseNum -> CompilerPhase
FinalPhase :: CompilerPhase
type BranchCount = Int
data Boxity
Boxed :: Boxity
Unboxed :: Boxity
-- | The number of value arguments that can be applied to a value before it
-- does "real work". So: fib 100 has arity 0 x -> fib x has arity 1
-- See also Note [Definition of arity] in GHC.Core.Opt.Arity
type Arity = Int
-- | A power-of-two alignment
data Alignment
data Activation
AlwaysActive :: Activation
ActiveBefore :: SourceText -> PhaseNum -> Activation
ActiveAfter :: SourceText -> PhaseNum -> Activation
FinalActive :: Activation
NeverActive :: Activation
zapOccTailCallInfo :: OccInfo -> OccInfo
zapFragileOcc :: OccInfo -> OccInfo
worstOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
weakLoopBreaker :: OccInfo
unSwap :: SwapFlag -> (a -> a -> b) -> a -> a -> b
tupleSortBoxity :: TupleSort -> Boxity
tupleParens :: TupleSort -> SDoc -> SDoc
-- | Turn a positive number into an IntWithInf, where 0 represents
-- infinity
treatZeroAsInf :: Int -> IntWithInf
topPrec :: PprPrec
tailCallInfo :: OccInfo -> TailCallInfo
sumParens :: SDoc -> SDoc
successIf :: Bool -> SuccessFlag
succeeded :: SuccessFlag -> Bool
strongLoopBreaker :: OccInfo
starPrec :: PprPrec
sigPrec :: PprPrec
setOverlapModeMaybe :: OverlapFlag -> Maybe OverlapMode -> OverlapFlag
setInlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo -> InlinePragma
setInlinePragmaActivation :: InlinePragma -> Activation -> InlinePragma
seqOccInfo :: OccInfo -> ()
pprRuleName :: RuleName -> SDoc
pprInlineDebug :: InlinePragma -> SDoc
pprInline :: InlinePragma -> SDoc
-- | Pretty print an alternative in an unboxed sum e.g. "| a | |".
pprAlternative :: (a -> SDoc) -> a -> ConTag -> Arity -> SDoc
pickLR :: LeftOrRight -> (a, a) -> a
opPrec :: PprPrec
oneBranch :: BranchCount
noUserInlineSpec :: InlineSpec -> Bool
-- | It is always safe to assume that an Id has no lambda-bound
-- variable information
noOneShotInfo :: OneShotInfo
noOccInfo :: OccInfo
neverInlinePragma :: InlinePragma
-- | Inject any integer into an IntWithInf
mkIntWithInf :: Int -> IntWithInf
mkAlignment :: Int -> Alignment
maybeParen :: PprPrec -> PprPrec -> SDoc -> SDoc
isWeakLoopBreaker :: OccInfo -> Bool
isTypeLevel :: TypeOrKind -> Bool
isTopLevel :: TopLevelFlag -> Bool
isSwapped :: SwapFlag -> Bool
isStrongLoopBreaker :: OccInfo -> Bool
isRec :: RecFlag -> Bool
isPromoted :: PromotionFlag -> Bool
isOneShotInfo :: OneShotInfo -> Bool
isOneOcc :: OccInfo -> Bool
isNotTopLevel :: TopLevelFlag -> Bool
isNonRec :: RecFlag -> Bool
isNoOccInfo :: OccInfo -> Bool
isNeverActive :: Activation -> Bool
isManyOccs :: OccInfo -> Bool
isKindLevel :: TypeOrKind -> Bool
isInlinePragma :: InlinePragma -> Bool
isInlinablePragma :: InlinePragma -> Bool
isGenerated :: Origin -> Bool
isFunLike :: RuleMatchInfo -> Bool
isDefaultInlinePragma :: InlinePragma -> Bool
isDeadOcc :: OccInfo -> Bool
isConLike :: RuleMatchInfo -> Bool
isBoxed :: Boxity -> Bool
isAnyInlinePragma :: InlinePragma -> Bool
isAlwaysTailCalled :: OccInfo -> Bool
isAlwaysActive :: Activation -> Bool
isActive :: CompilerPhase -> Activation -> Bool
intGtLimit :: Int -> IntWithInf -> Bool
inlinePragmaSpec :: InlinePragma -> InlineSpec
inlinePragmaSat :: InlinePragma -> Maybe Arity
inlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo
inlinePragmaActivation :: InlinePragma -> Activation
-- | A representation of infinity
infinity :: IntWithInf
hasOverlappingFlag :: OverlapMode -> Bool
hasOverlappableFlag :: OverlapMode -> Bool
hasNoOneShotInfo :: OneShotInfo -> Bool
hasIncoherentFlag :: OverlapMode -> Bool
funPrec :: PprPrec
flipSwap :: SwapFlag -> SwapFlag
failed :: SuccessFlag -> Bool
-- | Tags are allocated from here for real constructors or for superclass
-- selectors
fIRST_TAG :: ConTag
dfunInlinePragma :: InlinePragma
defaultInlinePragma :: InlinePragma
competesWith :: Activation -> Activation -> Bool
boxityTupleSort :: Boxity -> TupleSort
boolToRecFlag :: Bool -> RecFlag
bestOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
appPrec :: PprPrec
alwaysInlinePragma :: InlinePragma
alignmentOf :: Int -> Alignment
activeInFinalPhase :: Activation -> Bool
activateDuringFinal :: Activation
activateAfterInitial :: Activation
-- | Captures the fixity of declarations as they are parsed. This is not
-- necessarily the same as the fixity declaration, as the normal fixity
-- may be overridden using parens or backticks.
data LexicalFixity
Prefix :: LexicalFixity
Infix :: LexicalFixity
data FixityDirection
InfixL :: FixityDirection
InfixR :: FixityDirection
InfixN :: FixityDirection
data Fixity
Fixity :: SourceText -> Int -> FixityDirection -> Fixity
negateFixity :: Fixity
minPrecedence :: Int
maxPrecedence :: Int
funTyFixity :: Fixity
defaultFixity :: Fixity
compareFixity :: Fixity -> Fixity -> (Bool, Bool)
-- | Variable
--
-- Essentially a typed Name, that may also contain some additional
-- information about the Var and its use sites.
data Var
-- | Type or kind Variable
type TyVar = Var
-- | Type or Coercion Variable
type TyCoVar = Id
-- | Whether an Invisible argument may appear in source Haskell.
data Specificity
-- | the argument may not appear in source Haskell, it is only inferred.
InferredSpec :: Specificity
-- | the argument may appear in source Haskell, but isn't required.
SpecifiedSpec :: Specificity
-- | Argument Flag
--
-- Is something required to appear in source Haskell (Required),
-- permitted by request (Specified) (visible type application), or
-- prohibited entirely from appearing in source Haskell
-- (Inferred)? See Note [VarBndrs, TyCoVarBinders, TyConBinders,
-- and visibility] in GHC.Core.TyCo.Rep
data ArgFlag
Invisible :: Specificity -> ArgFlag
Required :: ArgFlag
pattern Specified :: ArgFlag
pattern Inferred :: ArgFlag
-- | The non-dependent version of ArgFlag. See Note [AnonArgFlag]
-- Appears here partly so that it's together with its friends ArgFlag and
-- ForallVisFlag, but also because it is used in IfaceType, rather early
-- in the compilation chain
data AnonArgFlag
-- | Used for (->): an ordinary non-dependent arrow. The
-- argument is visible in source code.
VisArg :: AnonArgFlag
-- | Used for (=>): a non-dependent predicate arrow. The
-- argument is invisible in source code.
InvisArg :: AnonArgFlag
-- | A unit key in the database
newtype UnitKey
UnitKey :: FastString -> UnitKey
type ModuleWithIsBoot = GenWithIsBoot Module
type ModuleNameWithIsBoot = GenWithIsBoot ModuleName
-- | Class for types that are used as unit identifiers (UnitKey, UnitId,
-- Unit)
--
-- We need this class because we create new unit ids for virtual units
-- (see VirtUnit) and they have to to be made from units with different
-- kinds of identifiers.
class IsUnitId u
unitFS :: IsUnitId u => u -> FastString
-- | Indicates whether a module name is referring to a boot interface
-- (hs-boot file) or regular module (hs file). We need to treat boot
-- modules specially when building compilation graphs, since they break
-- cycles. Regular source files and signature files are treated
-- equivalently.
data IsBootInterface
NotBoot :: IsBootInterface
IsBoot :: IsBootInterface
type Instantiations = GenInstantiations UnitId
type InstantiatedUnit = GenInstantiatedUnit UnitId
-- | An InstantiatedModule is a Module whose unit is
-- identified with an InstantiatedUnit.
type InstantiatedModule = GenModule InstantiatedUnit
-- | A InstalledModule is a Module whose unit is identified
-- with an UnitId.
type InstalledModule = GenModule UnitId
-- | This data type just pairs a value mod with an IsBootInterface
-- flag. In practice, mod is usually a Module or
-- ModuleName'.
data GenWithIsBoot mod
GWIB :: mod -> IsBootInterface -> GenWithIsBoot mod
[gwib_mod] :: GenWithIsBoot mod -> mod
[gwib_isBoot] :: GenWithIsBoot mod -> IsBootInterface
type GenInstantiations unit = [(ModuleName, GenModule GenUnit unit)]
-- | An instantiated unit.
--
-- It identifies an indefinite library (with holes) that has been
-- instantiated.
--
-- This unit may be indefinite or not (i.e. with remaining holes or not).
-- If it is definite, we don't know if it has already been compiled and
-- installed in a database. Nevertheless, we have a mechanism called
-- "improvement" to try to match a fully instantiated unit with existing
-- compiled and installed units: see Note [VirtUnit to RealUnit
-- improvement].
--
-- An indefinite unit identifier pretty-prints to something like
-- p[H=H,A=aimpl:A>] (p is the
-- IndefUnitId, and the brackets enclose the module substitution).
data GenInstantiatedUnit unit
InstantiatedUnit :: !FastString -> !Unique -> !Indefinite unit -> !GenInstantiations unit -> UniqDSet ModuleName -> GenInstantiatedUnit unit
-- | A private, uniquely identifying representation of an InstantiatedUnit.
-- This string is completely private to GHC and is just used to get a
-- unique.
[instUnitFS] :: GenInstantiatedUnit unit -> !FastString
-- | Cached unique of unitFS.
[instUnitKey] :: GenInstantiatedUnit unit -> !Unique
-- | The indefinite unit being instantiated.
[instUnitInstanceOf] :: GenInstantiatedUnit unit -> !Indefinite unit
-- | The sorted (by ModuleName) instantiations of this unit.
[instUnitInsts] :: GenInstantiatedUnit unit -> !GenInstantiations unit
-- | A cache of the free module holes of instUnitInsts. This lets us
-- efficiently tell if a InstantiatedUnit has been fully
-- instantiated (empty set of free module holes) and whether or not a
-- substitution can have any effect.
[instUnitHoles] :: GenInstantiatedUnit unit -> UniqDSet ModuleName
-- | A definite unit (i.e. without any free module hole)
newtype Definite unit
Definite :: unit -> Definite unit
[unDefinite] :: Definite unit -> unit
-- | A DefUnitId is an UnitId with the invariant that it only
-- refers to a definite library; i.e., one we have generated code for.
type DefUnitId = Definite UnitId
wiredInUnitIds :: [UnitId]
-- | Return the virtual UnitId of an on-the-fly instantiated unit.
virtualUnitId :: InstantiatedUnit -> UnitId
unitString :: IsUnitId u => u -> String
-- | A Unit is definite if it has no free holes.
unitIsDefinite :: Unit -> Bool
unitIdString :: UnitId -> String
-- | Retrieve the set of free module holes of a Unit.
unitFreeModuleHoles :: GenUnit u -> UniqDSet ModuleName
-- | Return the UnitId of the Unit. For on-the-fly instantiated units,
-- return the UnitId of the indefinite unit this unit is an instance of.
toUnitId :: Unit -> UnitId
thisGhcUnitId :: UnitId
thisGhcUnit :: Unit
thUnitId :: UnitId
thUnit :: Unit
stringToUnitId :: String -> UnitId
stringToUnit :: String -> Unit
-- | Compares unit ids lexically, rather than by their Uniques
stableUnitCmp :: Unit -> Unit -> Ordering
rtsUnitId :: UnitId
rtsUnit :: Unit
primUnitId :: UnitId
primUnit :: Unit
pprInstantiatedModule :: InstantiatedModule -> SDoc
-- | Calculate the free holes of a Module. If this set is non-empty,
-- this module was defined in an indefinite library that had required
-- signatures.
--
-- If a module has free holes, that means that substitutions can operate
-- on it; if it has no free holes, substituting over a module has no
-- effect.
moduleFreeHoles :: GenModule (GenUnit u) -> UniqDSet ModuleName
-- | Smart constructor for instantiated GenUnit
mkVirtUnit :: IsUnitId u => Indefinite u -> [(ModuleName, GenModule (GenUnit u))] -> GenUnit u
mkModule :: u -> ModuleName -> GenModule u
-- | Generate a uniquely identifying hash (internal unit-id) for an
-- instantiated unit.
--
-- This is a one-way function. If the indefinite unit has not been
-- instantiated at all, we return its unit-id.
--
-- This hash is completely internal to GHC and is not used for symbol
-- names or file paths. It is different from the hash Cabal would produce
-- for the same instantiated unit.
mkInstantiatedUnitHash :: IsUnitId u => Indefinite u -> [(ModuleName, GenModule (GenUnit u))] -> FastString
-- | Create a new GenInstantiatedUnit given an explicit module
-- substitution.
mkInstantiatedUnit :: IsUnitId u => Indefinite u -> GenInstantiations u -> GenInstantiatedUnit u
-- | Map over the unit identifier of unit instantiations.
mapInstantiations :: IsUnitId v => (u -> v) -> GenInstantiations u -> GenInstantiations v
-- | Map over the unit type of a GenUnit
mapGenUnit :: IsUnitId v => (u -> v) -> GenUnit u -> GenUnit v
-- | This is the package Id for the current program. It is the default
-- package Id if you don't specify a package name. We don't add this
-- prefix to symbol names, since there can be only one main package per
-- program.
mainUnitId :: UnitId
mainUnit :: Unit
isInteractiveModule :: Module -> Bool
isHoleUnit :: GenUnit u -> Bool
interactiveUnitId :: UnitId
interactiveUnit :: Unit
-- | Create a new simple unit identifier from a FastString.
-- Internally, this is primarily used to specify wired-in unit
-- identifiers.
fsToUnit :: FastString -> Unit
bignumUnitId :: UnitId
bignumUnit :: Unit
baseUnitId :: UnitId
baseUnit :: Unit
-- | Compares module names lexically, rather than by their Uniques
stableModuleNameCmp :: ModuleName -> ModuleName -> Ordering
pprModuleName :: ModuleName -> SDoc
parseModuleName :: ReadP ModuleName
moduleNameString :: ModuleName -> String
-- | Returns the string version of the module name, with dots replaced by
-- slashes.
moduleNameSlashes :: ModuleName -> String
moduleNameFS :: ModuleName -> FastString
-- | Returns the string version of the module name, with dots replaced by
-- colons.
moduleNameColons :: ModuleName -> String
mkModuleNameFS :: FastString -> ModuleName
mkModuleName :: String -> ModuleName
-- | A class allowing convenient access to the Name of various
-- datatypes
class NamedThing a
getOccName :: NamedThing a => a -> OccName
getName :: NamedThing a => a -> Name
-- | A unique, unambiguous name for something, containing information about
-- where that thing originated.
data Name
tidyNameOcc :: Name -> OccName -> Name
setNameUnique :: Name -> Unique -> Name
nameUnique :: Name -> Unique
nameOccName :: Name -> OccName
data UnhelpfulSpanReason
UnhelpfulNoLocationInfo :: UnhelpfulSpanReason
UnhelpfulWiredIn :: UnhelpfulSpanReason
UnhelpfulInteractive :: UnhelpfulSpanReason
UnhelpfulGenerated :: UnhelpfulSpanReason
UnhelpfulOther :: !FastString -> UnhelpfulSpanReason
-- | Source Span
--
-- A SrcSpan identifies either a specific portion of a text file
-- or a human-readable description of a location.
data SrcSpan
RealSrcSpan :: !RealSrcSpan -> !Maybe BufSpan -> SrcSpan
UnhelpfulSpan :: !UnhelpfulSpanReason -> SrcSpan
-- | Source Location
data SrcLoc
RealSrcLoc :: !RealSrcLoc -> !Maybe BufPos -> SrcLoc
UnhelpfulLoc :: FastString -> SrcLoc
-- | A SrcSpan delimits a portion of a text file. It could be
-- represented by a pair of (line,column) coordinates, but in fact we
-- optimise slightly by using more compact representations for
-- single-line and zero-length spans, both of which are quite common.
--
-- The end position is defined to be the column after the end of
-- the span. That is, a span of (1,1)-(1,2) is one character long, and a
-- span of (1,1)-(1,1) is zero characters long.
--
-- Real Source Span
data RealSrcSpan
-- | Real Source Location
--
-- Represents a single point within a file
data RealSrcLoc
type RealLocated = GenLocated RealSrcSpan
data PsSpan
PsSpan :: !RealSrcSpan -> !BufSpan -> PsSpan
[psRealSpan] :: PsSpan -> !RealSrcSpan
[psBufSpan] :: PsSpan -> !BufSpan
type PsLocated = GenLocated PsSpan
-- | A location as produced by the parser. Consists of two components:
--
--
-- - The location in the file, adjusted for #line and {-# LINE ... #-}
-- pragmas (RealSrcLoc)
-- - The location in the string buffer (BufPos) with monotonicity
-- guarantees (see #17632)
--
data PsLoc
PsLoc :: !RealSrcLoc -> !BufPos -> PsLoc
[psRealLoc] :: PsLoc -> !RealSrcLoc
[psBufPos] :: PsLoc -> !BufPos
type Located = GenLocated SrcSpan
-- | Layout information for declarations.
data LayoutInfo
-- | Explicit braces written by the user.
--
--
-- class C a where { foo :: a; bar :: a }
--
ExplicitBraces :: LayoutInfo
-- | Virtual braces inserted by the layout algorithm.
--
--
-- class C a where
-- foo :: a
-- bar :: a
--
VirtualBraces :: !Int -> LayoutInfo
-- | Empty or compiler-generated blocks do not have layout information
-- associated with them.
NoLayoutInfo :: LayoutInfo
-- | We attach SrcSpans to lots of things, so let's have a datatype for it.
data GenLocated l e
L :: l -> e -> GenLocated l e
-- | StringBuffer Source Span
data BufSpan
BufSpan :: {-# UNPACK #-} !BufPos -> {-# UNPACK #-} !BufPos -> BufSpan
[bufSpanStart] :: BufSpan -> {-# UNPACK #-} !BufPos
[bufSpanEnd] :: BufSpan -> {-# UNPACK #-} !BufPos
-- | 0-based offset identifying the raw location in the
-- StringBuffer.
--
-- The lexer increments the BufPos every time a character (UTF-8
-- code point) is read from the input buffer. As UTF-8 is a
-- variable-length encoding and StringBuffer needs a byte offset
-- for indexing, a BufPos cannot be used for indexing.
--
-- The parser guarantees that BufPos are monotonic. See #17632.
-- This means that syntactic constructs that appear later in the
-- StringBuffer are guaranteed to have a higher BufPos.
-- Constrast that with SrcLoc, which does *not* make the analogous
-- guarantee about higher line/column numbers.
--
-- This is due to #line and {-# LINE ... #-} pragmas that can arbitrarily
-- modify SrcLoc. Notice how setSrcLoc and
-- resetAlrLastLoc in GHC.Parser.Lexer update
-- PsLoc, modifying SrcLoc but preserving BufPos.
--
-- Monotonicity makes BufPos useful to determine the order in
-- which syntactic elements appear in the source. Consider this example
-- (haddockA041 in the test suite):
--
-- haddockA041.hs {-# LANGUAGE CPP #-} -- | Module header documentation
-- module Comments_and_CPP_include where #include "IncludeMe.hs"
--
-- IncludeMe.hs: -- | Comment on T data T = MkT -- ^ Comment on MkT
--
-- After the C preprocessor runs, the StringBuffer will contain
-- a program that looks like this (unimportant lines at the beginning
-- removed):
--
-- # 1 "haddockA041.hs" {-# LANGUAGE CPP #-} -- | Module header
-- documentation module Comments_and_CPP_include where # 1 "IncludeMe.hs"
-- 1 -- | Comment on T data T = MkT -- ^ Comment on MkT # 7
-- "haddockA041.hs" 2
--
-- The line pragmas inserted by CPP make the error messages more
-- informative. The downside is that we can't use RealSrcLoc to determine
-- the ordering of syntactic elements.
--
-- With RealSrcLoc, we have the following location information recorded
-- in the AST: * The module name is located at haddockA041.hs:3:8-31 *
-- The Haddock comment "Comment on T" is located at IncludeMe:1:1-17 *
-- The data declaration is located at IncludeMe.hs:2:1-32
--
-- Is the Haddock comment located between the module name and the data
-- declaration? This is impossible to tell because the locations are not
-- comparable; they even refer to different files.
--
-- On the other hand, with BufPos, we have the following location
-- information: * The module name is located at 846-870 * The Haddock
-- comment "Comment on T" is located at 898-915 * The data declaration is
-- located at 916-928
--
-- Aside: if you're wondering why the numbers are so high, try running
-- ghc -E haddockA041.hs and see the extra fluff that CPP
-- inserts at the start of the file.
--
-- For error messages, BufPos is not useful at all. On the other
-- hand, this is exactly what we need to determine the order of syntactic
-- elements: 870 < 898, therefore the Haddock comment appears *after*
-- the module name. 915 < 916, therefore the Haddock comment appears
-- *before* the data declaration.
--
-- We use BufPos in in GHC.Parser.PostProcess.Haddock to associate
-- Haddock comments with parts of the AST using location information
-- (#17544).
newtype BufPos
BufPos :: Int -> BufPos
[bufPos] :: BufPos -> Int
-- | Built-in "bad" SrcSpans for common sources of location
-- uncertainty
wiredInSrcSpan :: SrcSpan
unhelpfulSpanFS :: UnhelpfulSpanReason -> FastString
unRealSrcSpan :: RealLocated a -> a
unLoc :: GenLocated l e -> e
srcSpanToRealSrcSpan :: SrcSpan -> Maybe RealSrcSpan
srcSpanStartLine :: RealSrcSpan -> Int
srcSpanStartCol :: RealSrcSpan -> Int
-- | Returns the location at the start of the SrcSpan or a "bad"
-- SrcSpan if that is unavailable
srcSpanStart :: SrcSpan -> SrcLoc
-- | Convert a SrcSpan into one that represents only its first character
srcSpanFirstCharacter :: SrcSpan -> SrcSpan
-- | Obtains the filename for a SrcSpan if it is "good"
srcSpanFileName_maybe :: SrcSpan -> Maybe FastString
srcSpanEndLine :: RealSrcSpan -> Int
srcSpanEndCol :: RealSrcSpan -> Int
-- | Returns the location at the end of the SrcSpan or a "bad"
-- SrcSpan if that is unavailable
srcSpanEnd :: SrcSpan -> SrcLoc
-- | Create a SrcSpan corresponding to a single point
srcLocSpan :: SrcLoc -> SrcSpan
-- | Raises an error when used on a "bad" SrcLoc
srcLocLine :: RealSrcLoc -> Int
-- | Gives the filename of the SrcLoc
srcLocFile :: RealSrcLoc -> FastString
-- | Raises an error when used on a "bad" SrcLoc
srcLocCol :: RealSrcLoc -> Int
-- | Determines whether a span encloses a given line and column index
spans :: SrcSpan -> (Int, Int) -> Bool
sortRealLocated :: [RealLocated a] -> [RealLocated a]
sortLocated :: [Located a] -> [Located a]
-- | Strategies for ordering SrcSpans
rightmost_smallest :: SrcSpan -> SrcSpan -> Ordering
realSrcSpanStart :: RealSrcSpan -> RealSrcLoc
realSrcSpanEnd :: RealSrcSpan -> RealSrcLoc
realSrcLocSpan :: RealSrcLoc -> RealSrcSpan
psSpanStart :: PsSpan -> PsLoc
psSpanEnd :: PsSpan -> PsLoc
pprUserSpan :: Bool -> SrcSpan -> SDoc
pprUserRealSpan :: Bool -> RealSrcSpan -> SDoc
pprUnhelpfulSpanReason :: UnhelpfulSpanReason -> SDoc
pprLocated :: (Outputable l, Outputable e) => GenLocated l e -> SDoc
-- | Built-in "bad" SrcSpans for common sources of location
-- uncertainty
noSrcSpan :: SrcSpan
-- | Built-in "bad" SrcLoc values for particular locations
noSrcLoc :: SrcLoc
noLoc :: e -> Located e
mkSrcSpanPs :: PsSpan -> SrcSpan
-- | Create a SrcSpan between two points in a file
mkSrcSpan :: SrcLoc -> SrcLoc -> SrcSpan
mkSrcLoc :: FastString -> Int -> Int -> SrcLoc
-- | Create a SrcSpan between two points in a file
mkRealSrcSpan :: RealSrcLoc -> RealSrcLoc -> RealSrcSpan
mkRealSrcLoc :: FastString -> Int -> Int -> RealSrcLoc
mkPsSpan :: PsLoc -> PsLoc -> PsSpan
-- | Create a "bad" SrcSpan that has not location information
mkGeneralSrcSpan :: FastString -> SrcSpan
-- | Creates a "bad" SrcLoc that has no detailed information about
-- its location
mkGeneralSrcLoc :: FastString -> SrcLoc
mkGeneralLocated :: String -> e -> Located e
mapLoc :: (a -> b) -> GenLocated l a -> GenLocated l b
lookupSrcSpan :: SrcSpan -> Map RealSrcSpan a -> Maybe a
lookupSrcLoc :: SrcLoc -> Map RealSrcLoc a -> Maybe a
liftL :: Monad m => (a -> m b) -> GenLocated l a -> m (GenLocated l b)
-- | Strategies for ordering SrcSpans
leftmost_smallest :: SrcSpan -> SrcSpan -> Ordering
-- | Strategies for ordering SrcSpans
leftmost_largest :: SrcSpan -> SrcSpan -> Ordering
-- | Indentation level is 1-indexed, so the leftmost column is 1.
leftmostColumn :: Int
-- | True if the span has a width of zero, as returned for "virtual"
-- semicolons in the lexer. For "bad" SrcSpan, it returns False
isZeroWidthSpan :: SrcSpan -> Bool
-- | Determines whether a span is enclosed by another one
isSubspanOf :: SrcSpan -> SrcSpan -> Bool
-- | Determines whether a span is enclosed by another one
isRealSubspanOf :: RealSrcSpan -> RealSrcSpan -> Bool
-- | True if the span is known to straddle only one line. For "bad"
-- SrcSpan, it returns False
isOneLineSpan :: SrcSpan -> Bool
-- | Test if a SrcSpan is "good", i.e. has precise location
-- information
isGoodSrcSpan :: SrcSpan -> Bool
isGeneratedSrcSpan :: SrcSpan -> Bool
-- | Built-in "bad" SrcSpans for common sources of location
-- uncertainty
interactiveSrcSpan :: SrcSpan
-- | Built-in "bad" SrcLoc values for particular locations
interactiveSrcLoc :: SrcLoc
getRealSrcSpan :: RealLocated a -> RealSrcSpan
getLoc :: GenLocated l e -> l
getBufSpan :: SrcSpan -> Maybe BufSpan
getBufPos :: SrcLoc -> Maybe BufPos
-- | Built-in "bad" SrcSpans for common sources of location
-- uncertainty
generatedSrcSpan :: SrcSpan
-- | Built-in "bad" SrcLoc values for particular locations
generatedSrcLoc :: SrcLoc
-- | Tests whether the two located things are equal
eqLocated :: Eq a => GenLocated l a -> GenLocated l a -> Bool
-- | Tests whether the first span "contains" the other span, meaning that
-- it covers at least as much source code. True where spans are equal.
containsSpan :: RealSrcSpan -> RealSrcSpan -> Bool
-- | Combines two SrcSpan into one that spans at least all the
-- characters within both spans. Returns UnhelpfulSpan if the files
-- differ.
combineSrcSpans :: SrcSpan -> SrcSpan -> SrcSpan
-- | Combines two SrcSpan into one that spans at least all the
-- characters within both spans. Assumes the "file" part is the same in
-- both inputs
combineRealSrcSpans :: RealSrcSpan -> RealSrcSpan -> RealSrcSpan
combineLocs :: Located a -> Located b -> SrcSpan
-- | Tests the ordering of the two located things
cmpLocated :: Ord a => GenLocated l a -> GenLocated l a -> Ordering
-- | Compare the BufSpan of two located things.
--
-- Precondition: both operands have an associated BufSpan.
cmpBufSpan :: HasDebugCallStack => Located a -> Located a -> Ordering
-- | Move the SrcLoc down by one line if the character is a newline,
-- to the next 8-char tabstop if it is a tab, and across by one character
-- in any other case
advanceSrcLoc :: RealSrcLoc -> Char -> RealSrcLoc
advancePsLoc :: PsLoc -> Char -> PsLoc
advanceBufPos :: BufPos -> BufPos
-- | Combine locations from two Located things and add them to a
-- third thing
addCLoc :: Located a -> Located b -> c -> Located c
-- | A non-deterministic set of FastStrings. See Note [Deterministic
-- UniqFM] in GHC.Types.Unique.DFM for explanation why it's not
-- deterministic and why it matters. Use DFastStringEnv if the set
-- eventually gets converted into a list or folded over in a way where
-- the order changes the generated code.
type FastStringEnv a = UniqFM FastString a
mkFsEnv :: [(FastString, a)] -> FastStringEnv a
lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
emptyFsEnv :: FastStringEnv a
-- | Unique Supply
--
-- A value of type UniqSupply is unique, and it can supply
-- one distinct Unique. Also, from the supply, one can also
-- manufacture an arbitrary number of further UniqueSupply
-- values, which will be distinct from the first and from all others.
data UniqSupply
-- | A monad which just gives the ability to obtain Uniques
data UniqSM result
-- | A monad for generating unique identifiers
class Monad m => MonadUnique (m :: Type -> Type)
-- | Get a new UniqueSupply
getUniqueSupplyM :: MonadUnique m => m UniqSupply
-- | Get a new unique identifier
getUniqueM :: MonadUnique m => m Unique
-- | Get an infinite list of new unique identifiers
getUniquesM :: MonadUnique m => m [Unique]
-- | Obtain an infinite list of Unique that can be generated by
-- constant splitting of the supply
uniqsFromSupply :: UniqSupply -> [Unique]
-- | Obtain the Unique from this particular UniqSupply
uniqFromSupply :: UniqSupply -> Unique
uniqFromMask :: Char -> IO Unique
-- | Obtain the Unique from this particular UniqSupply, and a
-- new supply
takeUniqFromSupply :: UniqSupply -> (Unique, UniqSupply)
-- | Build two UniqSupply from a single one, each of which can
-- supply its own Unique.
splitUniqSupply :: UniqSupply -> (UniqSupply, UniqSupply)
-- | Create a unique supply out of thin air. The "mask" (Char) supplied is
-- purely cosmetic, making it easier to figure out where a Unique was
-- born. See Note [Uniques and masks].
--
-- The payload part of the Uniques allocated from this UniqSupply are
-- guaranteed distinct wrt all other supplies, regardless of their
-- "mask". This is achieved by allocating the payload part from a single
-- source of Uniques, namely genSym, shared across all
-- UniqSupply's.
mkSplitUniqSupply :: Char -> IO UniqSupply
-- | Create an infinite list of UniqSupply from a single one
listSplitUniqSupply :: UniqSupply -> [UniqSupply]
-- | Run the UniqSM action, discarding the final UniqSupply
initUs_ :: UniqSupply -> UniqSM a -> a
-- | Run the UniqSM action, returning the final UniqSupply
initUs :: UniqSupply -> UniqSM a -> (a, UniqSupply)
initUniqSupply :: Word -> Int -> IO ()
-- | Unique identifier.
--
-- The type of unique identifiers that are used in many places in GHC for
-- fast ordering and equality tests. You should generate these with the
-- functions from the UniqSupply module
--
-- These are sometimes also referred to as "keys" in comments in GHC.
data Unique
-- | Class of things that we can obtain a Unique from
class Uniquable a
getUnique :: Uniquable a => a -> Unique
hasKey :: Uniquable a => a -> Unique -> Bool
-- | For a given package, we need to know whether to print it with the
-- component id to disambiguate it.
type QueryQualifyPackage = Unit -> Bool
-- | Given a Name's Module and OccName, decide
-- whether and how to qualify it.
type QueryQualifyName = Module -> OccName -> QualifyName
-- | For a given module, we need to know whether to print it with a package
-- name to disambiguate it.
type QueryQualifyModule = Module -> Bool
data QualifyName
NameUnqual :: QualifyName
NameQual :: ModuleName -> QualifyName
NameNotInScope1 :: QualifyName
NameNotInScope2 :: QualifyName
-- | When printing code that contains original names, we need to map the
-- original names back to something the user understands. This is the
-- purpose of the triple of functions that gets passed around when
-- rendering SDoc.
data PrintUnqualified
QueryQualify :: QueryQualifyName -> QueryQualifyModule -> QueryQualifyPackage -> PrintUnqualified
[queryQualifyName] :: PrintUnqualified -> QueryQualifyName
[queryQualifyModule] :: PrintUnqualified -> QueryQualifyModule
[queryQualifyPackage] :: PrintUnqualified -> QueryQualifyPackage
-- | Wrapper for types having a Outputable instance when an OutputableP
-- instance is required.
newtype PDoc a
PDoc :: a -> PDoc a
-- | Outputable class with an additional environment value
--
-- See Note [The OutputableP class]
class OutputableP env a
pdoc :: OutputableP env a => env -> a -> SDoc
-- | When we print a binder, we often want to print its type too. The
-- OutputableBndr class encapsulates this idea.
class Outputable a => OutputableBndr a
pprBndr :: OutputableBndr a => BindingSite -> a -> SDoc
pprPrefixOcc :: OutputableBndr a => a -> SDoc
pprInfixOcc :: OutputableBndr a => a -> SDoc
bndrIsJoin_maybe :: OutputableBndr a => a -> Maybe Int
-- | Class designating that some type has an SDoc representation
class Outputable a
ppr :: Outputable a => a -> SDoc
-- | Style of label pretty-printing.
--
-- When we produce C sources or headers, we have to take into account
-- that C compilers transform C labels when they convert them into
-- symbols. For example, they can add prefixes (e.g., "_" on Darwin) or
-- suffixes (size for stdcalls on Windows). So we provide two ways to
-- pretty-print CLabels: C style or Asm style.
data LabelStyle
-- | C label style (used by C and LLVM backends)
CStyle :: LabelStyle
-- | Asm label style (used by NCG backend)
AsmStyle :: LabelStyle
data Depth
AllTheWay :: Depth
-- | 0 => stop
PartWay :: Int -> Depth
-- | Use sdocDefaultDepth field as depth
DefaultDepth :: Depth
-- | BindingSite is used to tell the thing that prints binder what
-- language construct is binding the identifier. This can be used to
-- decide how much info to print. Also see Note [Binding-site specific
-- printing] in GHC.Core.Ppr
data BindingSite
-- | The x in (x. e)
LambdaBind :: BindingSite
-- | The x in case scrut of x { (y,z) -> ... }
CaseBind :: BindingSite
-- | The y,z in case scrut of x { (y,z) -> ... }
CasePatBind :: BindingSite
-- | The x in (let x = rhs in e)
LetBind :: BindingSite
ztext :: FastZString -> SDoc
word :: Integer -> SDoc
withUserStyle :: PrintUnqualified -> Depth -> SDoc -> SDoc
withPprStyle :: PprStyle -> SDoc -> SDoc
withErrStyle :: PrintUnqualified -> SDoc -> SDoc
-- | Says what to do with -dppr-debug; without, return empty
whenPprDebug :: SDoc -> SDoc
-- | Concatenate SDoc vertically with dovetailing
vcat :: [SDoc] -> SDoc
vbar :: SDoc
userStyle :: PprStyle -> Bool
updSDocContext :: (SDocContext -> SDocContext) -> SDoc -> SDoc
unicodeSyntax :: SDoc -> SDoc -> SDoc
underscore :: SDoc
-- | Converts an integer to a verbal index:
--
--
-- speakNth 1 = text "first"
-- speakNth 5 = text "fifth"
-- speakNth 21 = text "21st"
--
speakNth :: Int -> SDoc
-- | Converts an integer and object description to a statement about the
-- multiplicity of those objects:
--
--
-- speakNOf 0 (text "melon") = text "no melons"
-- speakNOf 1 (text "melon") = text "one melon"
-- speakNOf 3 (text "melon") = text "three melons"
--
speakNOf :: Int -> SDoc -> SDoc
-- | Converts an integer to a verbal multiplicity:
--
--
-- speakN 0 = text "none"
-- speakN 5 = text "five"
-- speakN 10 = text "10"
--
speakN :: Int -> SDoc
space :: SDoc
showSDocUnsafe :: SDoc -> String
showSDocOneLine :: SDocContext -> SDoc -> String
showPprUnsafe :: Outputable a => a -> String
setStyleColoured :: Bool -> PprStyle -> PprStyle
-- | Separate: is either like hsep or like vcat, depending on
-- what fits
sep :: [SDoc] -> SDoc
semi :: SDoc
sdocWithContext :: (SDocContext -> SDoc) -> SDoc
sdocOption :: (SDocContext -> a) -> (a -> SDoc) -> SDoc
runSDoc :: SDoc -> SDocContext -> Doc
rparen :: SDoc
renderWithContext :: SDocContext -> SDoc -> String
reallyAlwaysQualifyNames :: QueryQualifyName
reallyAlwaysQualify :: PrintUnqualified
rbrack :: SDoc
rbrace :: SDoc
rational :: Rational -> SDoc
quotes :: SDoc -> SDoc
quotedListWithOr :: [SDoc] -> SDoc
quotedListWithNor :: [SDoc] -> SDoc
quote :: SDoc -> SDoc
queryQual :: PprStyle -> PrintUnqualified
qualPackage :: PprStyle -> QueryQualifyPackage
qualName :: PprStyle -> QueryQualifyName
qualModule :: PprStyle -> QueryQualifyModule
punctuate :: SDoc -> [SDoc] -> [SDoc]
ptext :: PtrString -> SDoc
-- | Like printSDoc but appends an extra newline.
printSDocLn :: SDocContext -> Mode -> Handle -> SDoc -> IO ()
-- | The analog of printDoc_ for SDoc, which tries to make
-- sure the terminal doesn't get screwed up by the ANSI color codes if an
-- exception is thrown during pretty-printing.
printSDoc :: SDocContext -> Mode -> Handle -> SDoc -> IO ()
primWordSuffix :: SDoc
primWord8Suffix :: SDoc
primWord64Suffix :: SDoc
primWord32Suffix :: SDoc
primWord16Suffix :: SDoc
primIntSuffix :: SDoc
primInt8Suffix :: SDoc
primInt64Suffix :: SDoc
primInt32Suffix :: SDoc
primInt16Suffix :: SDoc
primFloatSuffix :: SDoc
primDoubleSuffix :: SDoc
primCharSuffix :: SDoc
pprWithCommas :: (a -> SDoc) -> [a] -> SDoc
pprWithBars :: (a -> SDoc) -> [a] -> SDoc
pprSetDepth :: Depth -> SDoc -> SDoc
-- | Returns the comma-separated concatenation of the quoted pretty printed
-- things.
--
--
-- [x,y,z] ==> `x', `y', `z'
--
pprQuotedList :: Outputable a => [a] -> SDoc
pprPrimWord8 :: Integer -> SDoc
pprPrimWord64 :: Integer -> SDoc
pprPrimWord32 :: Integer -> SDoc
pprPrimWord16 :: Integer -> SDoc
pprPrimWord :: Integer -> SDoc
pprPrimInt8 :: Integer -> SDoc
pprPrimInt64 :: Integer -> SDoc
pprPrimInt32 :: Integer -> SDoc
pprPrimInt16 :: Integer -> SDoc
pprPrimInt :: Integer -> SDoc
-- | Special combinator for showing unboxed literals.
pprPrimChar :: Char -> SDoc
pprPrefixVar :: Bool -> SDoc -> SDoc
pprInfixVar :: Bool -> SDoc -> SDoc
-- | Special combinator for showing string literals.
pprHsString :: FastString -> SDoc
-- | Special combinator for showing character literals.
pprHsChar :: Char -> SDoc
-- | Special combinator for showing bytestring literals.
pprHsBytes :: ByteString -> SDoc
-- | Normalise, escape and render a string representing a path
--
-- e.g. "c:\whatever"
pprFilePathString :: FilePath -> SDoc
pprFastFilePath :: FastString -> SDoc
-- | Truncate a list that is longer than the current depth.
pprDeeperList :: ([SDoc] -> SDoc) -> [SDoc] -> SDoc
pprDeeper :: SDoc -> SDoc
pprCode :: LabelStyle -> SDoc -> SDoc
ppWhenOption :: (SDocContext -> Bool) -> SDoc -> SDoc
ppWhen :: Bool -> SDoc -> SDoc
ppUnlessOption :: (SDocContext -> Bool) -> SDoc -> SDoc
ppUnless :: Bool -> SDoc -> SDoc
-- | Determines the pluralisation suffix appropriate for the length of a
-- list:
--
--
-- plural [] = char 's'
-- plural ["Hello"] = empty
-- plural ["Hello", "World"] = char 's'
--
plural :: [a] -> SDoc
parens :: SDoc -> SDoc
neverQualifyPackages :: QueryQualifyPackage
neverQualifyNames :: QueryQualifyName
neverQualifyModules :: QueryQualifyModule
neverQualify :: PrintUnqualified
-- | Indent SDoc some specified amount
nest :: Int -> SDoc -> SDoc
mulArrow :: SDoc -> SDoc
mkUserStyle :: PrintUnqualified -> Depth -> PprStyle
-- | Style for printing error messages
mkErrStyle :: PrintUnqualified -> PprStyle
mkDumpStyle :: PrintUnqualified -> PprStyle
lparen :: SDoc
lollipop :: SDoc
lbrack :: SDoc
lbrace :: SDoc
larrowtt :: SDoc
larrowt :: SDoc
larrow :: SDoc
lambda :: SDoc
keyword :: SDoc -> SDoc
-- | Determines the form of possessive appropriate for the length of a
-- list:
--
--
-- itsOrTheir [x] = text "its"
-- itsOrTheir [x,y] = text "their"
-- itsOrTheir [] = text "their" -- probably avoid this
--
itsOrTheir :: [a] -> SDoc
-- | Determines the form of to be appropriate for the length of a list:
--
--
-- isOrAre [] = text "are"
-- isOrAre ["Hello"] = text "is"
-- isOrAre ["Hello", "World"] = text "are"
--
isOrAre :: [a] -> SDoc
isEmpty :: SDocContext -> SDoc -> Bool
-- | Returns the separated concatenation of the pretty printed things.
interppSP :: Outputable a => [a] -> SDoc
interpp'SP' :: (a -> SDoc) -> [a] -> SDoc
-- | Returns the comma-separated concatenation of the pretty printed
-- things.
interpp'SP :: Outputable a => [a] -> SDoc
integer :: Integer -> SDoc
intWithCommas :: Integral a => a -> SDoc
int :: Int -> SDoc
-- | Says what to do with and without -dppr-debug
ifPprDebug :: SDoc -> SDoc -> SDoc
-- | Concatenate SDoc horizontally with a space between each one
hsep :: [SDoc] -> SDoc
-- | Concatenate SDoc horizontally
hcat :: [SDoc] -> SDoc
-- | This behaves like hang, but does not indent the second document
-- when the header is empty.
hangNotEmpty :: SDoc -> Int -> SDoc -> SDoc
hang :: SDoc -> Int -> SDoc -> SDoc
getPprStyle :: (PprStyle -> SDoc) -> SDoc
-- | Indicate if -dppr-debug mode is enabled
getPprDebug :: (Bool -> SDoc) -> SDoc
ftext :: FastString -> SDoc
-- | A paragraph-fill combinator. It's much like sep, only it keeps fitting
-- things on one line until it can't fit any more.
fsep :: [SDoc] -> SDoc
forAllLit :: SDoc
float :: Float -> SDoc
-- | This behaves like fsep, but it uses <> for
-- horizontal conposition rather than <+>
fcat :: [SDoc] -> SDoc
equals :: SDoc
empty :: SDoc
dumpStyle :: PprStyle -> Bool
doubleQuotes :: SDoc -> SDoc
-- | doublePrec p n shows a floating point number n with
-- p digits of precision after the decimal point.
doublePrec :: Int -> Double -> SDoc
double :: Double -> SDoc
dot :: SDoc
docToSDoc :: Doc -> SDoc
-- | Determines the form of to do appropriate for the length of a list:
--
--
-- doOrDoes [] = text "do"
-- doOrDoes ["Hello"] = text "does"
-- doOrDoes ["Hello", "World"] = text "do"
--
doOrDoes :: [a] -> SDoc
defaultUserStyle :: PprStyle
-- | Default pretty-printing options
defaultSDocContext :: SDocContext
-- | Default style for error messages, when we don't know PrintUnqualified
-- It's a bit of a hack because it doesn't take into account what's in
-- scope Only used for desugarer warnings, and typechecker errors in
-- interface sigs
defaultErrStyle :: PprStyle
defaultDumpStyle :: PprStyle
dcolon :: SDoc
darrow :: SDoc
cparen :: Bool -> SDoc -> SDoc
comma :: SDoc
-- | Apply the given colour/style for the argument.
--
-- Only takes effect if colours are enabled.
coloured :: PprColour -> SDoc -> SDoc
colon :: SDoc
codeStyle :: PprStyle -> Bool
cmdlineParserStyle :: PprStyle
char :: Char -> SDoc
-- | Catenate: is either like hcat or like vcat, depending on
-- what fits
cat :: [SDoc] -> SDoc
bullet :: SDoc
-- | An efficient variant of printSDoc specialized for
-- LeftMode that outputs to a BufHandle.
bufLeftRenderSDoc :: SDocContext -> BufHandle -> SDoc -> IO ()
brackets :: SDoc -> SDoc
braces :: SDoc -> SDoc
blankLine :: SDoc
asmStyle :: PprStyle -> Bool
arrowtt :: SDoc
arrowt :: SDoc
arrow :: SDoc
angleBrackets :: SDoc -> SDoc
alwaysQualifyPackages :: QueryQualifyPackage
-- | NB: This won't ever show package IDs
alwaysQualifyNames :: QueryQualifyName
alwaysQualifyModules :: QueryQualifyModule
alwaysQualify :: PrintUnqualified
-- | Join two SDoc together horizontally without a gap
(<>) :: SDoc -> SDoc -> SDoc
-- | Join two SDoc together horizontally with a gap between them
(<+>) :: SDoc -> SDoc -> SDoc
-- | Join two SDoc together vertically
($+$) :: SDoc -> SDoc -> SDoc
-- | Join two SDoc together vertically; if there is no vertical
-- overlap it "dovetails" the two onto one line
($$) :: SDoc -> SDoc -> SDoc
-- | Occurrence Name
--
-- In this context that means: "classified (i.e. as a type name, value
-- name, etc) but not qualified and not yet resolved"
data OccName
-- | Other names in the compiler add additional information to an OccName.
-- This class provides a consistent way to access the underlying OccName.
class HasOccName name
occName :: HasOccName name => name -> OccName
occNameString :: OccName -> String
mkVarOccFS :: FastString -> OccName
mkRecFldSelOcc :: String -> OccName
-- | A PtrString is a pointer to some array of Latin-1 encoded
-- chars.
data PtrString
PtrString :: !Ptr Word8 -> !Int -> PtrString
-- | Non-deterministic FastString
--
-- This is a simple FastString wrapper with an Ord instance using
-- uniqCompareFS (i.e. which compares FastStrings on their
-- Uniques). Hence it is not deterministic from one run to the other.
newtype NonDetFastString
NonDetFastString :: FastString -> NonDetFastString
-- | Lexical FastString
--
-- This is a simple FastString wrapper with an Ord instance using
-- lexicalCompareFS (i.e. which compares FastStrings on their
-- String representation). Hence it is deterministic from one run to the
-- other.
newtype LexicalFastString
LexicalFastString :: FastString -> LexicalFastString
data FastZString
-- | A FastString is a UTF-8 encoded string together with a unique
-- ID. All FastStrings are stored in a global hashtable to support
-- fast O(1) comparison.
--
-- It is also associated with a lazy reference to the Z-encoding of this
-- string which is used by the compiler internally.
data FastString
FastString :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !ShortByteString -> FastZString -> FastString
[uniq] :: FastString -> {-# UNPACK #-} !Int
[n_chars] :: FastString -> {-# UNPACK #-} !Int
[fs_sbs] :: FastString -> {-# UNPACK #-} !ShortByteString
-- | Lazily computed Z-encoding of this string. See Note [Z-Encoding] in
-- GHC.Utils.Encoding.
--
-- Since FastStrings are globally memoized this is computed at
-- most once for any given string.
[fs_zenc] :: FastString -> FastZString
zString :: FastZString -> String
-- | Returns a Z-encoded version of a FastString. This might be the
-- original, if it was already Z-encoded. The first time this function is
-- applied to a particular FastString, the results are memoized.
zEncodeFS :: FastString -> FastZString
unsafeMkByteString :: String -> ByteString
-- | Decode a PtrString back into a String using Latin-1
-- encoding. This does not free the memory associated with
-- PtrString.
unpackPtrString :: PtrString -> String
-- | Unpacks and decodes the FastString
unpackFS :: FastString -> String
uniqueOfFS :: FastString -> Int
-- | Compare FastString by their Unique (not lexically).
--
-- Much cheaper than lexicalCompareFS but non-deterministic!
uniqCompareFS :: FastString -> FastString -> Ordering
unconsFS :: FastString -> Maybe (Char, FastString)
sLit :: String -> PtrString
-- | Returns True if the FastString is empty
nullFS :: FastString -> Bool
nilFS :: FastString
-- | Wrap an unboxed address into a PtrString.
mkPtrString# :: Addr# -> PtrString
-- | Encode a String into a newly allocated PtrString using
-- Latin-1 encoding. The original string must not contain non-Latin-1
-- characters (above codepoint 0xff).
mkPtrString :: String -> PtrString
-- | Create a FastString from an existing ShortByteString
-- without copying.
mkFastStringShortByteString :: ShortByteString -> FastString
mkFastStringBytes :: Ptr Word8 -> Int -> FastString
-- | Create a FastString by copying an existing ByteString
mkFastStringByteString :: ByteString -> FastString
-- | Creates a FastString from a UTF-8 encoded [Word8]
mkFastStringByteList :: [Word8] -> FastString
mkFastString# :: Addr# -> FastString
-- | Creates a UTF-8 encoded FastString from a String
mkFastString :: String -> FastString
-- | Compare FastString lexically
--
-- If you don't care about the lexical ordering, use uniqCompareFS
-- instead.
lexicalCompareFS :: FastString -> FastString -> Ordering
-- | Return the length of a PtrString
lengthPS :: PtrString -> Int
lengthFZS :: FastZString -> Int
-- | Returns the length of the FastString in characters
lengthFS :: FastString -> Int
isUnderscoreFS :: FastString -> Bool
headFS :: FastString -> Char
hPutFZS :: Handle -> FastZString -> IO ()
-- | Outputs a FastString with no decoding at all, that is,
-- you get the actual bytes in the FastString written to the
-- Handle.
hPutFS :: Handle -> FastString -> IO ()
getFastStringZEncCounter :: IO Int
getFastStringTable :: IO [[[FastString]]]
fsLit :: String -> FastString
fastZStringToByteString :: FastZString -> ByteString
fastStringToShortByteString :: FastString -> ShortByteString
-- | Gives the Modified UTF-8 encoded bytes corresponding to a
-- FastString
fastStringToByteString :: FastString -> ByteString
consFS :: Char -> FastString -> FastString
concatFS :: [FastString] -> FastString
-- | Gives the Modified UTF-8 encoded bytes corresponding to a
-- FastString
bytesFS :: FastString -> ByteString
appendFS :: FastString -> FastString -> FastString
-- | Contains not only a collection of GeneralFlags but also a
-- plethora of information relating to the compilation of a single file
-- or GHC session
data DynFlags
DynFlags :: GhcMode -> GhcLink -> !Backend -> {-# UNPACK #-} !GhcNameVersion -> {-# UNPACK #-} !FileSettings -> Platform -> {-# UNPACK #-} !ToolSettings -> {-# UNPACK #-} !PlatformMisc -> [(String, String)] -> LlvmConfig -> Int -> Int -> Int -> Int -> Int -> Maybe String -> Maybe String -> [Int] -> Maybe Int -> Bool -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Int -> Int -> Int -> Maybe Int -> Maybe Int -> Int -> Word -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Bool -> Maybe Int -> Int -> [FilePath] -> ModuleName -> Maybe String -> IntWithInf -> IntWithInf -> UnitId -> Maybe UnitId -> [(ModuleName, Module)] -> Ways -> Maybe (String, Int) -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> String -> String -> String -> String -> IORef Bool -> String -> String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> DynLibLoader -> !Bool -> Maybe FilePath -> Maybe FilePath -> [Option] -> IncludeSpecs -> [String] -> [String] -> [String] -> Maybe String -> RtsOptsEnabled -> Bool -> String -> [ModuleName] -> [(ModuleName, String)] -> [String] -> FilePath -> Bool -> Bool -> [ModuleName] -> [String] -> [PackageDBFlag] -> [IgnorePackageFlag] -> [PackageFlag] -> [PackageFlag] -> [TrustFlag] -> Maybe FilePath -> EnumSet DumpFlag -> EnumSet GeneralFlag -> EnumSet WarningFlag -> EnumSet WarningFlag -> Maybe Language -> SafeHaskellMode -> Bool -> Bool -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> [OnOff Extension] -> EnumSet Extension -> !UnfoldingOpts -> Int -> Int -> FlushOut -> FlushErr -> Maybe FilePath -> Maybe String -> [String] -> Int -> Int -> Bool -> OverridingBool -> Bool -> Scheme -> ProfAuto -> [CallerCcFilter] -> Maybe String -> IORef (ModuleEnv Int) -> Maybe SseVersion -> Maybe BmiVersion -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> IORef (Maybe LinkerInfo) -> IORef (Maybe CompilerInfo) -> Int -> Int -> Int -> Bool -> Maybe Int -> Word -> Int -> Weights -> DynFlags
[ghcMode] :: DynFlags -> GhcMode
[ghcLink] :: DynFlags -> GhcLink
-- | The backend to use (if any).
--
-- Whenever you change the backend, also make sure to set ghcLink
-- to something sensible.
--
-- NoBackend can be used to avoid generating any output, however,
-- note that:
--
--
-- - If a program uses Template Haskell the typechecker may need to run
-- code from an imported module. To facilitate this, code generation is
-- enabled for modules imported by modules that use template haskell,
-- using the default backend for the platform. See Note [-fno-code
-- mode].
--
[backend] :: DynFlags -> !Backend
[ghcNameVersion] :: DynFlags -> {-# UNPACK #-} !GhcNameVersion
[fileSettings] :: DynFlags -> {-# UNPACK #-} !FileSettings
[targetPlatform] :: DynFlags -> Platform
[toolSettings] :: DynFlags -> {-# UNPACK #-} !ToolSettings
[platformMisc] :: DynFlags -> {-# UNPACK #-} !PlatformMisc
[rawSettings] :: DynFlags -> [(String, String)]
-- | N.B. It's important that this field is lazy since we load the LLVM
-- configuration lazily. See Note [LLVM Configuration] in
-- GHC.SysTools.
[llvmConfig] :: DynFlags -> LlvmConfig
-- | Verbosity level: see Note [Verbosity levels]
[verbosity] :: DynFlags -> Int
-- | Optimisation level
[optLevel] :: DynFlags -> Int
-- | How much debug information to produce
[debugLevel] :: DynFlags -> Int
-- | Number of simplifier phases
[simplPhases] :: DynFlags -> Int
-- | Max simplifier iterations
[maxSimplIterations] :: DynFlags -> Int
[ruleCheck] :: DynFlags -> Maybe String
-- | A prefix to report inlining decisions about
[inlineCheck] :: DynFlags -> Maybe String
-- | Additional demand analysis
[strictnessBefore] :: DynFlags -> [Int]
-- | The number of modules to compile in parallel in --make mode, where
-- Nothing ==> compile as many in parallel as there are CPUs.
[parMakeCount] :: DynFlags -> Maybe Int
-- | Enable RTS timing statistics?
[enableTimeStats] :: DynFlags -> Bool
-- | The heap size to set.
[ghcHeapSize] :: DynFlags -> Maybe Int
-- | Maximum number of bindings from the type envt to show in type error
-- messages
[maxRelevantBinds] :: DynFlags -> Maybe Int
-- | Maximum number of hole fits to show in typed hole error messages
[maxValidHoleFits] :: DynFlags -> Maybe Int
-- | Maximum number of refinement hole fits to show in typed hole error
-- messages
[maxRefHoleFits] :: DynFlags -> Maybe Int
-- | Maximum level of refinement for refinement hole fits in typed hole
-- error messages
[refLevelHoleFits] :: DynFlags -> Maybe Int
-- | Maximum number of unmatched patterns to show in non-exhaustiveness
-- warnings
[maxUncoveredPatterns] :: DynFlags -> Int
-- | Soft limit on the number of models the pattern match checker checks a
-- pattern against. A safe guard against exponential blow-up.
[maxPmCheckModels] :: DynFlags -> Int
-- | Multiplier for simplifier ticks
[simplTickFactor] :: DynFlags -> Int
-- | Threshold for SpecConstr
[specConstrThreshold] :: DynFlags -> Maybe Int
-- | Max number of specialisations for any one function
[specConstrCount] :: DynFlags -> Maybe Int
-- | Max number of specialisations for recursive types Not optional;
-- otherwise ForceSpecConstr can diverge.
[specConstrRecursive] :: DynFlags -> Int
-- | Binary literals (e.g. strings) whose size is above this threshold will
-- be dumped in a binary file by the assembler code generator (0 to
-- disable)
[binBlobThreshold] :: DynFlags -> Word
-- | Threshold for LiberateCase
[liberateCaseThreshold] :: DynFlags -> Maybe Int
-- | Arg count for lambda floating See FloatOutSwitches
[floatLamArgs] :: DynFlags -> Maybe Int
-- | Maximum number of arguments after lambda lifting a recursive function.
[liftLamsRecArgs] :: DynFlags -> Maybe Int
-- | Maximum number of arguments after lambda lifting a non-recursive
-- function.
[liftLamsNonRecArgs] :: DynFlags -> Maybe Int
-- | Lambda lift even when this turns a known call into an unknown call.
[liftLamsKnown] :: DynFlags -> Bool
-- | Align Cmm functions at this boundary or use default.
[cmmProcAlignment] :: DynFlags -> Maybe Int
-- | Simplification history size
[historySize] :: DynFlags -> Int
[importPaths] :: DynFlags -> [FilePath]
[mainModuleNameIs] :: DynFlags -> ModuleName
[mainFunIs] :: DynFlags -> Maybe String
-- | Typechecker maximum stack depth
[reductionDepth] :: DynFlags -> IntWithInf
-- | Number of iterations in the constraints solver Typically only 1 is
-- needed
[solverIterations] :: DynFlags -> IntWithInf
-- | Target home unit-id
[homeUnitId_] :: DynFlags -> UnitId
-- | Id of the unit to instantiate
[homeUnitInstanceOf_] :: DynFlags -> Maybe UnitId
-- | Module instantiations
[homeUnitInstantiations_] :: DynFlags -> [(ModuleName, Module)]
-- | Target way flags from the command line
[targetWays_] :: DynFlags -> Ways
[splitInfo] :: DynFlags -> Maybe (String, Int)
[objectDir] :: DynFlags -> Maybe String
[dylibInstallName] :: DynFlags -> Maybe String
[hiDir] :: DynFlags -> Maybe String
[hieDir] :: DynFlags -> Maybe String
[stubDir] :: DynFlags -> Maybe String
[dumpDir] :: DynFlags -> Maybe String
[objectSuf_] :: DynFlags -> String
[hcSuf] :: DynFlags -> String
[hiSuf_] :: DynFlags -> String
[hieSuf] :: DynFlags -> String
[dynamicTooFailed] :: DynFlags -> IORef Bool
[dynObjectSuf_] :: DynFlags -> String
[dynHiSuf_] :: DynFlags -> String
[outputFile_] :: DynFlags -> Maybe String
[dynOutputFile_] :: DynFlags -> Maybe String
[outputHi] :: DynFlags -> Maybe String
[dynOutputHi] :: DynFlags -> Maybe String
[dynLibLoader] :: DynFlags -> DynLibLoader
-- | Indicate if we are now generating dynamic output because of
-- -dynamic-too. This predicate is used to query the appropriate fields
-- (outputFile/dynOutputFile, ways, etc.)
[dynamicNow] :: DynFlags -> !Bool
-- | This is set by runPipeline or 'ghc.GHCi.UI.runStmt' based on
-- where its output is going.
[dumpPrefix] :: DynFlags -> Maybe FilePath
-- | Override the dumpPrefix set by runPipeline or
-- 'ghc.GHCi.UI.runStmt'. Set by -ddump-file-prefix
[dumpPrefixForce] :: DynFlags -> Maybe FilePath
[ldInputs] :: DynFlags -> [Option]
[includePaths] :: DynFlags -> IncludeSpecs
[libraryPaths] :: DynFlags -> [String]
[frameworkPaths] :: DynFlags -> [String]
[cmdlineFrameworks] :: DynFlags -> [String]
[rtsOpts] :: DynFlags -> Maybe String
[rtsOptsEnabled] :: DynFlags -> RtsOptsEnabled
[rtsOptsSuggestions] :: DynFlags -> Bool
-- | Path to store the .mix files
[hpcDir] :: DynFlags -> String
[pluginModNames] :: DynFlags -> [ModuleName]
[pluginModNameOpts] :: DynFlags -> [(ModuleName, String)]
-- | the -ffrontend-opt flags given on the command line, in
-- *reverse* order that they're specified on the command line.
[frontendPluginOpts] :: DynFlags -> [String]
[depMakefile] :: DynFlags -> FilePath
[depIncludePkgDeps] :: DynFlags -> Bool
[depIncludeCppDeps] :: DynFlags -> Bool
[depExcludeMods] :: DynFlags -> [ModuleName]
[depSuffixes] :: DynFlags -> [String]
-- | The -package-db flags given on the command line, In *reverse*
-- order that they're specified on the command line. This is intended to
-- be applied with the list of "initial" package databases derived from
-- GHC_PACKAGE_PATH; see getUnitDbRefs.
[packageDBFlags] :: DynFlags -> [PackageDBFlag]
-- | The -ignore-package flags from the command line. In *reverse*
-- order that they're specified on the command line.
[ignorePackageFlags] :: DynFlags -> [IgnorePackageFlag]
-- | The -package and -hide-package flags from the
-- command-line. In *reverse* order that they're specified on the command
-- line.
[packageFlags] :: DynFlags -> [PackageFlag]
-- | The -plugin-package-id flags from command line. In *reverse*
-- order that they're specified on the command line.
[pluginPackageFlags] :: DynFlags -> [PackageFlag]
-- | The -trust and -distrust flags. In *reverse* order
-- that they're specified on the command line.
[trustFlags] :: DynFlags -> [TrustFlag]
-- | Filepath to the package environment file (if overriding default)
[packageEnv] :: DynFlags -> Maybe FilePath
[dumpFlags] :: DynFlags -> EnumSet DumpFlag
[generalFlags] :: DynFlags -> EnumSet GeneralFlag
[warningFlags] :: DynFlags -> EnumSet WarningFlag
[fatalWarningFlags] :: DynFlags -> EnumSet WarningFlag
[language] :: DynFlags -> Maybe Language
-- | Safe Haskell mode
[safeHaskell] :: DynFlags -> SafeHaskellMode
[safeInfer] :: DynFlags -> Bool
[safeInferred] :: DynFlags -> Bool
[thOnLoc] :: DynFlags -> SrcSpan
[newDerivOnLoc] :: DynFlags -> SrcSpan
[deriveViaOnLoc] :: DynFlags -> SrcSpan
[overlapInstLoc] :: DynFlags -> SrcSpan
[incoherentOnLoc] :: DynFlags -> SrcSpan
[pkgTrustOnLoc] :: DynFlags -> SrcSpan
[warnSafeOnLoc] :: DynFlags -> SrcSpan
[warnUnsafeOnLoc] :: DynFlags -> SrcSpan
[trustworthyOnLoc] :: DynFlags -> SrcSpan
[extensions] :: DynFlags -> [OnOff Extension]
[extensionFlags] :: DynFlags -> EnumSet Extension
-- | Unfolding control See Note [Discounts and thresholds] in
-- GHC.Core.Unfold
[unfoldingOpts] :: DynFlags -> !UnfoldingOpts
[maxWorkerArgs] :: DynFlags -> Int
[ghciHistSize] :: DynFlags -> Int
[flushOut] :: DynFlags -> FlushOut
[flushErr] :: DynFlags -> FlushErr
[ghcVersionFile] :: DynFlags -> Maybe FilePath
[haddockOptions] :: DynFlags -> Maybe String
-- | GHCi scripts specified by -ghci-script, in reverse order
[ghciScripts] :: DynFlags -> [String]
[pprUserLength] :: DynFlags -> Int
[pprCols] :: DynFlags -> Int
[useUnicode] :: DynFlags -> Bool
[useColor] :: DynFlags -> OverridingBool
[canUseColor] :: DynFlags -> Bool
[colScheme] :: DynFlags -> Scheme
-- | what kind of {-# SCC #-} to add automatically
[profAuto] :: DynFlags -> ProfAuto
[callerCcFilters] :: DynFlags -> [CallerCcFilter]
[interactivePrint] :: DynFlags -> Maybe String
[nextWrapperNum] :: DynFlags -> IORef (ModuleEnv Int)
-- | Machine dependent flags (-m<blah> stuff)
[sseVersion] :: DynFlags -> Maybe SseVersion
[bmiVersion] :: DynFlags -> Maybe BmiVersion
[avx] :: DynFlags -> Bool
[avx2] :: DynFlags -> Bool
[avx512cd] :: DynFlags -> Bool
[avx512er] :: DynFlags -> Bool
[avx512f] :: DynFlags -> Bool
[avx512pf] :: DynFlags -> Bool
-- | Run-time linker information (what options we need, etc.)
[rtldInfo] :: DynFlags -> IORef (Maybe LinkerInfo)
-- | Run-time compiler information
[rtccInfo] :: DynFlags -> IORef (Maybe CompilerInfo)
-- | Max size, in bytes, of inline array allocations.
[maxInlineAllocSize] :: DynFlags -> Int
-- | Only inline memcpy if it generates no more than this many pseudo
-- (roughly: Cmm) instructions.
[maxInlineMemcpyInsns] :: DynFlags -> Int
-- | Only inline memset if it generates no more than this many pseudo
-- (roughly: Cmm) instructions.
[maxInlineMemsetInsns] :: DynFlags -> Int
-- | Reverse the order of error messages in GHC/GHCi
[reverseErrors] :: DynFlags -> Bool
-- | Limit the maximum number of errors to show
[maxErrors] :: DynFlags -> Maybe Int
-- | Unique supply configuration for testing build determinism
[initialUnique] :: DynFlags -> Word
[uniqueIncrement] :: DynFlags -> Int
-- | Temporary: CFG Edge weights for fast iterations
[cfgWeights] :: DynFlags -> Weights
-- | Initialize the pretty-printing options
initSDocContext :: DynFlags -> PprStyle -> SDocContext
hasPprDebug :: DynFlags -> Bool
hasNoDebugOutput :: DynFlags -> Bool
data Settings
Settings :: {-# UNPACK #-} !GhcNameVersion -> {-# UNPACK #-} !FileSettings -> Platform -> {-# UNPACK #-} !ToolSettings -> {-# UNPACK #-} !PlatformMisc -> [(String, String)] -> Settings
[sGhcNameVersion] :: Settings -> {-# UNPACK #-} !GhcNameVersion
[sFileSettings] :: Settings -> {-# UNPACK #-} !FileSettings
[sTargetPlatform] :: Settings -> Platform
[sToolSettings] :: Settings -> {-# UNPACK #-} !ToolSettings
[sPlatformMisc] :: Settings -> {-# UNPACK #-} !PlatformMisc
[sRawSettings] :: Settings -> [(String, String)]
-- | Settings for what GHC this is.
data GhcNameVersion
GhcNameVersion :: String -> String -> GhcNameVersion
[ghcNameVersion_programName] :: GhcNameVersion -> String
[ghcNameVersion_projectVersion] :: GhcNameVersion -> String
-- | Paths to various files and directories used by GHC, including those
-- that provide more settings.
data FileSettings
FileSettings :: FilePath -> FilePath -> Maybe FilePath -> FilePath -> String -> FilePath -> FileSettings
[fileSettings_ghcUsagePath] :: FileSettings -> FilePath
[fileSettings_ghciUsagePath] :: FileSettings -> FilePath
[fileSettings_toolDir] :: FileSettings -> Maybe FilePath
[fileSettings_topDir] :: FileSettings -> FilePath
[fileSettings_tmpDir] :: FileSettings -> String
[fileSettings_globalPackageDatabase] :: FileSettings -> FilePath
sTopDir :: Settings -> FilePath
sToolDir :: Settings -> Maybe FilePath
sTmpDir :: Settings -> String
sTargetPlatformString :: Settings -> String
sProjectVersion :: Settings -> String
sProgramName :: Settings -> String
sPgm_windres :: Settings -> String
sPgm_ranlib :: Settings -> String
sPgm_lo :: Settings -> (String, [Option])
sPgm_lm :: Settings -> (String, [Option])
sPgm_libtool :: Settings -> String
sPgm_lcc :: Settings -> (String, [Option])
sPgm_lc :: Settings -> (String, [Option])
sPgm_l :: Settings -> (String, [Option])
sPgm_i :: Settings -> String
sPgm_dll :: Settings -> (String, [Option])
sPgm_c :: Settings -> String
sPgm_ar :: Settings -> String
sPgm_a :: Settings -> (String, [Option])
sPgm_T :: Settings -> String
sPgm_P :: Settings -> (String, [Option])
sPgm_L :: Settings -> String
sPgm_F :: Settings -> String
sOpt_windres :: Settings -> [String]
sOpt_lo :: Settings -> [String]
sOpt_lm :: Settings -> [String]
sOpt_lcc :: Settings -> [String]
sOpt_lc :: Settings -> [String]
sOpt_l :: Settings -> [String]
sOpt_i :: Settings -> [String]
sOpt_cxx :: Settings -> [String]
sOpt_c :: Settings -> [String]
sOpt_a :: Settings -> [String]
sOpt_P_fingerprint :: Settings -> Fingerprint
sOpt_P :: Settings -> [String]
sOpt_L :: Settings -> [String]
sOpt_F :: Settings -> [String]
sLibFFI :: Settings -> Bool
sLdSupportsFilelist :: Settings -> Bool
sLdSupportsCompactUnwind :: Settings -> Bool
sLdSupportsBuildId :: Settings -> Bool
sLdIsGnuLd :: Settings -> Bool
sGlobalPackageDatabasePath :: Settings -> FilePath
sGhciUsagePath :: Settings -> FilePath
sGhcWithSMP :: Settings -> Bool
sGhcWithInterpreter :: Settings -> Bool
sGhcUsagePath :: Settings -> FilePath
sGhcRtsWithLibdw :: Settings -> Bool
sGhcRTSWays :: Settings -> String
sGccSupportsNoPie :: Settings -> Bool
sExtraGccViaCFlags :: Settings -> [String]
-- | Platform-specific settings formerly hard-coded in Config.hs.
--
-- These should probably be all be triaged whether they can be computed
-- from other settings or belong in another another place (like
-- Platform above).
data PlatformMisc
PlatformMisc :: String -> Bool -> Bool -> String -> Bool -> Bool -> String -> PlatformMisc
[platformMisc_targetPlatformString] :: PlatformMisc -> String
[platformMisc_ghcWithInterpreter] :: PlatformMisc -> Bool
[platformMisc_ghcWithSMP] :: PlatformMisc -> Bool
[platformMisc_ghcRTSWays] :: PlatformMisc -> String
[platformMisc_libFFI] :: PlatformMisc -> Bool
[platformMisc_ghcRtsWithLibdw] :: PlatformMisc -> Bool
[platformMisc_llvmTarget] :: PlatformMisc -> String
-- | A UnitId identifies a built library in a database and is used to
-- generate unique symbols, etc. It's usually of the form:
--
-- pkgname-1.2:libname+hash
--
-- These UnitId are provided to us via the -this-unit-id flag.
--
-- The library in question may be definite or indefinite; if it is
-- indefinite, none of the holes have been filled (we never install
-- partially instantiated libraries as we can cheaply instantiate them
-- on-the-fly, cf VirtUnit). Put another way, an installed unit id is
-- either fully instantiated, or not instantiated at all.
newtype UnitId
UnitId :: FastString -> UnitId
-- | The full hashed unit identifier, including the component id and the
-- hash.
[unitIdFS] :: UnitId -> FastString
type Unit = GenUnit UnitId
-- | A Module is a pair of a Unit and a ModuleName.
type Module = GenModule Unit
newtype Indefinite unit
Indefinite :: unit -> Indefinite unit
[indefUnit] :: Indefinite unit -> unit
-- | An IndefUnitId is an UnitId with the invariant that it
-- only refers to an indefinite library; i.e., one that can be
-- instantiated.
type IndefUnitId = Indefinite UnitId
-- | A unit identifier identifies a (possibly partially) instantiated
-- library. It is primarily used as part of Module, which in turn
-- is used in Name, which is used to give names to entities when
-- typechecking.
--
-- There are two possible forms for a Unit:
--
-- 1) It can be a RealUnit, in which case we just have a
-- DefUnitId that uniquely identifies some fully compiled,
-- installed library we have on disk.
--
-- 2) It can be an VirtUnit. When we are typechecking a library
-- with missing holes, we may need to instantiate a library on the fly
-- (in which case we don't have any on-disk representation.) In that
-- case, you have an InstantiatedUnit, which explicitly records
-- the instantiation, so that we can substitute over it.
data GenUnit uid
-- | Installed definite unit (either a fully instantiated unit or a closed
-- unit)
RealUnit :: !Definite uid -> GenUnit uid
-- | Virtual unit instantiated on-the-fly. It may be definite if all the
-- holes are instantiated but we don't have code objects for it.
VirtUnit :: {-# UNPACK #-} !GenInstantiatedUnit uid -> GenUnit uid
-- | Fake hole unit
HoleUnit :: GenUnit uid
-- | A generic module is a pair of a unit identifier and a
-- ModuleName.
data GenModule unit
Module :: !unit -> !ModuleName -> GenModule unit
-- | Unit the module belongs to
[moduleUnit] :: GenModule unit -> !unit
-- | Module name (e.g. A.B.C)
[moduleName] :: GenModule unit -> !ModuleName
pprModule :: Module -> SDoc
data SDocContext
SDC :: !PprStyle -> !Scheme -> !PprColour -> !Bool -> !Int -> !Int -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !FastString -> SDoc -> SDocContext
[sdocStyle] :: SDocContext -> !PprStyle
[sdocColScheme] :: SDocContext -> !Scheme
-- | The most recently used colour. This allows nesting colours.
[sdocLastColour] :: SDocContext -> !PprColour
[sdocShouldUseColor] :: SDocContext -> !Bool
[sdocDefaultDepth] :: SDocContext -> !Int
[sdocLineLength] :: SDocContext -> !Int
-- | True if Unicode encoding is supported and not disable by
-- GHC_NO_UNICODE environment variable
[sdocCanUseUnicode] :: SDocContext -> !Bool
[sdocHexWordLiterals] :: SDocContext -> !Bool
[sdocPprDebug] :: SDocContext -> !Bool
[sdocPrintUnicodeSyntax] :: SDocContext -> !Bool
[sdocPrintCaseAsLet] :: SDocContext -> !Bool
[sdocPrintTypecheckerElaboration] :: SDocContext -> !Bool
[sdocPrintAxiomIncomps] :: SDocContext -> !Bool
[sdocPrintExplicitKinds] :: SDocContext -> !Bool
[sdocPrintExplicitCoercions] :: SDocContext -> !Bool
[sdocPrintExplicitRuntimeReps] :: SDocContext -> !Bool
[sdocPrintExplicitForalls] :: SDocContext -> !Bool
[sdocPrintPotentialInstances] :: SDocContext -> !Bool
[sdocPrintEqualityRelations] :: SDocContext -> !Bool
[sdocSuppressTicks] :: SDocContext -> !Bool
[sdocSuppressTypeSignatures] :: SDocContext -> !Bool
[sdocSuppressTypeApplications] :: SDocContext -> !Bool
[sdocSuppressIdInfo] :: SDocContext -> !Bool
[sdocSuppressCoercions] :: SDocContext -> !Bool
[sdocSuppressUnfoldings] :: SDocContext -> !Bool
[sdocSuppressVarKinds] :: SDocContext -> !Bool
[sdocSuppressUniques] :: SDocContext -> !Bool
[sdocSuppressModulePrefixes] :: SDocContext -> !Bool
[sdocSuppressStgExts] :: SDocContext -> !Bool
[sdocErrorSpans] :: SDocContext -> !Bool
[sdocStarIsType] :: SDocContext -> !Bool
[sdocLinearTypes] :: SDocContext -> !Bool
[sdocImpredicativeTypes] :: SDocContext -> !Bool
[sdocPrintTypeAbbreviations] :: SDocContext -> !Bool
-- | Used to map UnitIds to more friendly "package-version:component"
-- strings while pretty-printing.
--
-- Use pprWithUnitState to set it. Users should never have to set
-- it to pretty-print SDocs emitted by GHC, otherwise it's a bug. It's an
-- internal field used to thread the UnitState so that the Outputable
-- instance of UnitId can use it.
--
-- See Note [Pretty-printing UnitId] in GHC.Unit for more details.
--
-- Note that we use FastString instead of UnitId to avoid
-- boring module inter-dependency issues.
[sdocUnitIdForUser] :: SDocContext -> !FastString -> SDoc
-- | Represents a pretty-printable document.
--
-- To display an SDoc, use printSDoc, printSDocLn,
-- bufLeftRenderSDoc, or renderWithContext. Avoid calling
-- runSDoc directly as it breaks the abstraction layer.
data SDoc
data PprStyle
PprUser :: PrintUnqualified -> Depth -> Coloured -> PprStyle
PprDump :: PrintUnqualified -> PprStyle
-- | Print code; either C or assembler
PprCode :: LabelStyle -> PprStyle
text :: String -> SDoc
zipWithAndUnzipM :: Monad m => (a -> b -> m (c, d)) -> [a] -> [b] -> m ([c], [d])
zipWith4M :: Monad m => (a -> b -> c -> d -> m e) -> [a] -> [b] -> [c] -> [d] -> m [e]
zipWith3M_ :: Monad m => (a -> b -> c -> m d) -> [a] -> [b] -> [c] -> m ()
zipWith3M :: Monad m => (a -> b -> c -> m d) -> [a] -> [b] -> [c] -> m [d]
-- | Monadic version of when, taking the condition in the monad
whenM :: Monad m => m Bool -> m () -> m ()
-- | Monadic version of unless, taking the condition in the monad
unlessM :: Monad m => m Bool -> m () -> m ()
-- | Monadic version of or
orM :: Monad m => m Bool -> m Bool -> m Bool
-- | Monadic version of fmap specialised for Maybe
maybeMapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)
-- | Monadic version of mapSnd
mapSndM :: Monad m => (b -> m c) -> [(a, b)] -> m [(a, c)]
-- | Applicative version of mapMaybe
mapMaybeM :: Applicative m => (a -> m (Maybe b)) -> [a] -> m [b]
mapAndUnzip5M :: Monad m => (a -> m (b, c, d, e, f)) -> [a] -> m ([b], [c], [d], [e], [f])
mapAndUnzip4M :: Monad m => (a -> m (b, c, d, e)) -> [a] -> m ([b], [c], [d], [e])
-- | mapAndUnzipM for triples
mapAndUnzip3M :: Monad m => (a -> m (b, c, d)) -> [a] -> m ([b], [c], [d])
-- | Monadic version of mapAccumL
mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])
liftSndM :: Monad m => (a -> b) -> m (r, a) -> m (r, b)
liftFstM :: Monad m => (a -> b) -> m (a, r) -> m (b, r)
-- | Monadic version of foldl that discards its result
foldlM_ :: (Monad m, Foldable t) => (a -> b -> m a) -> a -> t b -> m ()
-- | Monadic version of fmap
fmapMaybeM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)
-- | Monadic version of fmap
fmapEitherM :: Monad m => (a -> m b) -> (c -> m d) -> Either a c -> m (Either b d)
-- | Like filterM, only it reverses the sense of the test.
filterOutM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
-- | Monadic version of concatMap
concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
-- | Monadic version of any, aborts the computation at the first
-- True value
anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool
-- | Monad version of all, aborts the computation at the first
-- False value
allM :: Monad m => (a -> m Bool) -> [a] -> m Bool
-- | When invoking external tools as part of the compilation pipeline, we
-- pass these a sequence of options on the command-line. Rather than just
-- using a list of Strings, we use a type that allows us to distinguish
-- between filepaths and 'other stuff'. The reason for this is that this
-- type gives us a handle on transforming filenames, and filenames only,
-- to whatever format they're expected to be on a particular platform.
data Option
FileOption :: String -> String -> Option
Option :: String -> Option
showOpt :: Option -> String
-- | A ModuleName is essentially a simple string, e.g. Data.List.
data ModuleName
-- | A static plugin with its arguments. For registering compiled-in
-- plugins through the GHC API.
data StaticPlugin
StaticPlugin :: PluginWithArgs -> StaticPlugin
-- | the actual plugin together with its commandline arguments
[spPlugin] :: StaticPlugin -> PluginWithArgs
-- | A plugin with its arguments. The result of loading the plugin.
data LoadedPlugin
LoadedPlugin :: PluginWithArgs -> ModIface -> LoadedPlugin
-- | the actual plugin together with its commandline arguments
[lpPlugin] :: LoadedPlugin -> PluginWithArgs
-- | the module containing the plugin
[lpModule] :: LoadedPlugin -> ModIface
data PlatformConstants
PlatformConstants :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> !Integer -> !Integer -> !Integer -> PlatformConstants
[pc_CONTROL_GROUP_CONST_291] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_STD_HDR_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_PROF_HDR_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_BLOCK_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_BLOCKS_PER_MBLOCK] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_TICKY_BIN_COUNT] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR2] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR3] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR4] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR5] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR6] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR7] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR8] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR9] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rR10] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rF1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rF2] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rF3] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rF4] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rF5] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rF6] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rD1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rD2] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rD3] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rD4] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rD5] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rD6] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rXMM1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rXMM2] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rXMM3] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rXMM4] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rXMM5] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rXMM6] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rYMM1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rYMM2] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rYMM3] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rYMM4] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rYMM5] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rYMM6] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rZMM1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rZMM2] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rZMM3] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rZMM4] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rZMM5] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rZMM6] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rL1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rSp] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rSpLim] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rHp] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rHpLim] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rCCCS] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rCurrentTSO] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rCurrentNursery] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgRegTable_rHpAlloc] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_stgEagerBlackholeInfo] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_stgGCEnter1] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_stgGCFun] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_Capability_r] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_bdescr_start] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_bdescr_free] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_bdescr_blocks] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_bdescr_flags] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_SIZEOF_CostCentreStack] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_CostCentreStack_mem_alloc] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_REP_CostCentreStack_mem_alloc] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_CostCentreStack_scc_count] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_REP_CostCentreStack_scc_count] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgHeader_ccs] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgHeader_ldvw] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_SIZEOF_StgSMPThunkHeader] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgEntCounter_allocs] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_REP_StgEntCounter_allocs] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgEntCounter_allocd] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_REP_StgEntCounter_allocd] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgEntCounter_registeredp] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgEntCounter_link] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgEntCounter_entry_count] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_SIZEOF_StgUpdateFrame_NoHdr] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_SIZEOF_StgMutArrPtrs_NoHdr] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgMutArrPtrs_ptrs] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgMutArrPtrs_size] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_SIZEOF_StgSmallMutArrPtrs_NoHdr] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgSmallMutArrPtrs_ptrs] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_SIZEOF_StgArrBytes_NoHdr] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgArrBytes_bytes] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgTSO_alloc_limit] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgTSO_cccs] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgTSO_stackobj] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgStack_sp] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgStack_stack] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgUpdateFrame_updatee] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgFunInfoExtraFwd_arity] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_REP_StgFunInfoExtraFwd_arity] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_SIZEOF_StgFunInfoExtraRev] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_OFFSET_StgFunInfoExtraRev_arity] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_REP_StgFunInfoExtraRev_arity] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_SPEC_SELECTEE_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_SPEC_AP_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MIN_PAYLOAD_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MIN_INTLIKE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_INTLIKE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MIN_CHARLIKE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_CHARLIKE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MUT_ARR_PTRS_CARD_BITS] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Vanilla_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Float_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Double_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Long_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_XMM_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Real_Vanilla_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Real_Float_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Real_Double_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Real_XMM_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_MAX_Real_Long_REG] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_RESERVED_C_STACK_BYTES] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_RESERVED_STACK_WORDS] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_AP_STACK_SPLIM] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_WORD_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_CINT_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_CLONG_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_CLONG_LONG_SIZE] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_BITMAP_BITS_SHIFT] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_TAG_BITS] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_LDV_SHIFT] :: PlatformConstants -> {-# UNPACK #-} !Int
[pc_ILDV_CREATE_MASK] :: PlatformConstants -> !Integer
[pc_ILDV_STATE_CREATE] :: PlatformConstants -> !Integer
[pc_ILDV_STATE_USE] :: PlatformConstants -> !Integer
-- | Foreign formats supported by GHC via TH
data ForeignSrcLang
-- | C
LangC :: ForeignSrcLang
-- | C++
LangCxx :: ForeignSrcLang
-- | Objective C
LangObjc :: ForeignSrcLang
-- | Objective C++
LangObjcxx :: ForeignSrcLang
-- | Assembly language (.s)
LangAsm :: ForeignSrcLang
-- | Object (.o)
RawObject :: ForeignSrcLang
enumSetMember :: Enum a => a -> EnumSet a -> Bool
pattern FunBind' :: XFunBind GhcRn GhcRn -> LIdP GhcRn -> MatchGroup GhcRn (LHsExpr GhcRn) -> HsBindLR GhcRn GhcRn
fun_ext' :: HsBindLR GhcRn GhcRn -> XFunBind GhcRn GhcRn
fun_id' :: HsBindLR GhcRn GhcRn -> LIdP GhcRn
fun_matches' :: HsBindLR GhcRn GhcRn -> MatchGroup GhcRn (LHsExpr GhcRn)
pattern HsSig' :: LHsType GhcRn -> LHsSigType GhcRn
setSigBody :: LHsType GhcRn -> LHsSigType GhcRn -> LHsSigType GhcRn
noLocA' :: a -> LocatedAn an a
emptyEpAnn :: EpAnn a
noLoc' :: a -> a
emptyComments' :: EpAnnComments
pattern HsQualTy' :: XQualTy GhcRn -> Maybe (LHsContext GhcRn) -> LHsType GhcRn -> HsType GhcRn
pattern RealSrcLoc' :: RealSrcLoc -> SrcLoc
pattern L' :: SrcSpan -> a -> GenLocated (SrcSpanAnn' ann) a
module Graph.Trace.Internal.RuntimeRep
-- | Allows for a levity polymorphic value to be used in an argument
-- position. This trick was taken from Ed Kmett's unboxed
-- library.
type Lev (a :: TYPE rep) = DummyConstraint => a
instance Graph.Trace.Internal.RuntimeRep.DummyConstraint
module Graph.Trace.Internal.Solver
tcPlugin :: TcPlugin
module Graph.Trace.Internal.Types
data DebugTag
DT :: {-# UNPACK #-} !Word -> Either FunName UserKey -> DebugTag
[invocationId] :: DebugTag -> {-# UNPACK #-} !Word
[debugKey] :: DebugTag -> Either FunName UserKey
data DebugContext
DC :: !Maybe DebugTag -> {-# UNPACK #-} !DebugTag -> !Propagation -> !Maybe DefinitionSite -> DebugContext
[previousTag] :: DebugContext -> !Maybe DebugTag
[currentTag] :: DebugContext -> {-# UNPACK #-} !DebugTag
[propagation] :: DebugContext -> !Propagation
[definitionSite] :: DebugContext -> !Maybe DefinitionSite
data Propagation
-- | Does not output traces, overrides other options
Mute :: Propagation
-- | Does not output traces, doesn't override other options
Inert :: Propagation
-- | Outputs traces for current scope, but does not propagate
Shallow :: Propagation
-- | Outputs traces and propagates to descendents
Deep :: Propagation
data SrcCodeLoc
SrcCodeLoc :: !SrcModule -> !SrcLine -> !SrcCol -> SrcCodeLoc
[srcModule] :: SrcCodeLoc -> !SrcModule
[srcLine] :: SrcCodeLoc -> !SrcLine
[srcCol] :: SrcCodeLoc -> !SrcCol
type DefinitionSite = SrcCodeLoc
type CallSite = SrcCodeLoc
type DebugIP = (?_debug_ip :: Maybe DebugContext, HasCallStack)
type TraceMute = DebugIP
type TraceDeep = DebugIP
type TraceDeepKey (key :: Symbol) = DebugIP
type Trace = DebugIP
type TraceKey (key :: Symbol) = DebugIP
type TraceInert = DebugIP
data Event
EntryEvent :: !DebugTag -> !Maybe DebugTag -> !Maybe DefinitionSite -> !Maybe CallSite -> Event
TraceEvent :: !DebugTag -> !MessageContent -> !Maybe CallSite -> Event
-- | Serialize an Event. The § character is used as both a separator and
-- terminator. Don't use this character in trace messages, it will break!
eventToLogStr :: Event -> Builder
type FunName = String
type UserKey = String
type SrcModule = String
type SrcLine = Int
type SrcCol = Int
callStackToCallSite :: CallStack -> Maybe CallSite
data DebugNames
DebugNames :: Name -> Name -> Name -> Name -> Name -> Name -> Name -> Name -> DebugNames
[traceMutePredName] :: DebugNames -> Name
[traceDeepPredName] :: DebugNames -> Name
[traceDeepKeyPredName] :: DebugNames -> Name
[tracePredName] :: DebugNames -> Name
[traceKeyPredName] :: DebugNames -> Name
[traceInertPredName] :: DebugNames -> Name
[entryName] :: DebugNames -> Name
[debugContextName] :: DebugNames -> Name
instance Language.Haskell.TH.Syntax.Lift Graph.Trace.Internal.Types.Propagation
instance GHC.Show.Show Graph.Trace.Internal.Types.Propagation
instance GHC.Classes.Eq Graph.Trace.Internal.Types.Propagation
instance Language.Haskell.TH.Syntax.Lift Graph.Trace.Internal.Types.SrcCodeLoc
module Graph.Trace.Internal.Trace
trace :: DebugIP => String -> a -> a
traceId :: DebugIP => String -> String
traceShow :: (DebugIP, Show a) => a -> b -> b
traceShowId :: (DebugIP, Show a) => a -> a
traceM :: (Applicative f, DebugIP) => String -> f ()
traceShowM :: (Applicative f, Show a, DebugIP) => a -> f ()
-- | Emits a message to the log signaling a function invocation
entry :: forall rep m (a :: TYPE rep). DebugIP => Lev a %m -> a
omitTraces :: Propagation -> Bool
module Graph.Trace.Internal.Predicates
-- | Removes debug predicates from the type signatures in an expression.
-- This is necessary if there are type signatures for pattern bound names
-- and the monomorphism restriction is on.
removeConstraints :: Data a => DebugNames -> Set Name -> a -> a
-- | Matches on type signatures in order to add the constraint to them.
addConstraintToSig :: DebugNames -> Bool -> Sig GhcRn -> Writer (Map Name (Maybe FastString, Propagation)) (Sig GhcRn)
module Graph.Trace.Internal.Instrument
-- | Instrument value bindings that have a signature with a debug pred.
-- This gets applied to both top level bindings as well as arbitrarily
-- nested value bindings.
modifyValBinds :: DebugNames -> Map Name (Maybe FastString, Propagation) -> NHsValBindsLR GhcRn -> WriterT (Set Name) (StateT (Set Name) TcM) (NHsValBindsLR GhcRn)
-- | Instrument default method implementations in a type class declaration
-- if they contain a Debug pred.
modifyTyClDecl :: DebugNames -> Map Name (Maybe FastString, Propagation) -> TyClDecl GhcRn -> WriterT (Set Name) (StateT (Set Name) TcM) (TyClDecl GhcRn)
-- | Instrument the method implementations in an type class instance if it
-- has a signature containing a debug pred.
modifyClsInstDecl :: DebugNames -> Map Name (Maybe FastString, Propagation) -> ClsInstDecl GhcRn -> WriterT (Set Name) (StateT (Set Name) TcM) (ClsInstDecl GhcRn)
module Graph.Trace
plugin :: Plugin