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


-- | Set breakpoints using a GHC plugin
--   
--   A plugin that allows you to set breakpoints for debugging purposes.
--   
--   See the <a>README</a> for details.
@package breakpoint
@version 0.1.2.0

module Debug.Breakpoint.GhcFacade

-- | The <a>trace</a> function outputs the trace message given as its first
--   argument, before returning the second argument as its result.
--   
--   For example, this returns the value of <tt>f x</tt> but first outputs
--   the message.
--   
--   <pre>
--   &gt;&gt;&gt; let x = 123; f = show
--   
--   &gt;&gt;&gt; trace ("calling f with x = " ++ show x) (f x)
--   "calling f with x = 123
--   123"
--   </pre>
--   
--   The <a>trace</a> function should <i>only</i> be used for debugging, or
--   for monitoring execution. The function is not referentially
--   transparent: its type indicates that it is a pure function but it has
--   the side effect of outputting the trace message.
trace :: String -> a -> a

-- | Monads having fixed points with a 'knot-tying' semantics. Instances of
--   <a>MonadFix</a> should satisfy the following laws:
--   
--   <ul>
--   <li><i>Purity</i> <tt><a>mfix</a> (<a>return</a> . h) = <a>return</a>
--   (<a>fix</a> h)</tt></li>
--   <li><i>Left shrinking (or Tightening)</i> <tt><a>mfix</a> (\x -&gt; a
--   &gt;&gt;= \y -&gt; f x y) = a &gt;&gt;= \y -&gt; <a>mfix</a> (\x -&gt;
--   f x y)</tt></li>
--   <li><i>Sliding</i> <tt><a>mfix</a> (<a>liftM</a> h . f) = <a>liftM</a>
--   h (<a>mfix</a> (f . h))</tt>, for strict <tt>h</tt>.</li>
--   <li><i>Nesting</i> <tt><a>mfix</a> (\x -&gt; <a>mfix</a> (\y -&gt; f x
--   y)) = <a>mfix</a> (\x -&gt; f x x)</tt></li>
--   </ul>
--   
--   This class is used in the translation of the recursive <tt>do</tt>
--   notation supported by GHC and Hugs.
class Monad m => MonadFix (m :: Type -> Type)

-- | The fixed point of a monadic computation. <tt><a>mfix</a> f</tt>
--   executes the action <tt>f</tt> only once, with the eventual output fed
--   back as the input. Hence <tt>f</tt> should not be strict, for then
--   <tt><a>mfix</a> f</tt> would diverge.
mfix :: MonadFix m => (a -> m a) -> m a

-- | A functor with application, providing operations to
--   
--   <ul>
--   <li>embed pure expressions (<a>pure</a>), and</li>
--   <li>sequence computations and combine their results (<a>&lt;*&gt;</a>
--   and <a>liftA2</a>).</li>
--   </ul>
--   
--   A minimal complete definition must include implementations of
--   <a>pure</a> and of either <a>&lt;*&gt;</a> or <a>liftA2</a>. If it
--   defines both, then they must behave the same as their default
--   definitions:
--   
--   <pre>
--   (<a>&lt;*&gt;</a>) = <a>liftA2</a> <a>id</a>
--   </pre>
--   
--   <pre>
--   <a>liftA2</a> f x y = f <a>&lt;$&gt;</a> x <a>&lt;*&gt;</a> y
--   </pre>
--   
--   Further, any definition must satisfy the following:
--   
--   <ul>
--   <li><i>Identity</i> <pre><a>pure</a> <a>id</a> <a>&lt;*&gt;</a> v =
--   v</pre></li>
--   <li><i>Composition</i> <pre><a>pure</a> (.) <a>&lt;*&gt;</a> u
--   <a>&lt;*&gt;</a> v <a>&lt;*&gt;</a> w = u <a>&lt;*&gt;</a> (v
--   <a>&lt;*&gt;</a> w)</pre></li>
--   <li><i>Homomorphism</i> <pre><a>pure</a> f <a>&lt;*&gt;</a>
--   <a>pure</a> x = <a>pure</a> (f x)</pre></li>
--   <li><i>Interchange</i> <pre>u <a>&lt;*&gt;</a> <a>pure</a> y =
--   <a>pure</a> (<a>$</a> y) <a>&lt;*&gt;</a> u</pre></li>
--   </ul>
--   
--   The other methods have the following default definitions, which may be
--   overridden with equivalent specialized implementations:
--   
--   <ul>
--   <li><pre>u <a>*&gt;</a> v = (<a>id</a> <a>&lt;$</a> u)
--   <a>&lt;*&gt;</a> v</pre></li>
--   <li><pre>u <a>&lt;*</a> v = <a>liftA2</a> <a>const</a> u v</pre></li>
--   </ul>
--   
--   As a consequence of these laws, the <a>Functor</a> instance for
--   <tt>f</tt> will satisfy
--   
--   <ul>
--   <li><pre><a>fmap</a> f x = <a>pure</a> f <a>&lt;*&gt;</a> x</pre></li>
--   </ul>
--   
--   It may be useful to note that supposing
--   
--   <pre>
--   forall x y. p (q x y) = f x . g y
--   </pre>
--   
--   it follows from the above that
--   
--   <pre>
--   <a>liftA2</a> p (<a>liftA2</a> q u v) = <a>liftA2</a> f u . <a>liftA2</a> g v
--   </pre>
--   
--   If <tt>f</tt> is also a <a>Monad</a>, it should satisfy
--   
--   <ul>
--   <li><pre><a>pure</a> = <a>return</a></pre></li>
--   <li><pre>m1 <a>&lt;*&gt;</a> m2 = m1 <a>&gt;&gt;=</a> (x1 -&gt; m2
--   <a>&gt;&gt;=</a> (x2 -&gt; <a>return</a> (x1 x2)))</pre></li>
--   <li><pre>(<a>*&gt;</a>) = (<a>&gt;&gt;</a>)</pre></li>
--   </ul>
--   
--   (which implies that <a>pure</a> and <a>&lt;*&gt;</a> 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 <a>&lt;*&gt;</a> that is
--   more efficient than the default one.
--   
--   Using <tt>ApplicativeDo</tt>: '<tt>fs <a>&lt;*&gt;</a> as</tt>' can be
--   understood as the <tt>do</tt> expression
--   
--   <pre>
--   do f &lt;- fs
--      a &lt;- as
--      pure (f a)
--   </pre>
(<*>) :: Applicative f => f (a -> b) -> f a -> f b

-- | Lift a binary function to actions.
--   
--   Some functors support an implementation of <a>liftA2</a> that is more
--   efficient than the default one. In particular, if <a>fmap</a> is an
--   expensive operation, it is likely better to use <a>liftA2</a> than to
--   <a>fmap</a> over the structure and then use <a>&lt;*&gt;</a>.
--   
--   This became a typeclass method in 4.10.0.0. Prior to that, it was a
--   function defined in terms of <a>&lt;*&gt;</a> and <a>fmap</a>.
--   
--   Using <tt>ApplicativeDo</tt>: '<tt><a>liftA2</a> f as bs</tt>' can be
--   understood as the <tt>do</tt> expression
--   
--   <pre>
--   do a &lt;- as
--      b &lt;- bs
--      pure (f a b)
--   </pre>
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c

-- | Sequence actions, discarding the value of the first argument.
--   
--   '<tt>as <a>*&gt;</a> bs</tt>' can be understood as the <tt>do</tt>
--   expression
--   
--   <pre>
--   do as
--      bs
--   </pre>
--   
--   This is a tad complicated for our <tt>ApplicativeDo</tt> extension
--   which will give it a <tt>Monad</tt> constraint. For an
--   <tt>Applicative</tt> constraint we write it of the form
--   
--   <pre>
--   do _ &lt;- as
--      b &lt;- bs
--      pure b
--   </pre>
(*>) :: Applicative f => f a -> f b -> f b

-- | Sequence actions, discarding the value of the second argument.
--   
--   Using <tt>ApplicativeDo</tt>: '<tt>as <a>&lt;*</a> bs</tt>' can be
--   understood as the <tt>do</tt> expression
--   
--   <pre>
--   do a &lt;- as
--      bs
--      pure a
--   </pre>
(<*) :: Applicative f => f a -> f b -> f a
infixl 4 <*
infixl 4 *>
infixl 4 <*>

-- | <a>Plugin</a> is the compiler plugin data type. Try to avoid
--   constructing one of these directly, and just modify some fields of
--   <a>defaultPlugin</a> 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] -> DynFlags -> IO DynFlags) -> ([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 <a>DynFlags</a>, right after plugin
--   loading. This can be used to register hooks or tweak any field of
--   <a>DynFlags</a> before doing actual work on a module.
[dynflagsPlugin] :: Plugin -> [CommandLineOption] -> DynFlags -> IO DynFlags

-- | Specify how the plugin should affect recompilation.
[pluginRecompile] :: Plugin -> [CommandLineOption] -> IO PluginRecompile

-- | Modify the module when it is parsed. This is called by HscMain when
--   the parsing is successful.
[parsedResultAction] :: Plugin -> [CommandLineOption] -> ModSummary -> HsParsedModule -> Hsc HsParsedModule

-- | Modify each group after it is renamed. This is called after each
--   <a>HsGroup</a> 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 LoadIface
--   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 <a>IO</a> computations may be embedded. Any monad
--   built by applying a sequence of monad transformers to the <a>IO</a>
--   monad will be an instance of this class.
--   
--   Instances should satisfy the following laws, which state that
--   <a>liftIO</a> is a transformer of monads:
--   
--   <ul>
--   <li><pre><a>liftIO</a> . <a>return</a> = <a>return</a></pre></li>
--   <li><pre><a>liftIO</a> (m &gt;&gt;= f) = <a>liftIO</a> m &gt;&gt;=
--   (<a>liftIO</a> . f)</pre></li>
--   </ul>
class Monad m => MonadIO (m :: Type -> Type)

-- | Lift a computation from the <a>IO</a> monad.
liftIO :: MonadIO m => IO a -> m a

-- | The <a>mapAndUnzipM</a> 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 <a>IO</a> monad
data IORef a

-- | Monadic fold over the elements of a structure, associating to the
--   left, i.e. from left to right.
foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b

-- | Monadic fold over the elements of a structure, associating to the
--   right, i.e. from right to left.
foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b

-- | An infix synonym for <a>fmap</a>.
--   
--   The name of this operator is an allusion to <a>$</a>. Note the
--   similarities between their types:
--   
--   <pre>
--    ($)  ::              (a -&gt; b) -&gt;   a -&gt;   b
--   (&lt;$&gt;) :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
--   </pre>
--   
--   Whereas <a>$</a> is function application, <a>&lt;$&gt;</a> is function
--   application lifted over a <a>Functor</a>.
--   
--   <h4><b>Examples</b></h4>
--   
--   Convert from a <tt><a>Maybe</a> <a>Int</a></tt> to a <tt><a>Maybe</a>
--   <a>String</a></tt> using <a>show</a>:
--   
--   <pre>
--   &gt;&gt;&gt; show &lt;$&gt; Nothing
--   Nothing
--   
--   &gt;&gt;&gt; show &lt;$&gt; Just 3
--   Just "3"
--   </pre>
--   
--   Convert from an <tt><a>Either</a> <a>Int</a> <a>Int</a></tt> to an
--   <tt><a>Either</a> <a>Int</a></tt> <a>String</a> using <a>show</a>:
--   
--   <pre>
--   &gt;&gt;&gt; show &lt;$&gt; Left 17
--   Left 17
--   
--   &gt;&gt;&gt; show &lt;$&gt; Right 17
--   Right "17"
--   </pre>
--   
--   Double each element of a list:
--   
--   <pre>
--   &gt;&gt;&gt; (*2) &lt;$&gt; [1,2,3]
--   [2,4,6]
--   </pre>
--   
--   Apply <a>even</a> to the second element of a pair:
--   
--   <pre>
--   &gt;&gt;&gt; even &lt;$&gt; (2,2)
--   (2,True)
--   </pre>
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | Bind an evidence variable. This must not be invoked from
--   <tt>tcPluginInit</tt> or <tt>tcPluginStop</tt>, or it will panic.
setEvBind :: EvBind -> TcPluginM ()

-- | Create a fresh coercion hole.
newCoercionHole :: PredType -> TcPluginM CoercionHole

-- | Create a fresh evidence variable.
newEvVar :: PredType -> TcPluginM EvVar

-- | Create a new given constraint, with the supplied evidence. This must
--   not be invoked from <tt>tcPluginInit</tt> or <tt>tcPluginStop</tt>, or
--   it will panic.
newGiven :: CtLoc -> PredType -> EvExpr -> TcPluginM CtEvidence

-- | Create a new derived constraint.
newDerived :: CtLoc -> PredType -> TcPluginM CtEvidence

-- | Create a new wanted constraint.
newWanted :: CtLoc -> PredType -> TcPluginM CtEvidence
zonkCt :: Ct -> TcPluginM Ct
zonkTcType :: TcType -> TcPluginM TcType
isTouchableTcPluginM :: TcTyVar -> TcPluginM Bool
newFlexiTyVar :: Kind -> TcPluginM TcTyVar
matchFam :: TyCon -> [Type] -> TcPluginM (Maybe (TcCoercion, TcType))
getFamInstEnvs :: TcPluginM (FamInstEnv, FamInstEnv)
getInstEnvs :: TcPluginM InstEnvs
tcLookupId :: Name -> TcPluginM Id
tcLookup :: Name -> TcPluginM TcTyThing
tcLookupClass :: Name -> TcPluginM Class
tcLookupDataCon :: Name -> TcPluginM DataCon
tcLookupTyCon :: Name -> TcPluginM TyCon
tcLookupGlobal :: Name -> TcPluginM TyThing
findImportedModule :: ModuleName -> Maybe FastString -> TcPluginM FindResult

-- | Output useful for debugging the compiler.
tcPluginTrace :: String -> SDoc -> TcPluginM ()

-- | Perform some IO, typically to interact with an external tool.
tcPluginIO :: IO a -> TcPluginM a
pprTypeForUser :: Type -> SDoc

-- | Pretty-prints a <a>TyThing</a>.
pprTyThing :: ShowSub -> TyThing -> SDoc

-- | Like <a>pprTyThingInContext</a>, but adds the defining location.
pprTyThingInContextLoc :: TyThing -> SDoc

-- | Pretty-prints a <a>TyThing</a> in context: that is, if the entity is a
--   data constructor, record selector, or class method, then the entity's
--   parent declaration is pretty-printed with irrelevant parts omitted.
pprTyThingInContext :: ShowSub -> TyThing -> SDoc

-- | Pretty-prints the <a>TyThing</a> header. For functions and data
--   constructors the function is equivalent to <a>pprTyThing</a> but for
--   type constructors and classes it prints only the header part of the
--   declaration.
pprTyThingHdr :: TyThing -> SDoc

-- | Pretty-prints a <a>TyThing</a> with its defining location.
pprTyThingLoc :: TyThing -> SDoc

-- | Pretty-prints a <a>FamInst</a> (type/data family instance) with its
--   defining location.
pprFamInst :: FamInst -> SDoc
defaultFrontendPlugin :: FrontendPlugin

-- | Perform a constant operation by using all of the plugins in turn.
withPlugins_ :: Monad m => DynFlags -> ConstPluginOperation m a -> a -> m ()
mapPlugins :: DynFlags -> (Plugin -> [CommandLineOption] -> a) -> [a]

-- | Perform an operation by using all of the plugins in turn.
withPlugins :: Monad m => DynFlags -> PluginOperation m a -> a -> m a
plugins :: DynFlags -> [PluginWithArgs]

-- | A renamer plugin which mades the renamed source available in a
--   typechecker plugin.
keepRenamedSource :: [CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)

-- | Default plugin: does nothing at all, except for marking that safe
--   inference has failed unless <tt>-fplugin-trustworthy</tt> is passed.
--   For compatibility reaso you should base all your plugin definitions on
--   this default value.
defaultPlugin :: Plugin
flagRecompile :: [CommandLineOption] -> IO PluginRecompile
impurePlugin :: [CommandLineOption] -> IO PluginRecompile
purePlugin :: [CommandLineOption] -> IO PluginRecompile
pluginRecompile' :: PluginWithArgs -> IO PluginRecompile
lpModuleName :: LoadedPlugin -> ModuleName

-- | Command line options gathered from the -PModule.Name:stuff syntax are
--   given to you as this type
type CommandLineOption = String
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 CorePlugin = [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo]
type FrontendPluginAction = [String] -> [(String, Maybe Phase)] -> Ghc ()

-- | 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
newIfaceNames :: [OccName] -> IfL [Name]
newIfaceName :: OccName -> IfL Name

-- | Look up a top-level name from the current Iface module
lookupIfaceTop :: OccName -> IfL Name
extendIfaceEnvs :: [TyCoVar] -> IfL a -> IfL a
extendIfaceTyVarEnv :: [TyVar] -> IfL a -> IfL a
lookupIfaceVar :: IfaceBndr -> IfL (Maybe TyCoVar)
lookupIfaceTyVar :: IfaceTvBndr -> IfL (Maybe TyVar)
tcIfaceTyVar :: FastString -> IfL TyVar
extendIfaceIdEnv :: [Id] -> IfL a -> IfL a
tcIfaceLclId :: FastString -> IfL Id

-- | Set the <a>Module</a> of a <a>Name</a>.
setNameModule :: Maybe Module -> Name -> TcRnIf m n Name
externaliseName :: Module -> Name -> TcRnIf m n Name
lookupOrigIO :: HscEnv -> Module -> OccName -> IO Name

-- | Look up the <a>Name</a> for a given <a>Module</a> and <a>OccName</a>.
--   Consider alternatively using <a>lookupIfaceTop</a> if you're in the
--   <a>IfL</a> monad and <a>Module</a> is simply that of the
--   <a>ModIface</a> you are typechecking.
lookupOrig :: Module -> OccName -> TcRnIf a b Name
updNameCacheTc :: Module -> OccName -> (NameCache -> (NameCache, c)) -> TcRnIf a b c
mkNameCacheUpdater :: TcRnIf a b NameCacheUpdater
ifaceExportNames :: [IfaceExport] -> TcRnIf gbl lcl [AvailInfo]
allocateGlobalBinder :: NameCache -> Module -> OccName -> SrcSpan -> (NameCache, Name)
newInteractiveBinder :: HscEnv -> OccName -> SrcSpan -> IO Name
newGlobalBinder :: Module -> OccName -> SrcSpan -> TcRnIf a b Name

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

-- | Get the next cost centre index associated with a given name.
getCCIndexM :: ContainsCostCentreState gbl => FastString -> TcRnIf gbl lcl CostCentreIndex
setImplicitEnvM :: TypeEnv -> IfL a -> IfL a
forkM :: SDoc -> IfL a -> IfL a
forkM_maybe :: SDoc -> IfL a -> IfL (Maybe a)
failIfM :: MsgDoc -> IfL a
getIfModule :: IfL Module

-- | Initialize interface typechecking, but with a <a>NameShape</a> to
--   apply when typechecking top-level <a>OccName</a>s (see
--   <tt>lookupIfaceTop</tt>)
initIfaceLclWithSubst :: Module -> SDoc -> Bool -> NameShape -> IfL a -> IfM lcl a
initIfaceLcl :: Module -> SDoc -> Bool -> IfL a -> IfM lcl a
initIfaceCheck :: SDoc -> HscEnv -> IfG a -> IO a
initIfaceLoad :: HscEnv -> IfG a -> IO a

-- | Run an <a>IfG</a> (top-level interface monad) computation inside an
--   existing <a>TcRn</a> (typecheck-renaming monad) computation by
--   initializing an <a>IfGblEnv</a> based on <a>TcGblEnv</a>.
initIfaceTcRn :: IfG a -> TcRn a
mkIfLclEnv :: Module -> SDoc -> Bool -> IfLclEnv
setLocalRdrEnv :: LocalRdrEnv -> RnM a -> RnM a
getLocalRdrEnv :: RnM LocalRdrEnv

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

-- | 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 ()

-- | Adds the given modFinalizers to the global environment and set them to
--   use the current local environment.
addModFinalizersWithLclEnv :: ThModFinalizers -> TcM ()
setStage :: ThStage -> TcM a -> TcRn a
getStageAndBindLevel :: Name -> TcRn (Maybe (TopLevelFlag, ThLevel, ThStage))
getStage :: TcM ThStage
keepAlive :: Name -> TcRn ()
getTopLevelSpliceLocs :: TcM (Set RealSrcSpan)

-- | When generating an out-of-scope error message for a variable matching
--   a binding in a later inter-splice group, the typechecker uses the
--   splice locations to provide details in the message about the scope of
--   that binding.
recordTopLevelSpliceLoc :: SrcSpan -> TcM ()
recordThSpliceUse :: TcM ()
recordThUse :: TcM ()
emitNamedWildCardHoleConstraints :: [(Name, TcTyVar)] -> TcM ()
emitAnonWildCardHoleConstraint :: TcTyVar -> TcM ()
traceTcConstraints :: String -> TcM ()
setLclTypeEnv :: TcLclEnv -> TcM a -> TcM a
getLclTypeEnv :: TcM TcTypeEnv
isTouchableTcM :: TcTyVar -> TcM Bool
setTcLevel :: TcLevel -> TcM a -> TcM a
getTcLevel :: TcM TcLevel
pushTcLevelsM :: Int -> TcM a -> TcM (a, TcLevel)
pushTcLevelM :: TcM a -> TcM (TcLevel, a)
pushTcLevelM_ :: TcM a -> TcM a

-- | The name says it all. The returned TcLevel is the *inner* TcLevel.
pushLevelAndCaptureConstraints :: TcM a -> TcM (TcLevel, WantedConstraints, a)

-- | Throw out any constraints emitted by the thing_inside
discardConstraints :: TcM a -> TcM a
emitInsoluble :: Ct -> TcM ()
emitImplications :: Bag Implication -> TcM ()
emitImplication :: Implication -> TcM ()
emitSimples :: Cts -> TcM ()
emitSimple :: Ct -> TcM ()
emitConstraints :: WantedConstraints -> TcM ()
emitStaticConstraints :: WantedConstraints -> TcM ()
setConstraintVar :: TcRef WantedConstraints -> TcM a -> TcM a
getConstraintVar :: TcM (TcRef WantedConstraints)
chooseUniqueOccTc :: (OccSet -> OccName) -> TcM OccName
addTcEvBind :: EvBindsVar -> EvBind -> TcM ()
setTcEvBindsMap :: EvBindsVar -> EvBindMap -> TcM ()
getTcEvBindsMap :: EvBindsVar -> TcM EvBindMap
getTcEvTyCoVars :: EvBindsVar -> TcM TyCoVarSet
cloneEvBindsVar :: EvBindsVar -> TcM EvBindsVar

-- | Creates an EvBindsVar incapable of holding any bindings. It still
--   tracks covar usages (see comments on ebv_tcvs in TcEvidence), thus
--   must be made monadically
newNoTcEvBinds :: TcM EvBindsVar
newTcEvBinds :: TcM EvBindsVar
addTopEvBinds :: Bag EvBind -> TcM a -> TcM a
debugTc :: TcM () -> TcM ()
mkErrInfo :: TidyEnv -> [ErrCtxt] -> TcM SDoc

-- | Display a warning, with an optional flag, for the current source
--   location.
add_warn :: WarnReason -> MsgDoc -> MsgDoc -> TcRn ()

-- | Display a warning for a given source location.
addWarnAt :: WarnReason -> SrcSpan -> MsgDoc -> TcRn ()

-- | Display a warning for the current source location.
addWarn :: WarnReason -> MsgDoc -> TcRn ()

-- | Display a warning in a given context.
addWarnTcM :: WarnReason -> (TidyEnv, MsgDoc) -> TcM ()

-- | Display a warning in the current context.
addWarnTc :: WarnReason -> MsgDoc -> TcM ()

-- | Display a warning if a condition is met.
warnTcM :: WarnReason -> Bool -> (TidyEnv, MsgDoc) -> TcM ()

-- | Display a warning if a condition is met.
warnTc :: WarnReason -> Bool -> MsgDoc -> TcM ()

-- | Display a warning if a condition is met.
warnIf :: Bool -> MsgDoc -> TcRn ()

-- | Display a warning if a condition is met, and the warning is enabled
warnIfFlag :: WarningFlag -> Bool -> MsgDoc -> TcRn ()
failIfTcM :: Bool -> (TidyEnv, MsgDoc) -> TcM ()
failIfTc :: Bool -> MsgDoc -> TcM ()
checkTcM :: Bool -> (TidyEnv, MsgDoc) -> TcM ()
checkTc :: Bool -> MsgDoc -> TcM ()
failWithTcM :: (TidyEnv, MsgDoc) -> TcM a
failWithTc :: MsgDoc -> TcM a
mkErrTc :: MsgDoc -> TcM ErrMsg
mkErrTcM :: (TidyEnv, MsgDoc) -> TcM ErrMsg
addErrTcM :: (TidyEnv, MsgDoc) -> TcM ()
addErrsTc :: [MsgDoc] -> TcM ()
addErrTc :: MsgDoc -> TcM ()
tryTcDiscardingErrs :: TcM r -> TcM r -> TcM r
discardErrs :: TcRn a -> TcRn a
tryTc :: TcRn a -> TcRn (Maybe a, Messages)

-- | The accumulator is not updated if the action fails
foldAndRecoverM :: (b -> a -> TcRn b) -> b -> [a] -> TcRn b

-- | Apply the function to all elements on the input list If all succeed,
--   return the list of results Othewise 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]
recoverM :: TcRn r -> TcRn r -> TcRn r
attemptM :: TcRn r -> TcRn (Maybe r)
captureConstraints :: TcM a -> TcM (a, WantedConstraints)
tryCaptureConstraints :: TcM a -> TcM (Maybe a, WantedConstraints)
askNoErrs :: TcRn a -> TcRn (a, Bool)
setCtLocM :: CtLoc -> TcM a -> TcM a
getCtLocM :: CtOrigin -> Maybe TypeOrKind -> TcM CtLoc
popErrCtxt :: TcM a -> TcM a
updCtxt :: ([ErrCtxt] -> [ErrCtxt]) -> TcM a -> TcM a

-- | Variant of <a>addLandmarkErrCtxt</a> that allows for monadic
--   operations and tidying.
addLandmarkErrCtxtM :: (TidyEnv -> TcM (TidyEnv, MsgDoc)) -> 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 :: MsgDoc -> TcM a -> TcM a

-- | Add a message to the error context. This message may do tidying.
addErrCtxtM :: (TidyEnv -> TcM (TidyEnv, MsgDoc)) -> TcM a -> TcM a

-- | Add a fixed message to the error context. This message should not do
--   any tidying.
addErrCtxt :: MsgDoc -> TcM a -> TcM a
setErrCtxt :: [ErrCtxt] -> TcM a -> TcM a
getErrCtxt :: TcM [ErrCtxt]
failIfErrsM :: TcRn ()
ifErrsM :: TcRn r -> TcRn r -> TcRn r
whenNoErrs :: TcM () -> TcM ()
checkNoErrs :: TcM r -> TcM r
reportWarning :: WarnReason -> ErrMsg -> TcRn ()
reportError :: ErrMsg -> TcRn ()
reportErrors :: [ErrMsg] -> TcM ()
addLongErrAt :: SrcSpan -> MsgDoc -> MsgDoc -> TcRn ()
mkErrDocAt :: SrcSpan -> ErrDoc -> TcRn ErrMsg
mkLongErrAt :: SrcSpan -> MsgDoc -> MsgDoc -> TcRn ErrMsg
discardWarnings :: TcRn a -> TcRn a
addMessages :: Messages -> TcRn ()
checkErr :: Bool -> MsgDoc -> TcRn ()
addErrs :: [(SrcSpan, MsgDoc)] -> TcRn ()
addErrAt :: SrcSpan -> MsgDoc -> TcRn ()
failAt :: SrcSpan -> MsgDoc -> TcRn a
failWith :: MsgDoc -> TcRn a
addErr :: MsgDoc -> TcRn ()
setErrsVar :: TcRef Messages -> TcRn a -> TcRn a
getErrsVar :: TcRn (TcRef Messages)
wrapLocM_ :: HasSrcSpan a => (SrcSpanLess a -> TcM ()) -> a -> TcM ()
wrapLocSndM :: (HasSrcSpan a, HasSrcSpan c) => (SrcSpanLess a -> TcM (b, SrcSpanLess c)) -> a -> TcM (b, c)
wrapLocFstM :: (HasSrcSpan a, HasSrcSpan b) => (SrcSpanLess a -> TcM (SrcSpanLess b, c)) -> a -> TcM (b, c)
wrapLocM :: (HasSrcSpan a, HasSrcSpan b) => (SrcSpanLess a -> TcM (SrcSpanLess b)) -> a -> TcM b
addLocM :: HasSrcSpan a => (SrcSpanLess a -> TcM b) -> a -> TcM b
setSrcSpan :: SrcSpan -> TcRn a -> TcRn a
getSrcSpanM :: TcRn SrcSpan
addDependentFiles :: [FilePath] -> TcRn ()
getDeclaredDefaultTys :: TcRn (Maybe [Type])
getRecFieldEnv :: TcRn RecFieldEnv
extendFixityEnv :: [(Name, FixItem)] -> RnM a -> RnM a
getFixityEnv :: TcRn FixityEnv
getImports :: TcRn ImportAvails
getRdrEnvs :: TcRn (GlobalRdrEnv, LocalRdrEnv)
getGlobalRdrEnv :: TcRn GlobalRdrEnv
tcSelfBootInfo :: TcRn SelfBootInfo
tcIsHsig :: TcRn Bool
tcIsHsBootOrSig :: TcRn Bool
getInteractivePrintName :: TcRn Name
getGHCiMonad :: TcRn Name
getIsGHCi :: TcRn Bool
traceOptIf :: DumpFlag -> SDoc -> TcRnIf m n ()
traceHiDiffs :: SDoc -> TcRnIf m n ()
traceIf :: SDoc -> TcRnIf m n ()

-- | Like logInfoTcRn, but for user consumption
printForUserTcRn :: SDoc -> TcRn ()
getPrintUnqualified :: DynFlags -> TcRn PrintUnqualified

-- | Unconditionally dump some trace output
--   
--   The DumpFlag is used only to set the output filename for
--   --dump-to-file, not to decide whether or not to output That part is
--   done by the caller
traceTcRnWithStyle :: PprStyle -> DynFlags -> DumpFlag -> SDoc -> TcRn ()

-- | A wrapper around <a>traceTcRnWithStyle</a> which uses <tt>PprUser</tt>
--   style.
traceTcRnForUser :: DumpFlag -> SDoc -> TcRn ()

-- | A wrapper around <a>traceTcRnWithStyle</a> which uses <tt>PprDump</tt>
--   style.
traceTcRn :: DumpFlag -> SDoc -> TcRn ()

-- | Output a doc if the given <a>DumpFlag</a> is set.
--   
--   By default this logs to stdout However, if the `-ddump-to-file` flag
--   is set, then this will dump output to a file
--   
--   Just a wrapper for <a>dumpSDoc</a>
traceOptTcRn :: DumpFlag -> SDoc -> TcRn ()
traceRn :: String -> SDoc -> TcRn ()
traceTc :: String -> SDoc -> TcRn ()
updTcRef :: TcRef a -> (a -> a) -> TcRnIf gbl lcl ()
writeTcRef :: TcRef a -> a -> TcRnIf gbl lcl ()
readTcRef :: TcRef a -> TcRnIf gbl lcl a
newTcRef :: a -> TcRnIf gbl lcl (TcRef a)
newSysLocalIds :: FastString -> [TcType] -> TcRnIf gbl lcl [TcId]
newSysLocalId :: FastString -> TcType -> TcRnIf gbl lcl TcId
newSysName :: OccName -> TcRnIf gbl lcl Name
newNameAt :: OccName -> SrcSpan -> TcM Name
newName :: OccName -> TcM Name
cloneLocalName :: Name -> TcM Name
newUniqueSupply :: TcRnIf gbl lcl UniqSupply
newUnique :: TcRnIf gbl lcl Unique
escapeArrowScope :: TcM a -> TcM a
newArrowScope :: TcM a -> TcM a

-- | A convenient wrapper for taking a <tt>MaybeErr MsgDoc a</tt> and
--   throwing an exception if it is an error.
withException :: TcRnIf gbl lcl (MaybeErr MsgDoc a) -> TcRnIf gbl lcl a
getEpsAndHpt :: TcRnIf gbl lcl (ExternalPackageState, HomePackageTable)
getHpt :: TcRnIf gbl lcl HomePackageTable

-- | 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
getEps :: TcRnIf gbl lcl ExternalPackageState
getEpsVar :: TcRnIf gbl lcl (TcRef ExternalPackageState)
withDoDynamicToo :: TcRnIf gbl lcl a -> TcRnIf gbl lcl a
getGhcMode :: TcRnIf gbl lcl GhcMode
unlessXOptM :: Extension -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
whenXOptM :: Extension -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
whenWOptM :: WarningFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
whenGOptM :: GeneralFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()

-- | Do it flag is true
whenDOptM :: DumpFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
unsetGOptM :: GeneralFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
unsetXOptM :: Extension -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
setXOptM :: Extension -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
woptM :: WarningFlag -> TcRnIf gbl lcl Bool
goptM :: GeneralFlag -> TcRnIf gbl lcl Bool
doptM :: DumpFlag -> TcRnIf gbl lcl Bool
xoptM :: Extension -> TcRnIf gbl lcl Bool
setEnvs :: (gbl', lcl') -> TcRnIf gbl' lcl' a -> TcRnIf gbl lcl a
getEnvs :: TcRnIf gbl lcl (gbl, lcl)
setLclEnv :: lcl' -> TcRnIf gbl lcl' a -> TcRnIf gbl lcl a
updLclEnv :: (lcl -> lcl) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
getLclEnv :: TcRnIf gbl lcl lcl
setGblEnv :: gbl -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
updGblEnv :: (gbl -> gbl) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
getGblEnv :: TcRnIf gbl lcl gbl
updTopEnv :: (HscEnv -> HscEnv) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
getTopEnv :: TcRnIf gbl lcl HscEnv
discardResult :: TcM a -> TcM ()
initTcRnIf :: Char -> HscEnv -> gbl -> lcl -> TcRnIf gbl lcl a -> IO a
initTcInteractive :: HscEnv -> TcM a -> IO (Messages, Maybe a)

-- | Run a <a>TcM</a> action in the context of an existing <tt>GblEnv</tt>.
initTcWithGbl :: HscEnv -> TcGblEnv -> RealSrcSpan -> TcM r -> IO (Messages, Maybe r)

-- | Setup the initial typechecking environment
initTc :: HscEnv -> HscSource -> Bool -> Module -> RealSrcSpan -> TcM r -> IO (Messages, Maybe r)

-- | Environments which track <a>CostCentreState</a>
class ContainsCostCentreState e
extractCostCentreState :: ContainsCostCentreState e => e -> TcRef CostCentreState
getRoleAnnots :: [Name] -> RoleAnnotEnv -> [LRoleAnnotDecl GhcRn]
lookupRoleAnnot :: RoleAnnotEnv -> Name -> Maybe (LRoleAnnotDecl GhcRn)
emptyRoleAnnotEnv :: RoleAnnotEnv
mkRoleAnnotEnv :: [LRoleAnnotDecl GhcRn] -> RoleAnnotEnv

-- | Access the <a>EvBindsVar</a> carried by the <a>TcPluginM</a> during
--   constraint solving. Returns <a>Nothing</a> if invoked during
--   <a>tcPluginInit</a> or <a>tcPluginStop</a>.
getEvBindsTcPluginM :: TcPluginM EvBindsVar

-- | This function provides an escape for direct access to the <a>TcM</a>
--   monad. It should not be used lightly, and the provided
--   <a>TcPluginM</a> API should be favoured instead.
unsafeTcPluginTcM :: TcM a -> TcPluginM a
runTcPluginM :: TcPluginM a -> EvBindsVar -> TcM a

-- | No signature or a partial signature
hasCompleteSig :: TcSigFun -> Name -> Bool
isPartialSig :: TcIdSigInst -> Bool

-- | 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
emptyImportAvails :: ImportAvails
modDepsElts :: ModuleNameEnv (ModuleName, IsBootInterface) -> [(ModuleName, IsBootInterface)]
mkModDeps :: [(ModuleName, IsBootInterface)] -> ModuleNameEnv (ModuleName, IsBootInterface)
pprPECategory :: PromotionErr -> SDoc
pprTcTyThingCategory :: TcTyThing -> SDoc
thLevel :: ThStage -> ThLevel
outerLevel :: ThLevel
impLevel :: ThLevel
topSpliceStage :: ThStage
topAnnStage :: ThStage
topStage :: ThStage
removeBindingShadowing :: HasOccName a => [a] -> [a]
pushErrCtxtSameOrigin :: ErrCtxt -> CtLoc -> CtLoc
pushErrCtxt :: CtOrigin -> ErrCtxt -> CtLoc -> CtLoc
tcVisibleOrphanMods :: TcGblEnv -> ModuleSet

-- | A <a>NameShape</a> is a substitution on <a>Name</a>s that can be used
--   to refine the identities of a hole while we are renaming interfaces
--   (see <tt>RnModIface</tt>). Specifically, a <a>NameShape</a> for
--   <tt>ns_module_name</tt> <tt>A</tt>, defines a mapping from
--   <tt>{A.T}</tt> (for some <a>OccName</a> <tt>T</tt>) to some arbitrary
--   other <a>Name</a>.
--   
--   The most intruiging thing about a <a>NameShape</a>, however, is how
--   it's constructed. A <a>NameShape</a> is *implied* by the exported
--   <a>AvailInfo</a>s of the implementor of an interface: if an
--   implementor of signature <tt><a>H</a></tt> exports <tt>M.T</tt>, you
--   implicitly define a substitution from <tt>{H.T}</tt> to <tt>M.T</tt>.
--   So a <a>NameShape</a> is computed from the list of <a>AvailInfo</a>s
--   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
type TcRnIf a b = IOEnv Env a b
type TcRn = TcRnIf TcGblEnv TcLclEnv
type IfM lcl = TcRnIf IfGblEnv lcl
type IfG = IfM ()
type IfL = IfM IfLclEnv
type DsM = TcRnIf DsGblEnv DsLclEnv

-- | Historical "renaming monad" (now it's just <a>TcRn</a>).
type RnM = TcRn

-- | Historical "type-checking monad" (now it's just <a>TcRn</a>).
type TcM = TcRn
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
data IfGblEnv
IfGblEnv :: SDoc -> Maybe (Module, IfG TypeEnv) -> IfGblEnv
[if_doc] :: IfGblEnv -> SDoc
[if_rec_types] :: IfGblEnv -> Maybe (Module, IfG TypeEnv)
data IfLclEnv
IfLclEnv :: Module -> Bool -> SDoc -> Maybe NameShape -> Maybe TypeEnv -> FastStringEnv TyVar -> FastStringEnv Id -> IfLclEnv
[if_mod] :: IfLclEnv -> Module
[if_boot] :: IfLclEnv -> Bool
[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
data DsGblEnv
DsGblEnv :: Module -> FamInstEnv -> PrintUnqualified -> IORef Messages -> (IfGblEnv, IfLclEnv) -> CompleteMatchMap -> IORef CostCentreState -> DsGblEnv
[ds_mod] :: DsGblEnv -> Module
[ds_fam_inst_env] :: DsGblEnv -> FamInstEnv
[ds_unqual] :: DsGblEnv -> PrintUnqualified
[ds_msgs] :: DsGblEnv -> IORef Messages
[ds_if_env] :: DsGblEnv -> (IfGblEnv, IfLclEnv)
[ds_complete_matches] :: DsGblEnv -> CompleteMatchMap
[ds_cc_st] :: DsGblEnv -> IORef CostCentreState
data DsLclEnv
DsLclEnv :: DsMetaEnv -> RealSrcSpan -> Delta -> DsLclEnv
[dsl_meta] :: DsLclEnv -> DsMetaEnv
[dsl_loc] :: DsLclEnv -> RealSrcSpan
[dsl_delta] :: DsLclEnv -> Delta
type DsMetaEnv = NameEnv DsMetaVal
data DsMetaVal
DsBound :: Id -> DsMetaVal
DsSplice :: HsExpr GhcTc -> DsMetaVal

-- | <a>FrontendResult</a> describes the result of running the frontend of
--   a Haskell module. Usually, you'll get a <a>FrontendTypecheck</a>,
--   since running the frontend involves typechecking a program, but for an
--   hs-boot merge you'll just get a ModIface, since no actual typechecking
--   occurred.
--   
--   This data type really should be in HscTypes, but it needs to have a
--   TcGblEnv which is only defined here.
data FrontendResult
FrontendTypecheck :: TcGblEnv -> FrontendResult

-- | <a>TcGblEnv</a> 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 <a>TcRef</a> (=
--   <a>IORef</a>).
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 (Set RealSrcSpan) -> TcRef OccSet -> [(Module, Fingerprint)] -> Maybe [(Located (IE 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))) -> Bag EvBind -> Maybe Id -> LHsBinds GhcTc -> NameSet -> [LTcSpecPrag] -> Warnings -> [Annotation] -> [TyCon] -> [ClsInst] -> [FamInst] -> [LRuleDecl GhcTc] -> [LForeignDecl GhcTc] -> [PatSyn] -> Maybe LHsDocString -> !AnyHpcUsage -> SelfBootInfo -> Maybe Name -> TcRef (Bool, WarningMessages) -> [TcPluginSolver] -> [HoleFitPlugin] -> RealSrcSpan -> TcRef WantedConstraints -> [CompleteMatch] -> 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. <tt>Nothing</tt> =&gt; no <tt>default</tt>
--   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
--   HscTypes
[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 HscTypes
[tcg_type_env] :: TcGblEnv -> TypeEnv
[tcg_type_env_var] :: TcGblEnv -> TcRef TypeEnv

-- | Instance envt for all <i>home-package</i> 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:
--   
--   <ol>
--   <li>All of the modules you directly imported (tcRnImports)</li>
--   <li>The orphans (only!) of all imported modules in a GHCi session
--   (runTcInteractive)</li>
--   <li>The module that instantiated a signature</li>
--   <li>Each of the signatures that merged in</li>
--   </ol>
--   
--   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 HscMain)
--   - 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

-- | <tt>True</tt> <a>=</a> 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

-- | <tt>True</tt> <a>=</a> A Template Haskell splice was used.
--   
--   Splices disable recompilation avoidance (see #481)
[tcg_th_splice_used] :: TcGblEnv -> TcRef Bool

-- | Locations of the top-level splices; used for providing details on
--   scope in error messages for out-of-scope variables
[tcg_th_top_level_locs] :: TcGblEnv -> TcRef (Set RealSrcSpan)

-- | 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 [(Located (IE GhcRn), Avails)]
[tcg_rn_imports] :: TcGblEnv -> [LImportDecl GhcRn]

-- | Renamed decls, maybe. <tt>Nothing</tt> <a>=</a> 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)))
[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_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

-- | <tt>True</tt> 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 -> [CompleteMatch]
[tcg_cc_st] :: TcGblEnv -> TcRef CostCentreState
type RecFieldEnv = NameEnv [FieldLabel]
data SelfBootInfo
NoSelfBoot :: SelfBootInfo
SelfBoot :: ModDetails -> NameSet -> SelfBootInfo
[sb_mds] :: SelfBootInfo -> ModDetails
[sb_tcs] :: SelfBootInfo -> NameSet
type ErrCtxt = (Bool, TidyEnv -> TcM (TidyEnv, MsgDoc))
type TcTypeEnv = NameEnv TcTyThing

-- | Type alias for <a>IORef</a>; the convention is we'll use this for
--   mutable bits of data in <a>TcGblEnv</a> which are updated during
--   typechecking and returned at the end.
type TcRef a = IORef a
type TcId = Id
type TcIdSet = IdSet
type TcBinderStack = [TcBinder]
data TcBinder
TcIdBndr :: TcId -> TopLevelFlag -> TcBinder
TcIdBndr_ExpType :: Name -> ExpType -> TopLevelFlag -> TcBinder
TcTvBndr :: Name -> TyVar -> TcBinder
data SpliceType
Typed :: SpliceType
Untyped :: SpliceType
data ThStage
Splice :: SpliceType -> ThStage
RunSplice :: TcRef [ForeignRef (Q ())] -> ThStage
Comp :: ThStage
Brack :: ThStage -> PendingStuff -> ThStage
data PendingStuff
RnPendingUntyped :: TcRef [PendingRnSplice] -> PendingStuff
RnPendingTyped :: PendingStuff
TcPending :: TcRef [PendingTcSplice] -> TcRef WantedConstraints -> PendingStuff
type ThLevel = Int
data ArrowCtxt
NoArrowCtxt :: ArrowCtxt
ArrowCtxt :: LocalRdrEnv -> TcRef WantedConstraints -> ArrowCtxt

-- | A typecheckable thing available in a local context. Could be
--   <a>AGlobal</a> <a>TyThing</a>, but also lexically scoped variables,
--   etc. See <tt>TcEnv</tt> for how to retrieve a <a>TyThing</a> given a
--   <a>Name</a>.
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 PromotionErr
TyConPE :: PromotionErr
ClassPE :: PromotionErr
FamDataConPE :: PromotionErr
ConstrainedDataConPE :: PredType -> PromotionErr
PatSynPE :: PromotionErr
RecDataConPE :: PromotionErr
NoDataKindsTC :: PromotionErr
NoDataKindsDC :: PromotionErr

-- | IdBindingInfo describes how an Id is bound.
--   
--   It is used for the following purposes: a) for static forms in
--   TcExpr.checkClosedInStaticForm and b) to figure out when a nested
--   binding can be generalised, in TcBinds.decideGeneralisationPlan.
data IdBindingInfo
NotLetBound :: IdBindingInfo
ClosedLet :: IdBindingInfo
NonClosedLet :: RhsNames -> ClosedTypeId -> IdBindingInfo

-- | IsGroupClosed describes a group of mutually-recursive bindings
data IsGroupClosed
IsGroupClosed :: NameEnv RhsNames -> ClosedTypeId -> IsGroupClosed
type RhsNames = NameSet
type ClosedTypeId = Bool

-- | <a>ImportAvails</a> summarises what was imported from where,
--   irrespective of whether the imported things are actually used or not.
--   It is used:
--   
--   <ul>
--   <li>when processing the export list,</li>
--   <li>when constructing usage info for the interface file,</li>
--   <li>to identify the list of directly imported modules for
--   initialisation purposes and for optimised overlap checking of family
--   instances,</li>
--   <li>when figuring out what things are really unused</li>
--   </ul>
data ImportAvails
ImportAvails :: ImportedMods -> ModuleNameEnv (ModuleName, IsBootInterface) -> Set InstalledUnitId -> Set InstalledUnitId -> Bool -> [Module] -> [Module] -> ImportAvails

-- | Domain is all directly-imported modules
--   
--   See the documentation on ImportedModsVal in HscTypes 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
--   <i>used</i> 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 (ModuleName, IsBootInterface)

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

-- | 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
--   [RnNames . Tracking Trust Transitively]
[imp_trust_pkgs] :: ImportAvails -> Set InstalledUnitId

-- | 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 [RnNames . Trust Own
--   Package]
[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]
data WhereFrom
ImportByUser :: IsBootInterface -> WhereFrom
ImportBySystem :: WhereFrom
ImportByPlugin :: WhereFrom
type TcSigFun = Name -> Maybe TcSigInfo
data TcSigInfo
TcIdSig :: TcIdSigInfo -> TcSigInfo
TcPatSynSig :: TcPatSynInfo -> TcSigInfo
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
data TcIdSigInst
TISI :: TcIdSigInfo -> [(Name, TcTyVar)] -> TcThetaType -> TcSigmaType -> [(Name, TcTyVar)] -> Maybe TcType -> TcIdSigInst
[sig_inst_sig] :: TcIdSigInst -> TcIdSigInfo
[sig_inst_skols] :: TcIdSigInst -> [(Name, TcTyVar)]
[sig_inst_theta] :: TcIdSigInst -> TcThetaType
[sig_inst_tau] :: TcIdSigInst -> TcSigmaType
[sig_inst_wcs] :: TcIdSigInst -> [(Name, TcTyVar)]
[sig_inst_wcx] :: TcIdSigInst -> Maybe TcType
data TcPatSynInfo
TPSI :: Name -> [TyVarBinder] -> [TyVar] -> TcThetaType -> [TyVar] -> TcThetaType -> TcSigmaType -> TcPatSynInfo
[patsig_name] :: TcPatSynInfo -> Name
[patsig_implicit_bndrs] :: TcPatSynInfo -> [TyVarBinder]
[patsig_univ_bndrs] :: TcPatSynInfo -> [TyVar]
[patsig_req] :: TcPatSynInfo -> TcThetaType
[patsig_ex_bndrs] :: TcPatSynInfo -> [TyVar]
[patsig_prov] :: TcPatSynInfo -> TcThetaType
[patsig_body_ty] :: TcPatSynInfo -> TcSigmaType
type TcPluginSolver = [Ct] -> [Ct] -> [Ct] -> TcPluginM 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 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
type RoleAnnotEnv = NameEnv LRoleAnnotDecl GhcRn
pprCtLoc :: CtLoc -> SDoc
setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc
updateCtLocOrigin :: CtLoc -> (CtOrigin -> CtOrigin) -> CtLoc
setCtLocOrigin :: CtLoc -> CtOrigin -> CtLoc
bumpCtLocDepth :: CtLoc -> CtLoc
setCtLocSpan :: CtLoc -> RealSrcSpan -> CtLoc
ctLocTypeOrKind_maybe :: CtLoc -> Maybe TypeOrKind
ctLocSpan :: CtLoc -> RealSrcSpan
ctLocOrigin :: CtLoc -> CtOrigin
ctLocDepth :: CtLoc -> SubGoalDepth
ctLocLevel :: CtLoc -> TcLevel
ctLocEnv :: CtLoc -> TcLclEnv
mkGivenLoc :: TcLevel -> SkolemInfo -> TcLclEnv -> CtLoc

-- | Take a CtLoc and moves it to the kind level
toKindLoc :: CtLoc -> CtLoc
mkKindLoc :: TcType -> TcType -> CtLoc -> CtLoc
subGoalDepthExceeded :: DynFlags -> SubGoalDepth -> Bool
maxSubGoalDepth :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth
bumpSubGoalDepth :: SubGoalDepth -> SubGoalDepth
initialSubGoalDepth :: SubGoalDepth
eqCanDischargeFR :: CtFlavourRole -> CtFlavourRole -> Bool
funEqCanDischargeF :: CtFlavour -> CtFlavour -> (SwapFlag, Bool)
funEqCanDischarge :: CtEvidence -> CtEvidence -> (SwapFlag, Bool)
eqMayRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool
eqCanRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool
eqCanRewrite :: EqRel -> EqRel -> Bool

-- | Extract the flavour and role from a <a>Ct</a>
ctFlavourRole :: Ct -> CtFlavourRole

-- | Extract the flavour, role, and boxity from a <a>CtEvidence</a>
ctEvFlavourRole :: CtEvidence -> CtFlavourRole
ctEvFlavour :: CtEvidence -> CtFlavour
isGivenOrWDeriv :: CtFlavour -> Bool
isDerived :: CtEvidence -> Bool
isGiven :: CtEvidence -> Bool
isWanted :: CtEvidence -> Bool
ctEvEvId :: CtEvidence -> EvVar
ctEvCoercion :: HasDebugCallStack => CtEvidence -> TcCoercion
ctEvExpr :: CtEvidence -> EvExpr
ctEvTerm :: CtEvidence -> EvTerm

-- | Get the role relevant for a <a>CtEvidence</a>
ctEvRole :: CtEvidence -> Role

-- | Get the equality relation relevant for a <a>CtEvidence</a>
ctEvEqRel :: CtEvidence -> EqRel
ctEvOrigin :: CtEvidence -> CtOrigin
ctEvLoc :: CtEvidence -> CtLoc
ctEvPred :: CtEvidence -> TcPredType
wrapType :: Type -> [TyVar] -> [PredType] -> Type

-- | Wraps the given type with the constraints (via ic_given) in the given
--   implication, according to the variables mentioned (via ic_skols) in
--   the implication, but taking care to only wrap those variables that are
--   mentioned in the type or the implication.
wrapTypeWithImplication :: Type -> Implication -> Type
pprEvVarWithType :: EvVar -> SDoc
pprEvVarTheta :: [EvVar] -> SDoc
pprEvVars :: [EvVar] -> SDoc
implicationPrototype :: Implication
insolubleEqCt :: Ct -> Bool
insolubleCt :: Ct -> Bool
insolubleWC :: WantedConstraints -> Bool
insolubleImplic :: Implication -> Bool
isInsolubleStatus :: ImplicStatus -> Bool
isSolvedStatus :: ImplicStatus -> Bool
insolublesOnly :: WantedConstraints -> WantedConstraints
addInsols :: WantedConstraints -> Bag Ct -> WantedConstraints
addImplics :: WantedConstraints -> Bag Implication -> WantedConstraints
addSimples :: WantedConstraints -> Bag Ct -> WantedConstraints
unionsWC :: [WantedConstraints] -> WantedConstraints
andWC :: WantedConstraints -> WantedConstraints -> WantedConstraints

-- | 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
isEmptyWC :: WantedConstraints -> Bool
mkImplicWC :: Bag Implication -> WantedConstraints
mkSimpleWC :: [CtEvidence] -> WantedConstraints
emptyWC :: WantedConstraints
pprCts :: Cts -> SDoc
isEmptyCts :: Cts -> Bool
emptyCts :: Cts
andManyCts :: [Cts] -> Cts
extendCtsList :: Cts -> [Ct] -> Cts
snocCts :: Cts -> Ct -> Cts
consCts :: Ct -> Cts -> Cts
ctsElts :: Cts -> [Ct]
listToCts :: [Ct] -> Cts
andCts :: Cts -> Cts -> Cts
singleCt :: Ct -> Cts
getPendingWantedScs :: Cts -> ([Ct], Cts)

-- | 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
isPendingScInst :: QCInst -> Maybe QCInst
isPendingScDict :: Ct -> Maybe Ct
isUserTypeErrorCt :: Ct -> Bool

-- | 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
isTypeHoleCt :: Ct -> Bool
isExprHoleCt :: Ct -> Bool
isOutOfScopeCt :: Ct -> Bool
isHoleCt :: Ct -> Bool
isCNonCanonical :: Ct -> Bool
isCFunEqCan :: Ct -> Bool
isCFunEqCan_maybe :: Ct -> Maybe (TyCon, [Type])
isCDictCan_Maybe :: Ct -> Maybe Class
isCTyEqCan :: Ct -> Bool
isDerivedCt :: Ct -> Bool
isGivenCt :: Ct -> Bool
isWantedCt :: Ct -> Bool
isGivenLoc :: CtLoc -> Bool
arisesFromGivens :: Ct -> Bool
isDroppableCt :: Ct -> Bool
dropDerivedSimples :: Cts -> Cts
dropDerivedWC :: WantedConstraints -> WantedConstraints

-- | Returns free variables of WantedConstraints as a deterministically
--   ordered list. See Note [Deterministic FV] in FV.
tyCoVarsOfWCList :: WantedConstraints -> [TyCoVar]

-- | Returns free variables of WantedConstraints as a non-deterministic
--   set. See Note [Deterministic FV] in FV.
tyCoVarsOfWC :: WantedConstraints -> TyCoVarSet

-- | Returns free variables of a bag of constraints as a deterministically
--   odered list. See Note [Deterministic FV] in FV.
tyCoVarsOfCtsList :: Cts -> [TcTyCoVar]

-- | Returns free variables of a bag of constraints as a non-deterministic
--   set. See Note [Deterministic FV] in FV.
tyCoVarsOfCts :: Cts -> TcTyCoVarSet

-- | Returns free variables of constraints as a deterministically ordered.
--   list. See Note [Deterministic FV] in FV.
tyCoVarsOfCtList :: Ct -> [TcTyCoVar]

-- | Returns free variables of constraints as a non-deterministic set
tyCoVarsOfCt :: Ct -> TcTyCoVarSet

-- | Get the equality relation for the given <a>Ct</a>
ctEqRel :: Ct -> EqRel

-- | Get the flavour of the given <a>Ct</a>
ctFlavour :: Ct -> CtFlavour

-- | Makes a new equality predicate with the same role as the given
--   evidence.
mkTcEqPredLikeEv :: CtEvidence -> TcType -> TcType -> TcType
ctEvId :: Ct -> EvVar
ctPred :: Ct -> PredType
ctOrigin :: Ct -> CtOrigin
setCtLoc :: Ct -> CtLoc -> Ct
ctLoc :: Ct -> CtLoc
ctEvidence :: Ct -> CtEvidence
mkGivens :: CtLoc -> [EvId] -> [Ct]
mkInsolubleCt :: CtEvidence -> Ct
mkIrredCt :: CtEvidence -> Ct
mkNonCanonicalCt :: Ct -> Ct
mkNonCanonical :: CtEvidence -> Ct
holeOcc :: Hole -> OccName
type Xi = Type
type Cts = Bag Ct
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 -> Bool -> Ct
[cc_ev] :: Ct -> CtEvidence
[cc_insol] :: Ct -> Bool
CTyEqCan :: CtEvidence -> TcTyVar -> TcType -> EqRel -> Ct
[cc_ev] :: Ct -> CtEvidence
[cc_tyvar] :: Ct -> TcTyVar
[cc_rhs] :: Ct -> TcType
[cc_eq_rel] :: Ct -> EqRel
CFunEqCan :: CtEvidence -> TyCon -> [Xi] -> TcTyVar -> Ct
[cc_ev] :: Ct -> CtEvidence
[cc_fun] :: Ct -> TyCon
[cc_tyargs] :: Ct -> [Xi]
[cc_fsk] :: Ct -> TcTyVar
CNonCanonical :: CtEvidence -> Ct
[cc_ev] :: Ct -> CtEvidence
CHoleCan :: CtEvidence -> Hole -> Ct
[cc_ev] :: Ct -> CtEvidence
[cc_hole] :: Ct -> Hole
CQuantCan :: QCInst -> Ct
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

-- | An expression or type hole
data Hole

-- | Either an out-of-scope variable or a "true" hole in an expression
--   (TypedHoles)
ExprHole :: UnboundVar -> Hole

-- | A hole in a type (PartialTypeSignatures)
TypeHole :: OccName -> Hole
data WantedConstraints
WC :: Cts -> Bag Implication -> WantedConstraints
[wc_simple] :: WantedConstraints -> Cts
[wc_impl] :: WantedConstraints -> Bag Implication
data Implication
Implic :: TcLevel -> [TcTyVar] -> SkolemInfo -> Maybe SDoc -> [EvVar] -> Bool -> Bool -> TcLclEnv -> WantedConstraints -> EvBindsVar -> VarSet -> VarSet -> ImplicStatus -> Implication
[ic_tclvl] :: Implication -> TcLevel
[ic_skols] :: Implication -> [TcTyVar]
[ic_info] :: Implication -> SkolemInfo
[ic_telescope] :: Implication -> Maybe SDoc
[ic_given] :: Implication -> [EvVar]
[ic_no_eqs] :: Implication -> Bool
[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

-- | 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 TyCoRep
HoleDest :: CoercionHole -> TcEvDest
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 CtFlavour
Given :: CtFlavour
Wanted :: ShadowInfo -> CtFlavour
Derived :: CtFlavour
data ShadowInfo
WDeriv :: ShadowInfo
WOnly :: ShadowInfo

-- | Whether or not one <a>Ct</a> can rewrite another is determined by its
--   flavour and its equality relation. See also Note [Flavours with roles]
--   in TcSMonad
type CtFlavourRole = (CtFlavour, EqRel)

-- | See Note [SubGoalDepth]
data SubGoalDepth
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
mkAbsentErrorApp :: Type -> String -> CoreExpr
aBSENT_ERROR_ID :: Id
aBSENT_SUM_FIELD_ERROR_ID :: Id
tYPE_ERROR_ID :: Id
nON_EXHAUSTIVE_GUARDS_ERROR_ID :: Id
nO_METHOD_BINDING_ERROR_ID :: Id
pAT_ERROR_ID :: Id
rEC_CON_ERROR_ID :: Id
rUNTIME_ERROR_ID :: Id
rEC_SEL_ERROR_ID :: Id
errorIds :: [Id]
mkImpossibleExpr :: Type -> CoreExpr
mkRuntimeErrorApp :: Id -> Type -> String -> CoreExpr

-- | Makes a Just from a value of the specified type
mkJustExpr :: Type -> CoreExpr -> CoreExpr

-- | Makes a Nothing for the specified type
mkNothingExpr :: Type -> CoreExpr

-- | Make a <tt>build</tt> expression applied to a locally-bound worker
--   function
mkBuildExpr :: (MonadFail m, MonadThings m, MonadUnique m) => Type -> ((Id, Type) -> (Id, Type) -> m CoreExpr) -> m CoreExpr

-- | Make a fully applied <a>foldr</a> expression
mkFoldrExpr :: MonadThings m => Type -> Type -> CoreExpr -> CoreExpr -> CoreExpr -> m CoreExpr

-- | Make a list containing the given expressions, where the list has the
--   given type
mkListExpr :: Type -> [CoreExpr] -> CoreExpr

-- | Makes a list <tt>(:)</tt> for lists of the specified type
mkConsExpr :: Type -> CoreExpr -> CoreExpr -> CoreExpr

-- | Makes a list <tt>[]</tt> for lists of the specified type
mkNilExpr :: Type -> CoreExpr
floatBindings :: FloatBind -> [Var]

-- | Applies the floats from right to left. That is <tt>wrapFloats [b1, b2,
--   …, bn] u = let b1 in let b2 in … in let bn in u</tt>
wrapFloats :: [FloatBind] -> CoreExpr -> CoreExpr
wrapFloat :: FloatBind -> CoreExpr -> CoreExpr

-- | As <a>mkTupleCase</a>, but for a tuple that is small enough to be
--   guaranteed not to need nesting.
mkSmallTupleCase :: [Id] -> CoreExpr -> Id -> CoreExpr -> CoreExpr

-- | A generalization of <a>mkTupleSelector</a>, 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

-- | <a>mkSmallTupleSelector1</a> is like <a>mkSmallTupleSelector</a> but
--   one-tuples are NOT flattened (see Note [Flattening one-tuples])
--   
--   Like <a>mkTupleSelector</a> but for tuples that are guaranteed never
--   to be "big".
--   
--   <pre>
--   mkSmallTupleSelector [x] x v e = [| e |]
--   mkSmallTupleSelector [x,y,z] x v e = [| case e of v { (x,y,z) -&gt; x } |]
--   </pre>
mkSmallTupleSelector :: [Id] -> Id -> Id -> CoreExpr -> 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 <a>Id</a> in the tuple, then the selector is just
--   the identity.
--   
--   If necessary, we pattern match on a "big" tuple.
mkTupleSelector1 :: [Id] -> Id -> Id -> CoreExpr -> CoreExpr

-- | <a>mkTupleSelector1</a> is like <a>mkTupleSelector</a> 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 <a>Id</a> in the tuple, then the selector is just
--   the identity.
--   
--   If necessary, we pattern match on a "big" tuple.
mkTupleSelector :: [Id] -> Id -> Id -> CoreExpr -> CoreExpr

-- | The unit expression
unitExpr :: 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

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

-- | Make a core tuple of the given boxity; don't flatten 1-tuples
mkCoreTupBoxity :: Boxity -> [CoreExpr] -> CoreExpr

-- | 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 <i>not</i> flatten one-tuples; see Note [Flattening
--   one-tuples]
mkCoreUbxTup :: [Type] -> [CoreExpr] -> CoreExpr

-- | Build a small tuple holding the specified expressions One-tuples are
--   flattened; see Note [Flattening one-tuples]
mkCoreTup :: [CoreExpr] -> 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
mkStringExprFSWith :: Monad m => (Name -> m Id) -> FastString -> m CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to a string morally
--   equivalent to the given <tt>FastString</tt>
mkStringExprFS :: MonadThings m => FastString -> m CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given
--   <tt>String</tt>
mkStringExpr :: MonadThings m => String -> m CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given
--   <tt>Char</tt>
mkCharExpr :: Char -> CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given
--   <tt>Double</tt>
mkDoubleExpr :: Double -> CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given
--   <tt>Float</tt>
mkFloatExpr :: Float -> CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given
--   <tt>Natural</tt>
mkNaturalExpr :: MonadThings m => Integer -> m CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given
--   <tt>Integer</tt>
mkIntegerExpr :: MonadThings m => Integer -> m CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given
--   <tt>Word</tt>
mkWordExprWord :: DynFlags -> Word -> CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the a <tt>Word</tt>
--   with the given value
mkWordExpr :: DynFlags -> Integer -> CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given <tt>Int</tt>
mkIntExprInt :: DynFlags -> Int -> CoreExpr

-- | Create a <a>CoreExpr</a> which will evaluate to the given <tt>Int</tt>
mkIntExpr :: DynFlags -> Integer -> CoreExpr
castBottomExpr :: CoreExpr -> Type -> CoreExpr
mkIfThenElse :: CoreExpr -> CoreExpr -> CoreExpr -> CoreExpr
mkWildCase :: CoreExpr -> Type -> Type -> [CoreAlt] -> CoreExpr

-- | Make a <i>wildcard binder</i>. 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 SimplEnv
mkWildValBinder :: Type -> Id
mkWildEvBinder :: PredType -> EvVar

-- | 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 CoreSyn Note [CoreSyn let/app
--   invariant]
mkCoreApp :: SDoc -> CoreExpr -> CoreExpr -> CoreExpr
infixl 4 `mkCoreApp`

-- | 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 CoreSyn Note [CoreSyn let/app
--   invariant]
mkCoreApps :: CoreExpr -> [CoreExpr] -> CoreExpr
infixl 4 `mkCoreApps`

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

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

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

-- | Bind a binding group over an expression, using a <tt>let</tt> or
--   <tt>case</tt> as appropriate (see <a>CoreSyn#let_app_invariant</a>)
mkCoreLet :: CoreBind -> CoreExpr -> CoreExpr
sortQuantVars :: [Var] -> [Var]
data FloatBind
FloatLet :: CoreBind -> FloatBind
FloatCase :: CoreExpr -> Id -> AltCon -> [Var] -> FloatBind
mkSingleAltCase :: CoreExpr -> Id -> AltCon -> [Var] -> CoreExpr -> CoreExpr
cannotFindInterface :: DynFlags -> ModuleName -> InstalledFindResult -> SDoc
cannotFindModule :: DynFlags -> ModuleName -> FindResult -> SDoc
findObjectLinkable :: Module -> FilePath -> UTCTime -> IO Linkable
findObjectLinkableMaybe :: Module -> ModLocation -> IO (Maybe Linkable)
mkStubPaths :: DynFlags -> ModuleName -> ModLocation -> FilePath

-- | Constructs the filename of a .hi file for a given source file. Does
--   <i>not</i> check whether the .hi file exists
mkHiPath :: DynFlags -> FilePath -> String -> FilePath

-- | Constructs the filename of a .o file for a given source file. Does
--   <i>not</i> check whether the .o file exists
mkObjPath :: DynFlags -> FilePath -> String -> FilePath
mkHiOnlyModLocation :: DynFlags -> Suffix -> FilePath -> String -> IO ModLocation
mkHomeModLocation2 :: DynFlags -> ModuleName -> FilePath -> String -> IO ModLocation
mkHomeModLocation :: DynFlags -> ModuleName -> FilePath -> IO ModLocation
findHomeModule :: HscEnv -> ModuleName -> IO FindResult
uncacheModule :: HscEnv -> ModuleName -> IO ()
addHomeModuleToFinder :: HscEnv -> ModuleName -> ModLocation -> IO Module
findExposedPackageModule :: HscEnv -> ModuleName -> Maybe FastString -> IO FindResult

-- | Locate a specific <a>Module</a>. The purpose of this function is to
--   create a <a>ModLocation</a> for a given <a>Module</a>, 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

-- | Locate a plugin module requested by the user, for a compiler plugin.
--   This consults the same set of exposed packages as
--   <a>findImportedModule</a>, unless <tt>-hide-all-plugin-packages</tt>
--   or <tt>-plugin-package</tt> are specified.
findPluginModule :: HscEnv -> ModuleName -> IO FindResult
flushFinderCaches :: HscEnv -> IO ()

-- | Foreign language of the phase if the phase deals with a foreign code
phaseForeignLanguage :: Phase -> Maybe ForeignSrcLang
extendCompleteMatchMap :: CompleteMatchMap -> [CompleteMatch] -> CompleteMatchMap
mkCompleteMatchMap :: [CompleteMatch] -> CompleteMatchMap

-- | Retrieve the compiled byte-code if possible. Panic if it is a
--   file-based linkable
byteCodeOfObject :: Unlinked -> CompiledByteCode

-- | Retrieve the filename of the linkable if possible. Panic if it is a
--   byte-code object
nameOfObject :: Unlinked -> FilePath

-- | Is this a bytecode linkable with no file on disk?
isInterpretable :: Unlinked -> Bool

-- | Is this an actual file on disk we can link in somehow?
isObject :: Unlinked -> Bool
linkableObjs :: Linkable -> [FilePath]
isObjectLinkable :: Linkable -> Bool
numToTrustInfo :: Word8 -> IfaceTrustInfo
trustInfoToNum :: IfaceTrustInfo -> Word8
noIfaceTrustInfo :: IfaceTrustInfo
setSafeMode :: SafeHaskellMode -> IfaceTrustInfo
getSafeMode :: IfaceTrustInfo -> SafeHaskellMode

-- | Find out if HPC is used by this module or any of the modules it
--   depends upon
isHpcUsed :: HpcInfo -> AnyHpcUsage
emptyHpcInfo :: AnyHpcUsage -> HpcInfo
showModMsg :: DynFlags -> HscTarget -> Bool -> ModSummary -> String

-- | Did this <a>ModSummary</a> originate from a hs-boot file?
isBootSummary :: ModSummary -> Bool
msObjFilePath :: ModSummary -> FilePath
msHiFilePath :: ModSummary -> FilePath
msHsFilePath :: ModSummary -> FilePath

-- | All of the (possibly) home module imports from a <a>ModSummary</a>;
--   that is to say, each of these module names could be a home import if
--   an appropriately named file existed. (This is in contrast to package
--   qualified imports, which are guaranteed not to be home imports.)
ms_home_imps :: ModSummary -> [Located ModuleName]

-- | Like <a>ms_home_imps</a>, but for SOURCE imports.
ms_home_srcimps :: ModSummary -> [Located ModuleName]
ms_home_allimps :: ModSummary -> [ModuleName]
home_imps :: [(Maybe FastString, Located ModuleName)] -> [Located ModuleName]
ms_imps :: ModSummary -> [(Maybe FastString, Located ModuleName)]
ms_mod_name :: ModSummary -> ModuleName
ms_installed_mod :: ModSummary -> InstalledModule
mkModuleGraph :: [ModSummary] -> ModuleGraph

-- | Add a ModSummary to ModuleGraph. Assumes that the new ModSummary is
--   not an element of the ModuleGraph.
extendMG :: ModuleGraph -> ModSummary -> ModuleGraph
isTemplateHaskellOrQQNonBoot :: ModSummary -> Bool
emptyMG :: ModuleGraph

-- | Look up a ModSummary in the ModuleGraph
mgLookupModule :: ModuleGraph -> Module -> Maybe ModSummary
mgElemModule :: ModuleGraph -> Module -> Bool
mgModSummaries :: ModuleGraph -> [ModSummary]
mgBootModules :: ModuleGraph -> ModuleSet

-- | Map a function <tt>f</tt> over all the <tt>ModSummaries</tt>. To
--   preserve invariants <tt>f</tt> can't change the isBoot status.
mapMG :: (ModSummary -> ModSummary) -> ModuleGraph -> ModuleGraph

-- | Determines whether a set of modules requires Template Haskell or Quasi
--   Quotes
--   
--   Note that if the session's <a>DynFlags</a> enabled Template Haskell
--   when <tt>depanal</tt> was called, then each module in the returned
--   module graph will have Template Haskell enabled whether it is actually
--   needed or not.
needsTemplateHaskellOrQQ :: ModuleGraph -> Bool
soExt :: Platform -> FilePath
mkHsSOName :: Platform -> FilePath -> FilePath
mkSOName :: Platform -> FilePath -> FilePath
updNameCache :: IORef NameCache -> (NameCache -> (NameCache, c)) -> IO c

-- | Add stats for one newly-read interface
addEpsInStats :: EpsStats -> Int -> Int -> Int -> EpsStats
noDependencies :: Dependencies
lookupFixity :: FixityEnv -> Name -> Fixity
emptyFixityEnv :: FixityEnv

-- | Creates cached lookup for the <a>mi_fix_fn</a> field of
--   <a>ModIface</a>
mkIfaceFixCache :: [(OccName, Fixity)] -> OccName -> Maybe Fixity
plusWarns :: Warnings -> Warnings -> Warnings
emptyIfaceWarnCache :: OccName -> Maybe WarningTxt

-- | Constructs the cache for the <a>mi_warn_fn</a> field of a
--   <a>ModIface</a>
mkIfaceWarnCache :: Warnings -> OccName -> Maybe WarningTxt

-- | Get the <a>Id</a> from a <a>TyThing</a> if it is a id *or* data
--   constructor thing. Panics otherwise
tyThingId :: TyThing -> Id

-- | Get the <a>ConLike</a> from a <a>TyThing</a> if it is a data
--   constructor thing. Panics otherwise
tyThingConLike :: TyThing -> ConLike

-- | Get the <a>DataCon</a> from a <a>TyThing</a> if it is a data
--   constructor thing. Panics otherwise
tyThingDataCon :: TyThing -> DataCon

-- | Get the <a>CoAxiom</a> from a <a>TyThing</a> if it is a coercion axiom
--   thing. Panics otherwise
tyThingCoAxiom :: TyThing -> CoAxiom Branched

-- | Get the <a>TyCon</a> from a <a>TyThing</a> if it is a type constructor
--   thing. Panics otherwise
tyThingTyCon :: TyThing -> TyCon

-- | As <a>lookupType</a>, but with a marginally easier-to-use interface if
--   you have a <a>HscEnv</a>
lookupTypeHscEnv :: HscEnv -> Name -> IO (Maybe TyThing)

-- | Find the <a>TyThing</a> for the given <a>Name</a> by using all the
--   resources at our disposal: the compiled modules in the
--   <a>HomePackageTable</a> and the compiled modules in other packages
--   that live in <a>PackageTypeEnv</a>. Note that this does NOT look up
--   the <a>TyThing</a> in the module being compiled: you have to do that
--   yourself, if desired
lookupType :: DynFlags -> HomePackageTable -> PackageTypeEnv -> Name -> Maybe TyThing
plusTypeEnv :: TypeEnv -> TypeEnv -> TypeEnv
extendTypeEnvWithIds :: TypeEnv -> [Id] -> TypeEnv
extendTypeEnvList :: TypeEnv -> [TyThing] -> TypeEnv
extendTypeEnv :: TypeEnv -> TyThing -> TypeEnv
lookupTypeEnv :: TypeEnv -> Name -> Maybe TyThing
typeEnvFromEntities :: [Id] -> [TyCon] -> [FamInst] -> TypeEnv
mkTypeEnvWithImplicits :: [TyThing] -> TypeEnv
mkTypeEnv :: [TyThing] -> TypeEnv
typeEnvClasses :: TypeEnv -> [Class]
typeEnvDataCons :: TypeEnv -> [DataCon]
typeEnvPatSyns :: TypeEnv -> [PatSyn]
typeEnvIds :: TypeEnv -> [Id]
typeEnvCoAxioms :: TypeEnv -> [CoAxiom Branched]
typeEnvTyCons :: TypeEnv -> [TyCon]
typeEnvElts :: TypeEnv -> [TyThing]
emptyTypeEnv :: TypeEnv

-- | The Names that a TyThing should bring into scope. Used to build the
--   GlobalRdrEnv for the InteractiveContext.
tyThingAvailInfo :: TyThing -> [AvailInfo]
tyThingsTyCoVars :: [TyThing] -> TyCoVarSet

-- | tyThingParent_maybe x returns (Just p) when pprTyThingInContext should
--   print a declaration for p (albeit with some "..." in it) when asked to
--   show x It returns the *immediate* parent. So a datacon returns its
--   tycon but the tycon could be the associated type of a class, so it in
--   turn might have a parent.
tyThingParent_maybe :: TyThing -> Maybe TyThing

-- | Returns <tt>True</tt> if there should be no interface-file declaration
--   for this thing on its own: either it is built-in, or it is part of
--   some other declaration, or it is generated implicitly by some other
--   declaration.
isImplicitTyThing :: TyThing -> Bool
implicitTyConThings :: TyCon -> [TyThing]
implicitClassThings :: Class -> [TyThing]

-- | Determine the <a>TyThing</a>s brought into scope by another
--   <a>TyThing</a> <i>other</i> than itself. For example, Id's don't have
--   any implicit TyThings as they just bring themselves into scope, but
--   classes bring their dictionary datatype, type constructor and some
--   selector functions into scope, just for a start!
implicitTyThings :: TyThing -> [TyThing]

-- | A function which only qualifies package names if necessary; but
--   qualifies all other identifiers.
pkgQual :: DynFlags -> PrintUnqualified

-- | Creates a function for formatting packages based on two heuristics:
--   (1) don't qualify if the package in question is "main", and (2) only
--   qualify with a unit id if the package ID would be ambiguous.
mkQualPackage :: DynFlags -> QueryQualifyPackage

-- | Creates a function for formatting modules based on two heuristics: (1)
--   if the module is the current module, don't qualify, and (2) if there
--   is only one exposed package which exports this module, don't qualify.
mkQualModule :: DynFlags -> QueryQualifyModule

-- | Creates some functions that work out the best ways to format names for
--   the user according to a set of heuristics.
mkPrintUnqualified :: DynFlags -> GlobalRdrEnv -> PrintUnqualified
substInteractiveContext :: InteractiveContext -> TCvSubst -> InteractiveContext

-- | Add TyThings to the GlobalRdrEnv, earlier ones in the list shadowing
--   later ones, and shadowing existing entries in the GlobalRdrEnv.
icExtendGblRdrEnv :: GlobalRdrEnv -> [TyThing] -> GlobalRdrEnv
setInteractivePrintName :: InteractiveContext -> Name -> InteractiveContext
setInteractivePackage :: HscEnv -> HscEnv
extendInteractiveContextWithIds :: InteractiveContext -> [Id] -> InteractiveContext

-- | extendInteractiveContext is called with new TyThings recently defined
--   to update the InteractiveContext to include them. Ids are easily
--   removed when shadowed, but Classes and TyCons are not. Some work could
--   be done to determine whether they are entirely shadowed, but as you
--   could still have references to them (e.g. instances for classes or
--   values of the type for TyCons), it's not clear whether removing them
--   is even the appropriate behavior.
extendInteractiveContext :: InteractiveContext -> [TyThing] -> [ClsInst] -> [FamInst] -> Maybe [Type] -> FixityEnv -> InteractiveContext

-- | Get the PrintUnqualified function based on the flags and this
--   InteractiveContext
icPrintUnqual :: DynFlags -> InteractiveContext -> PrintUnqualified

-- | This function returns the list of visible TyThings (useful for e.g.
--   showBindings)
icInScopeTTs :: InteractiveContext -> [TyThing]
icInteractiveModule :: InteractiveContext -> Module

-- | Constructs an empty InteractiveContext.
emptyInteractiveContext :: DynFlags -> InteractiveContext
appendStubC :: ForeignStubs -> SDoc -> ForeignStubs
importedByUser :: [ImportedBy] -> [ImportedModsVal]

-- | Constructs an empty ModDetails
emptyModDetails :: ModDetails

-- | Constructs cache for the <a>mi_hash_fn</a> field of a <a>ModIface</a>
mkIfaceHashCache :: [(Fingerprint, IfaceDecl)] -> OccName -> Maybe (OccName, Fingerprint)
emptyFullModIface :: Module -> ModIface
emptyPartialModIface :: Module -> PartialModIface

-- | Given a set of free holes, and a unit identifier, rename the free
--   holes according to the instantiation of the unit identifier. For
--   example, if we have A and B free, and our unit identity is
--   <tt>p[A=<a>C</a>,B=impl:B]</tt>, the renamed free holes are just C.
renameFreeHoles :: UniqDSet ModuleName -> [(ModuleName, Module)] -> UniqDSet ModuleName

-- | The "precise" free holes, e.g., the signatures that this
--   <a>ModIface</a> depends on.
mi_free_holes :: ModIface -> UniqDSet ModuleName

-- | The semantic module for this interface; e.g., if it's a interface for
--   a signature, if <a>mi_module</a> is <tt>p[A=<a>A</a>]:A</tt>,
--   <a>mi_semantic_module</a> will be <tt><a>A</a></tt>.
mi_semantic_module :: forall (a :: ModIfacePhase). ModIface_ a -> Module

-- | Lookups up a (possibly cached) fixity from a <a>ModIface</a>. If one
--   cannot be found, <a>defaultFixity</a> is returned instead.
mi_fix :: ModIface -> OccName -> Fixity

-- | Old-style accessor for whether or not the ModIface came from an
--   hs-boot file.
mi_boot :: ModIface -> Bool

-- | Deal with gathering annotations in from all possible places and
--   combining them into a single <a>AnnEnv</a>
prepareAnnotations :: HscEnv -> Maybe ModGuts -> IO AnnEnv
metaRequestAW :: Functor f => MetaHook f -> LHsExpr GhcTc -> f Serialized
metaRequestD :: Functor f => MetaHook f -> LHsExpr GhcTc -> f [LHsDecl GhcPs]
metaRequestT :: Functor f => MetaHook f -> LHsExpr GhcTc -> f (LHsType GhcPs)
metaRequestP :: Functor f => MetaHook f -> LHsExpr GhcTc -> f (LPat GhcPs)
metaRequestE :: Functor f => MetaHook f -> LHsExpr GhcTc -> f (LHsExpr GhcPs)

-- | Get rules from modules "below" this one (in the dependency sense)
hptRules :: HscEnv -> [(ModuleName, IsBootInterface)] -> [CoreRule]

-- | Find all the instance declarations (of classes and families) from the
--   Home Package Table filtered by the provided predicate function. Used
--   in <tt>tcRnImports</tt>, to select the instances that are in the
--   transitive closure of imports from the currently compiled module.
hptInstances :: HscEnv -> (ModuleName -> Bool) -> ([ClsInst], [FamInst])
hptCompleteSigs :: HscEnv -> [CompleteMatch]

-- | Find the <a>ModIface</a> for a <a>Module</a>, searching in both the
--   loaded home and external package module information
lookupIfaceByModule :: HomePackageTable -> PackageIfaceTable -> Module -> Maybe ModIface
lookupHptByModule :: HomePackageTable -> Module -> Maybe HomeModInfo
listToHpt :: [(ModuleName, HomeModInfo)] -> HomePackageTable
addListToHpt :: HomePackageTable -> [(ModuleName, HomeModInfo)] -> HomePackageTable
addToHpt :: HomePackageTable -> ModuleName -> HomeModInfo -> HomePackageTable
delFromHpt :: HomePackageTable -> ModuleName -> HomePackageTable
mapHpt :: (HomeModInfo -> HomeModInfo) -> HomePackageTable -> HomePackageTable
allHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> Bool
filterHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> HomePackageTable
eltsHpt :: HomePackageTable -> [HomeModInfo]
lookupHptDirectly :: HomePackageTable -> Unique -> Maybe HomeModInfo
lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo
pprHPT :: HomePackageTable -> SDoc

-- | Constructs an empty PackageIfaceTable
emptyPackageIfaceTable :: PackageIfaceTable

-- | Constructs an empty HomePackageTable
emptyHomePackageTable :: HomePackageTable
pprTargetId :: TargetId -> SDoc
pprTarget :: Target -> SDoc

-- | Retrieve the ExternalPackageState cache.
hscEPS :: HscEnv -> IO ExternalPackageState
handleFlagWarnings :: DynFlags -> [Warn] -> IO ()

-- | Given a bag of warnings, turn them into an exception if -Werror is
--   enabled, or print them out otherwise.
printOrThrowWarnings :: DynFlags -> Bag WarnMsg -> IO ()

-- | Perform the given action and call the exception handler if the action
--   throws a <a>SourceError</a>. See <a>SourceError</a> for more
--   information.
handleSourceError :: ExceptionMonad m => (SourceError -> m a) -> m a -> m a
throwOneError :: MonadIO io => ErrMsg -> io a
throwErrors :: MonadIO io => ErrorMessages -> io a
mkApiErr :: DynFlags -> SDoc -> GhcApiError
srcErrorMessages :: SourceError -> ErrorMessages
mkSrcErr :: ErrorMessages -> SourceError
runInteractiveHsc :: HscEnv -> Hsc a -> IO a
mkInteractiveHscEnv :: HscEnv -> HscEnv
runHsc :: HscEnv -> Hsc a -> IO a

-- | Status of a compilation to hard-code
data HscStatus

-- | Nothing to do.
HscNotGeneratingCode :: ModIface -> HscStatus

-- | Nothing to do because code already exists.
HscUpToDate :: ModIface -> HscStatus

-- | Update boot file result.
HscUpdateBoot :: ModIface -> HscStatus

-- | Generate signature file (backpack)
HscUpdateSig :: ModIface -> HscStatus

-- | Recompile this module.
HscRecomp :: CgGuts -> !ModLocation -> !PartialModIface -> !Maybe Fingerprint -> !DynFlags -> HscStatus

-- | Information for the code generator.
[hscs_guts] :: HscStatus -> CgGuts

-- | Module info
[hscs_mod_location] :: HscStatus -> !ModLocation

-- | Partial interface
[hscs_partial_iface] :: HscStatus -> !PartialModIface

-- | Old interface hash for this compilation, if an old interface file
--   exists. Pass to <tt>hscMaybeWriteIface</tt> when writing the interface
--   to avoid updating the existing interface when the interface isn't
--   changed.
[hscs_old_iface_hash] :: HscStatus -> !Maybe Fingerprint

-- | Generate final iface using this DynFlags. FIXME (osa): I don't
--   understand why this is necessary, but I spent almost two days trying
--   to figure this out and I couldn't .. perhaps someone who understands
--   this code better will remove this later.
[hscs_iface_dflags] :: HscStatus -> !DynFlags
newtype Hsc a
Hsc :: (HscEnv -> WarningMessages -> IO (a, WarningMessages)) -> Hsc a

-- | A source error is an error that is caused by one or more errors in the
--   source code. A <a>SourceError</a> is thrown by many functions in the
--   compilation pipeline. Inside GHC these errors are merely printed via
--   <a>log_action</a>, but API clients may treat them differently, for
--   example, insert them into a list box. If you want the default
--   behaviour, use the idiom:
--   
--   <pre>
--   handleSourceError printExceptionAndWarnings $ do
--     ... api calls that may fail ...
--   </pre>
--   
--   The <a>SourceError</a>s error messages can be accessed via
--   <a>srcErrorMessages</a>. This list may be empty if the compiler failed
--   due to <tt>-Werror</tt> (<a>Opt_WarnIsError</a>).
--   
--   See <tt>printExceptionAndWarnings</tt> for more information on what to
--   take care of when writing a custom error handler.
data SourceError

-- | An error thrown if the GHC API is used in an incorrect fashion.
data GhcApiError

-- | HscEnv is like <tt>Session</tt>, except that some of the fields are
--   immutable. An HscEnv is used to compile a single module from plain
--   Haskell source code (after preprocessing) to either C, assembly or
--   C--. It's also used to store the dynamic linker state to allow for
--   multiple linkers in the same address space. Things like the module
--   graph don't change during a single compilation.
--   
--   Historical note: "hsc" used to be the name of the compiler binary,
--   when there was a separate driver and compiler. To compile a single
--   module, the driver would invoke hsc on the source code... so nowadays
--   we think of hsc as the layer of the compiler that deals with compiling
--   a single module.
data HscEnv
HscEnv :: DynFlags -> [Target] -> ModuleGraph -> InteractiveContext -> HomePackageTable -> {-# UNPACK #-} !IORef ExternalPackageState -> {-# UNPACK #-} !IORef NameCache -> {-# UNPACK #-} !IORef FinderCache -> Maybe (Module, IORef TypeEnv) -> MVar (Maybe IServ) -> DynLinker -> HscEnv

-- | The dynamic flag settings
[hsc_dflags] :: HscEnv -> DynFlags

-- | The targets (or roots) of the current session
[hsc_targets] :: HscEnv -> [Target]

-- | The module graph of the current session
[hsc_mod_graph] :: HscEnv -> ModuleGraph

-- | The context for evaluating interactive statements
[hsc_IC] :: HscEnv -> InteractiveContext

-- | The home package table describes already-compiled home-package
--   modules, <i>excluding</i> the module we are compiling right now. (In
--   one-shot mode the current module is the only home-package module, so
--   hsc_HPT is empty. All other modules count as "external-package"
--   modules. However, even in GHCi mode, hi-boot interfaces are
--   demand-loaded into the external-package table.)
--   
--   <a>hsc_HPT</a> is not mutable because we only demand-load external
--   packages; the home package is eagerly loaded, module by module, by the
--   compilation manager.
--   
--   The HPT may contain modules compiled earlier by <tt>--make</tt> but
--   not actually below the current module in the dependency graph.
--   
--   (This changes a previous invariant: changed Jan 05.)
[hsc_HPT] :: HscEnv -> HomePackageTable

-- | Information about the currently loaded external packages. This is
--   mutable because packages will be demand-loaded during a compilation
--   run as required.
[hsc_EPS] :: HscEnv -> {-# UNPACK #-} !IORef ExternalPackageState

-- | As with <a>hsc_EPS</a>, this is side-effected by compiling to reflect
--   sucking in interface files. They cache the state of external interface
--   files, in effect.
[hsc_NC] :: HscEnv -> {-# UNPACK #-} !IORef NameCache

-- | The cached result of performing finding in the file system
[hsc_FC] :: HscEnv -> {-# UNPACK #-} !IORef FinderCache

-- | Used for one-shot compilation only, to initialise the
--   <tt>IfGblEnv</tt>. See <a>tcg_type_env_var</a> for <a>TcGblEnv</a>.
--   See also Note [hsc_type_env_var hack]
[hsc_type_env_var] :: HscEnv -> Maybe (Module, IORef TypeEnv)

-- | interactive server process. Created the first time it is needed.
[hsc_iserv] :: HscEnv -> MVar (Maybe IServ)

-- | dynamic linker.
[hsc_dynLinker] :: HscEnv -> DynLinker
data IServ
IServ :: Pipe -> ProcessHandle -> IORef (UniqFM (Ptr ())) -> [HValueRef] -> IServ
[iservPipe] :: IServ -> Pipe
[iservProcess] :: IServ -> ProcessHandle
[iservLookupSymbolCache] :: IServ -> IORef (UniqFM (Ptr ()))
[iservPendingFrees] :: IServ -> [HValueRef]

-- | A compilation target.
--   
--   A target may be supplied with the actual text of the module. If so,
--   use this instead of the file contents (this is for use in an IDE where
--   the file hasn't been saved by the user yet).
data Target
Target :: TargetId -> Bool -> Maybe (InputFileBuffer, UTCTime) -> Target

-- | module or filename
[targetId] :: Target -> TargetId

-- | object code allowed?
[targetAllowObjCode] :: Target -> Bool

-- | Optional in-memory buffer containing the source code GHC should use
--   for this target instead of reading it from disk.
--   
--   Since GHC version 8.10 modules which require preprocessors such as
--   Literate Haskell or CPP to run are also supported.
--   
--   If a corresponding source file does not exist on disk this will result
--   in a <a>SourceError</a> exception if <tt>targetId = TargetModule
--   _</tt> is used. However together with <tt>targetId = TargetFile _</tt>
--   GHC will not complain about the file missing.
[targetContents] :: Target -> Maybe (InputFileBuffer, UTCTime)
data TargetId

-- | A module name: search for the file
TargetModule :: ModuleName -> TargetId

-- | A filename: preprocess &amp; parse it to find the module name. If
--   specified, the Phase indicates how to compile this file (which phase
--   to start from). Nothing indicates the starting phase should be
--   determined from the suffix of the filename.
TargetFile :: FilePath -> Maybe Phase -> TargetId
type InputFileBuffer = StringBuffer

-- | Helps us find information about modules in the home package
type HomePackageTable = DModuleNameEnv HomeModInfo

-- | Helps us find information about modules in the imported packages
type PackageIfaceTable = ModuleEnv ModIface

-- | Information about modules in the package being compiled
data HomeModInfo
HomeModInfo :: !ModIface -> !ModDetails -> !Maybe Linkable -> HomeModInfo

-- | The basic loaded interface file: every loaded module has one of these,
--   even if it is imported from another package
[hm_iface] :: HomeModInfo -> !ModIface

-- | Extra information that has been created from the <a>ModIface</a> for
--   the module, typically during typechecking
[hm_details] :: HomeModInfo -> !ModDetails

-- | The actual artifact we would like to link to access things in this
--   module.
--   
--   <a>hm_linkable</a> might be Nothing:
--   
--   <ol>
--   <li>If this is an .hs-boot module</li>
--   <li>Temporarily during compilation if we pruned away the old linkable
--   because it was out of date.</li>
--   </ol>
--   
--   After a complete compilation (<a>load</a>), all <a>hm_linkable</a>
--   fields in the <a>HomePackageTable</a> will be <tt>Just</tt>.
--   
--   When re-linking a module (<a>HscNoRecomp</a>), we construct the
--   <a>HomeModInfo</a> by building a new <a>ModDetails</a> from the old
--   <a>ModIface</a> (only).
[hm_linkable] :: HomeModInfo -> !Maybe Linkable

-- | The supported metaprogramming result types
data MetaRequest
MetaE :: (LHsExpr GhcPs -> MetaResult) -> MetaRequest
MetaP :: (LPat GhcPs -> MetaResult) -> MetaRequest
MetaT :: (LHsType GhcPs -> MetaResult) -> MetaRequest
MetaD :: ([LHsDecl GhcPs] -> MetaResult) -> MetaRequest
MetaAW :: (Serialized -> MetaResult) -> MetaRequest

-- | data constructors not exported to ensure correct result type
data MetaResult
type MetaHook (f :: Type -> Type) = MetaRequest -> LHsExpr GhcTc -> f MetaResult

-- | The <a>FinderCache</a> maps modules to the result of searching for
--   that module. It records the results of searching for modules along the
--   search path. On <tt>:load</tt>, we flush the entire contents of this
--   cache.
type FinderCache = InstalledModuleEnv InstalledFindResult
data InstalledFindResult
InstalledFound :: ModLocation -> InstalledModule -> InstalledFindResult
InstalledNoPackage :: InstalledUnitId -> InstalledFindResult
InstalledNotFound :: [FilePath] -> Maybe InstalledUnitId -> InstalledFindResult

-- | The result of searching for an imported module.
--   
--   NB: FindResult manages both user source-import lookups (which can
--   result in <a>Module</a>) as well as direct imports for interfaces
--   (which always result in <a>InstalledModule</a>).
data FindResult

-- | The module was found
Found :: ModLocation -> Module -> FindResult

-- | The requested package was not found
NoPackage :: UnitId -> FindResult

-- | _Error_: both in multiple packages
FoundMultiple :: [(Module, ModuleOrigin)] -> FindResult

-- | Not found
NotFound :: [FilePath] -> Maybe UnitId -> [UnitId] -> [UnitId] -> [(UnitId, UnusablePackageReason)] -> [ModuleSuggestion] -> FindResult
[fr_paths] :: FindResult -> [FilePath]
[fr_pkg] :: FindResult -> Maybe UnitId
[fr_mods_hidden] :: FindResult -> [UnitId]
[fr_pkgs_hidden] :: FindResult -> [UnitId]
[fr_unusables] :: FindResult -> [(UnitId, UnusablePackageReason)]
[fr_suggestions] :: FindResult -> [ModuleSuggestion]
type PartialModIface = ModIface_ 'ModIfaceCore
type ModIface = ModIface_ 'ModIfaceFinal

-- | Extends a PartialModIface with information which is either: * Computed
--   after codegen * Or computed just before writing the iface to disk.
--   (Hashes) In order to fully instantiate it.
data ModIfaceBackend
ModIfaceBackend :: !Fingerprint -> !Fingerprint -> !Fingerprint -> !Fingerprint -> !Fingerprint -> !Fingerprint -> !WhetherHasOrphans -> !WhetherHasFamInst -> !Fingerprint -> !Fingerprint -> !OccName -> Maybe WarningTxt -> !OccName -> Maybe Fixity -> !OccName -> Maybe (OccName, Fingerprint) -> ModIfaceBackend

-- | Hash of the whole interface
[mi_iface_hash] :: ModIfaceBackend -> !Fingerprint

-- | Hash of the ABI only
[mi_mod_hash] :: ModIfaceBackend -> !Fingerprint

-- | Hash of the important flags used when compiling the module, excluding
--   optimisation flags
[mi_flag_hash] :: ModIfaceBackend -> !Fingerprint

-- | Hash of optimisation flags
[mi_opt_hash] :: ModIfaceBackend -> !Fingerprint

-- | Hash of hpc flags
[mi_hpc_hash] :: ModIfaceBackend -> !Fingerprint

-- | Hash of plugins
[mi_plugin_hash] :: ModIfaceBackend -> !Fingerprint

-- | Whether this module has orphans
[mi_orphan] :: ModIfaceBackend -> !WhetherHasOrphans

-- | Whether this module has family instances. See Note [The type family
--   instance consistency story].
[mi_finsts] :: ModIfaceBackend -> !WhetherHasFamInst

-- | Hash of export list
[mi_exp_hash] :: ModIfaceBackend -> !Fingerprint

-- | Hash for orphan rules, class and family instances combined
[mi_orphan_hash] :: ModIfaceBackend -> !Fingerprint

-- | Cached lookup for <a>mi_warns</a>
[mi_warn_fn] :: ModIfaceBackend -> !OccName -> Maybe WarningTxt

-- | Cached lookup for <a>mi_fixities</a>
[mi_fix_fn] :: ModIfaceBackend -> !OccName -> Maybe Fixity

-- | Cached lookup for <a>mi_decls</a>. The <tt>Nothing</tt> in
--   <a>mi_hash_fn</a> means that the thing isn't in decls. It's useful to
--   know that when seeing if we are up to date wrt. the old interface. The
--   <a>OccName</a> is the parent of the name, if it has one.
[mi_hash_fn] :: ModIfaceBackend -> !OccName -> Maybe (OccName, Fingerprint)

-- | A <a>ModIface</a> plus a <a>ModDetails</a> summarises everything we
--   know about a compiled module. The <a>ModIface</a> is the stuff
--   *before* linking, and can be written out to an interface file. The
--   'ModDetails is after linking and can be completely recovered from just
--   the <a>ModIface</a>.
--   
--   When we read an interface file, we also construct a <a>ModIface</a>
--   from it, except that we explicitly make the <a>mi_decls</a> and a few
--   other fields empty; as when reading we consolidate the declarations
--   etc. into a number of indexed maps and environments in the
--   <a>ExternalPackageState</a>.
data ModIface_ (phase :: ModIfacePhase)
ModIface :: !Module -> !Maybe Module -> !HscSource -> Dependencies -> [Usage] -> ![IfaceExport] -> !Bool -> [(OccName, Fixity)] -> Warnings -> [IfaceAnnotation] -> [IfaceDeclExts phase] -> !Maybe GlobalRdrEnv -> [IfaceClsInst] -> [IfaceFamInst] -> [IfaceRule] -> !AnyHpcUsage -> !IfaceTrustInfo -> !Bool -> [IfaceCompleteMatch] -> Maybe HsDocString -> DeclDocMap -> ArgDocMap -> !IfaceBackendExts phase -> ModIface_ (phase :: ModIfacePhase)

-- | Name of the module we are for
[mi_module] :: ModIface_ (phase :: ModIfacePhase) -> !Module

-- | Are we a sig of another mod?
[mi_sig_of] :: ModIface_ (phase :: ModIfacePhase) -> !Maybe Module

-- | Boot? Signature?
[mi_hsc_src] :: ModIface_ (phase :: ModIfacePhase) -> !HscSource

-- | The dependencies of the module. This is consulted for
--   directly-imported modules, but not for anything else (hence lazy)
[mi_deps] :: ModIface_ (phase :: ModIfacePhase) -> Dependencies

-- | Usages; kept sorted so that it's easy to decide whether to write a new
--   iface file (changing usages doesn't affect the hash of this module)
--   NOT STRICT! we read this field lazily from the interface file It is
--   *only* consulted by the recompilation checker
[mi_usages] :: ModIface_ (phase :: ModIfacePhase) -> [Usage]

-- | Exports Kept sorted by (mod,occ), to make version comparisons easier
--   Records the modules that are the declaration points for things
--   exported by this module, and the <a>OccName</a>s of those things
[mi_exports] :: ModIface_ (phase :: ModIfacePhase) -> ![IfaceExport]

-- | Module required TH splices when it was compiled. This disables
--   recompilation avoidance (see #481).
[mi_used_th] :: ModIface_ (phase :: ModIfacePhase) -> !Bool

-- | Fixities NOT STRICT! we read this field lazily from the interface file
[mi_fixities] :: ModIface_ (phase :: ModIfacePhase) -> [(OccName, Fixity)]

-- | Warnings NOT STRICT! we read this field lazily from the interface file
[mi_warns] :: ModIface_ (phase :: ModIfacePhase) -> Warnings

-- | Annotations NOT STRICT! we read this field lazily from the interface
--   file
[mi_anns] :: ModIface_ (phase :: ModIfacePhase) -> [IfaceAnnotation]

-- | Type, class and variable declarations The hash of an Id changes if its
--   fixity or deprecations change (as well as its type of course) Ditto
--   data constructors, class operations, except that the hash of the
--   parent class/tycon changes
[mi_decls] :: ModIface_ (phase :: ModIfacePhase) -> [IfaceDeclExts phase]

-- | Binds all the things defined at the top level in the <i>original
--   source</i> code for this module. which is NOT the same as mi_exports,
--   nor mi_decls (which may contains declarations for things not actually
--   defined by the user). Used for GHCi and for inspecting the contents of
--   modules via the GHC API only.
--   
--   (We need the source file to figure out the top-level environment, if
--   we didn't compile this module from source then this field contains
--   <tt>Nothing</tt>).
--   
--   Strictly speaking this field should live in the <a>HomeModInfo</a>,
--   but that leads to more plumbing.
[mi_globals] :: ModIface_ (phase :: ModIfacePhase) -> !Maybe GlobalRdrEnv

-- | Sorted class instance
[mi_insts] :: ModIface_ (phase :: ModIfacePhase) -> [IfaceClsInst]

-- | Sorted family instances
[mi_fam_insts] :: ModIface_ (phase :: ModIfacePhase) -> [IfaceFamInst]

-- | Sorted rules
[mi_rules] :: ModIface_ (phase :: ModIfacePhase) -> [IfaceRule]

-- | True if this program uses Hpc at any point in the program.
[mi_hpc] :: ModIface_ (phase :: ModIfacePhase) -> !AnyHpcUsage

-- | Safe Haskell Trust information for this module.
[mi_trust] :: ModIface_ (phase :: ModIfacePhase) -> !IfaceTrustInfo

-- | Do we require the package this module resides in be trusted to trust
--   this module? This is used for the situation where a module is Safe (so
--   doesn't require the package be trusted itself) but imports some
--   trustworthy modules from its own package (which does require its own
--   package be trusted). See Note [RnNames . Trust Own Package]
[mi_trust_pkg] :: ModIface_ (phase :: ModIfacePhase) -> !Bool
[mi_complete_sigs] :: ModIface_ (phase :: ModIfacePhase) -> [IfaceCompleteMatch]

-- | Module header.
[mi_doc_hdr] :: ModIface_ (phase :: ModIfacePhase) -> Maybe HsDocString

-- | Docs on declarations.
[mi_decl_docs] :: ModIface_ (phase :: ModIfacePhase) -> DeclDocMap

-- | Docs on arguments.
[mi_arg_docs] :: ModIface_ (phase :: ModIfacePhase) -> ArgDocMap

-- | Either <tt>()</tt> or <a>ModIfaceBackend</a> for a fully instantiated
--   interface.
[mi_final_exts] :: ModIface_ (phase :: ModIfacePhase) -> !IfaceBackendExts phase

-- | The original names declared of a certain module that are exported
type IfaceExport = AvailInfo

-- | The <a>ModDetails</a> is essentially a cache for information in the
--   <a>ModIface</a> for home modules only. Information relating to
--   packages will be loaded into global environments in
--   <a>ExternalPackageState</a>.
data ModDetails
ModDetails :: [AvailInfo] -> !TypeEnv -> ![ClsInst] -> ![FamInst] -> ![CoreRule] -> ![Annotation] -> [CompleteMatch] -> ModDetails
[md_exports] :: ModDetails -> [AvailInfo]

-- | Local type environment for this particular module Includes Ids,
--   TyCons, PatSyns
[md_types] :: ModDetails -> !TypeEnv

-- | <a>DFunId</a>s for the instances in this module
[md_insts] :: ModDetails -> ![ClsInst]
[md_fam_insts] :: ModDetails -> ![FamInst]

-- | Domain may include <a>Id</a>s from other modules
[md_rules] :: ModDetails -> ![CoreRule]

-- | Annotations present in this module: currently they only annotate
--   things also declared in this module
[md_anns] :: ModDetails -> ![Annotation]

-- | Complete match pragmas for this module
[md_complete_sigs] :: ModDetails -> [CompleteMatch]

-- | Records the modules directly imported by a module for extracting e.g.
--   usage information, and also to give better error message
type ImportedMods = ModuleEnv [ImportedBy]

-- | If a module was "imported" by the user, we associate it with more
--   detailed usage information <a>ImportedModsVal</a>; a module imported
--   by the system only gets used for usage information.
data ImportedBy
ImportedByUser :: ImportedModsVal -> ImportedBy
ImportedBySystem :: ImportedBy
data ImportedModsVal
ImportedModsVal :: ModuleName -> SrcSpan -> IsSafeImport -> Bool -> !GlobalRdrEnv -> Bool -> ImportedModsVal

-- | The name the module is imported with
[imv_name] :: ImportedModsVal -> ModuleName

-- | the source span of the whole import
[imv_span] :: ImportedModsVal -> SrcSpan

-- | whether this is a safe import
[imv_is_safe] :: ImportedModsVal -> IsSafeImport

-- | whether this is an "hiding" import
[imv_is_hiding] :: ImportedModsVal -> Bool

-- | all the things the module could provide NB. BangPattern here:
--   otherwise this leaks. (#15111)
[imv_all_exports] :: ImportedModsVal -> !GlobalRdrEnv

-- | whether this is a qualified import
[imv_qualified] :: ImportedModsVal -> Bool

-- | A ModGuts is carried through the compiler, accumulating stuff as it
--   goes There is only one ModGuts at any time, the one for the module
--   being compiled right now. Once it is compiled, a <a>ModIface</a> and
--   <a>ModDetails</a> are extracted and the ModGuts is discarded.
data ModGuts
ModGuts :: !Module -> HscSource -> SrcSpan -> ![AvailInfo] -> !Dependencies -> ![Usage] -> !Bool -> !GlobalRdrEnv -> !FixityEnv -> ![TyCon] -> ![ClsInst] -> ![FamInst] -> ![PatSyn] -> ![CoreRule] -> !CoreProgram -> !ForeignStubs -> ![(ForeignSrcLang, FilePath)] -> !Warnings -> [Annotation] -> [CompleteMatch] -> !HpcInfo -> !Maybe ModBreaks -> InstEnv -> FamInstEnv -> SafeHaskellMode -> Bool -> !Maybe HsDocString -> !DeclDocMap -> !ArgDocMap -> ModGuts

-- | Module being compiled
[mg_module] :: ModGuts -> !Module

-- | Whether it's an hs-boot module
[mg_hsc_src] :: ModGuts -> HscSource

-- | For error messages from inner passes
[mg_loc] :: ModGuts -> SrcSpan

-- | What it exports
[mg_exports] :: ModGuts -> ![AvailInfo]

-- | What it depends on, directly or otherwise
[mg_deps] :: ModGuts -> !Dependencies

-- | What was used? Used for interfaces.
[mg_usages] :: ModGuts -> ![Usage]

-- | Did we run a TH splice?
[mg_used_th] :: ModGuts -> !Bool

-- | Top-level lexical environment
[mg_rdr_env] :: ModGuts -> !GlobalRdrEnv

-- | Fixities declared in this module. Used for creating interface files.
[mg_fix_env] :: ModGuts -> !FixityEnv

-- | TyCons declared in this module (includes TyCons for classes)
[mg_tcs] :: ModGuts -> ![TyCon]

-- | Class instances declared in this module
[mg_insts] :: ModGuts -> ![ClsInst]

-- | Family instances declared in this module
[mg_fam_insts] :: ModGuts -> ![FamInst]

-- | Pattern synonyms declared in this module
[mg_patsyns] :: ModGuts -> ![PatSyn]

-- | Before the core pipeline starts, contains See Note [Overall plumbing
--   for rules] in Rules.hs
[mg_rules] :: ModGuts -> ![CoreRule]

-- | Bindings for this module
[mg_binds] :: ModGuts -> !CoreProgram

-- | Foreign exports declared in this module
[mg_foreign] :: ModGuts -> !ForeignStubs

-- | Files to be compiled with the C compiler
[mg_foreign_files] :: ModGuts -> ![(ForeignSrcLang, FilePath)]

-- | Warnings declared in the module
[mg_warns] :: ModGuts -> !Warnings

-- | Annotations declared in this module
[mg_anns] :: ModGuts -> [Annotation]

-- | Complete Matches
[mg_complete_sigs] :: ModGuts -> [CompleteMatch]

-- | Coverage tick boxes in the module
[mg_hpc_info] :: ModGuts -> !HpcInfo

-- | Breakpoints for the module
[mg_modBreaks] :: ModGuts -> !Maybe ModBreaks

-- | Class instance environment for <i>home-package</i> modules (including
--   this one); c.f. <tt>tcg_inst_env</tt>
[mg_inst_env] :: ModGuts -> InstEnv

-- | Type-family instance environment for <i>home-package</i> modules
--   (including this one); c.f. <tt>tcg_fam_inst_env</tt>
[mg_fam_inst_env] :: ModGuts -> FamInstEnv

-- | Safe Haskell mode
[mg_safe_haskell] :: ModGuts -> SafeHaskellMode

-- | Do we need to trust our own package for Safe Haskell? See Note
--   [RnNames . Trust Own Package]
[mg_trust_pkg] :: ModGuts -> Bool

-- | Module header.
[mg_doc_hdr] :: ModGuts -> !Maybe HsDocString

-- | Docs on declarations.
[mg_decl_docs] :: ModGuts -> !DeclDocMap

-- | Docs on arguments.
[mg_arg_docs] :: ModGuts -> !ArgDocMap

-- | A restricted form of <a>ModGuts</a> for code generation purposes
data CgGuts
CgGuts :: !Module -> [TyCon] -> CoreProgram -> !ForeignStubs -> ![(ForeignSrcLang, FilePath)] -> ![InstalledUnitId] -> !HpcInfo -> !Maybe ModBreaks -> [SptEntry] -> CgGuts

-- | Module being compiled
[cg_module] :: CgGuts -> !Module

-- | Algebraic data types (including ones that started life as classes);
--   generate constructors and info tables. Includes newtypes, just for the
--   benefit of External Core
[cg_tycons] :: CgGuts -> [TyCon]

-- | The tidied main bindings, including previously-implicit bindings for
--   record and class selectors, and data constructor wrappers. But *not*
--   data constructor workers; reason: we regard them as part of the
--   code-gen of tycons
[cg_binds] :: CgGuts -> CoreProgram

-- | Foreign export stubs
[cg_foreign] :: CgGuts -> !ForeignStubs
[cg_foreign_files] :: CgGuts -> ![(ForeignSrcLang, FilePath)]

-- | Dependent packages, used to generate #includes for C code gen
[cg_dep_pkgs] :: CgGuts -> ![InstalledUnitId]

-- | Program coverage tick box information
[cg_hpc_info] :: CgGuts -> !HpcInfo

-- | Module breakpoints
[cg_modBreaks] :: CgGuts -> !Maybe ModBreaks

-- | Static pointer table entries for static forms defined in the module.
--   See Note [Grand plan for static forms] in StaticPtrTable
[cg_spt_entries] :: CgGuts -> [SptEntry]

-- | Foreign export stubs
data ForeignStubs

-- | We don't have any stubs
NoStubs :: ForeignStubs

-- | There are some stubs. Parameters:
--   
--   1) Header file prototypes for "foreign exported" functions
--   
--   2) C stubs to use when calling "foreign exported" functions
ForeignStubs :: SDoc -> SDoc -> ForeignStubs

-- | Interactive context, recording information about the state of the
--   context in which statements are executed in a GHCi session.
data InteractiveContext
InteractiveContext :: DynFlags -> Int -> [InteractiveImport] -> [TyThing] -> GlobalRdrEnv -> ([ClsInst], [FamInst]) -> FixityEnv -> Maybe [Type] -> [Resume] -> Name -> Name -> Maybe FilePath -> InteractiveContext

-- | The <a>DynFlags</a> used to evaluate interative expressions and
--   statements.
[ic_dflags] :: InteractiveContext -> DynFlags

-- | Each GHCi stmt or declaration brings some new things into scope. We
--   give them names like interactive:Ghci9.T, where the ic_index is the
--   '9'. The ic_mod_index is incremented whenever we add something to
--   ic_tythings See Note [The interactive package]
[ic_mod_index] :: InteractiveContext -> Int

-- | The GHCi top-level scope (ic_rn_gbl_env) is extended with these
--   imports
--   
--   This field is only stored here so that the client can retrieve it with
--   GHC.getContext. GHC itself doesn't use it, but does reset it to empty
--   sometimes (such as before a GHC.load). The context is set with
--   GHC.setContext.
[ic_imports] :: InteractiveContext -> [InteractiveImport]

-- | TyThings defined by the user, in reverse order of definition (ie most
--   recent at the front) See Note [ic_tythings]
[ic_tythings] :: InteractiveContext -> [TyThing]

-- | The cached <a>GlobalRdrEnv</a>, built by <a>setContext</a> and updated
--   regularly It contains everything in scope at the command line,
--   including everything in ic_tythings
[ic_rn_gbl_env] :: InteractiveContext -> GlobalRdrEnv

-- | All instances and family instances created during this session. These
--   are grabbed en masse after each update to be sure that proper
--   overlapping is retained. That is, rather than re-check the overlapping
--   each time we update the context, we just take the results from the
--   instance code that already does that.
[ic_instances] :: InteractiveContext -> ([ClsInst], [FamInst])

-- | Fixities declared in let statements
[ic_fix_env] :: InteractiveContext -> FixityEnv

-- | The current default types, set by a 'default' declaration
[ic_default] :: InteractiveContext -> Maybe [Type]

-- | The stack of breakpoint contexts
[ic_resume] :: InteractiveContext -> [Resume]

-- | The monad that GHCi is executing in
[ic_monad] :: InteractiveContext -> Name

-- | The function that is used for printing results of expressions in ghci
--   and -e mode.
[ic_int_print] :: InteractiveContext -> Name
[ic_cwd] :: InteractiveContext -> Maybe FilePath
data InteractiveImport

-- | Bring the exports of a particular module (filtered by an import decl)
--   into scope
IIDecl :: ImportDecl GhcPs -> InteractiveImport

-- | Bring into scope the entire top-level envt of of this module,
--   including the things imported into it.
IIModule :: ModuleName -> InteractiveImport

-- | A map from <a>Name</a>s to <a>TyThing</a>s, constructed by
--   typechecking local declarations or interface files
type TypeEnv = NameEnv TyThing

-- | Class that abstracts out the common ability of the monads in GHC to
--   lookup a <a>TyThing</a> in the monadic environment by <a>Name</a>.
--   Provides a number of related convenience functions for accessing
--   particular kinds of <a>TyThing</a>
class Monad m => MonadThings (m :: Type -> Type)
lookupThing :: MonadThings m => Name -> m TyThing
lookupId :: MonadThings m => Name -> m Id
lookupDataCon :: MonadThings m => Name -> m DataCon
lookupTyCon :: MonadThings m => Name -> m TyCon

-- | Warning information for a module
data Warnings

-- | Nothing deprecated
NoWarnings :: Warnings

-- | Whole module deprecated
WarnAll :: WarningTxt -> Warnings

-- | Some specific things deprecated
WarnSome :: [(OccName, WarningTxt)] -> Warnings

-- | Fixity environment mapping names to their fixities
type FixityEnv = NameEnv FixItem

-- | Fixity information for an <a>Name</a>. We keep the OccName in the
--   range so that we can generate an interface from it
data FixItem
FixItem :: OccName -> Fixity -> FixItem

-- | Records whether a module has orphans. An "orphan" is one of:
--   
--   <ul>
--   <li>An instance declaration in a module other than the definition
--   module for one of the type constructors or classes in the instance
--   head</li>
--   <li>A transformation rule in a module other than the one defining the
--   function in the head of the rule</li>
--   </ul>
type WhetherHasOrphans = Bool

-- | Did this module originate from a *-boot file?
type IsBootInterface = Bool

-- | Dependency information about ALL modules and packages below this one
--   in the import hierarchy.
--   
--   Invariant: the dependencies of a module <tt>M</tt> never includes
--   <tt>M</tt>.
--   
--   Invariant: none of the lists contain duplicates.
data Dependencies
Deps :: [(ModuleName, IsBootInterface)] -> [(InstalledUnitId, Bool)] -> [Module] -> [Module] -> [ModuleName] -> Dependencies

-- | All home-package modules transitively below this one I.e. modules that
--   this one imports, or that are in the dep_mods of those
--   directly-imported modules
[dep_mods] :: Dependencies -> [(ModuleName, IsBootInterface)]

-- | All packages transitively below this module I.e. packages to which
--   this module's direct imports belong, or that are in the dep_pkgs of
--   those modules The bool indicates if the package is required to be
--   trusted when the module is imported as a safe import (Safe Haskell).
--   See Note [RnNames . Tracking Trust Transitively]
[dep_pkgs] :: Dependencies -> [(InstalledUnitId, Bool)]

-- | Transitive closure of orphan modules (whether home or external pkg).
--   
--   (Possible optimization: don't include family instance orphans as they
--   are anyway included in <a>dep_finsts</a>. But then be careful about
--   code which relies on dep_orphs having the complete list!) This does
--   NOT include us, unlike <tt>imp_orphs</tt>.
[dep_orphs] :: Dependencies -> [Module]

-- | Transitive closure of depended upon modules which contain family
--   instances (whether home or external). This is used by
--   <tt>checkFamInstConsistency</tt>. This does NOT include us, unlike
--   <tt>imp_finsts</tt>. See Note [The type family instance consistency
--   story].
[dep_finsts] :: Dependencies -> [Module]

-- | All the plugins used while compiling this module.
[dep_plgins] :: Dependencies -> [ModuleName]

-- | Records modules for which changes may force recompilation of this
--   module See wiki:
--   <a>https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/recompilation-avoidance</a>
--   
--   This differs from Dependencies. A module X may be in the dep_mods of
--   this module (via an import chain) but if we don't use anything from X
--   it won't appear in our Usage
data Usage

-- | Module from another package
UsagePackageModule :: Module -> Fingerprint -> IsSafeImport -> Usage

-- | External package module depended on
[usg_mod] :: Usage -> Module

-- | Cached module fingerprint
[usg_mod_hash] :: Usage -> Fingerprint

-- | Was this module imported as a safe import
[usg_safe] :: Usage -> IsSafeImport

-- | Module from the current package | A file upon which the module
--   depends, e.g. a CPP #include, or using TH's <tt>addDependentFile</tt>
UsageHomeModule :: ModuleName -> Fingerprint -> [(OccName, Fingerprint)] -> Maybe Fingerprint -> IsSafeImport -> Usage

-- | Name of the module
[usg_mod_name] :: Usage -> ModuleName

-- | Cached module fingerprint
[usg_mod_hash] :: Usage -> Fingerprint

-- | Entities we depend on, sorted by occurrence name and fingerprinted.
--   NB: usages are for parent names only, e.g. type constructors but not
--   the associated data constructors.
[usg_entities] :: Usage -> [(OccName, Fingerprint)]

-- | Fingerprint for the export list of this module, if we directly
--   imported it (and hence we depend on its export list)
[usg_exports] :: Usage -> Maybe Fingerprint

-- | Was this module imported as a safe import
[usg_safe] :: Usage -> IsSafeImport
UsageFile :: FilePath -> Fingerprint -> Usage

-- | External file dependency. From a CPP #include or TH addDependentFile.
--   Should be absolute.
[usg_file_path] :: Usage -> FilePath

-- | <a>Fingerprint</a> of the file contents.
[usg_file_hash] :: Usage -> Fingerprint

-- | A requirement which was merged into this one.
UsageMergedRequirement :: Module -> Fingerprint -> Usage

-- | External package module depended on
[usg_mod] :: Usage -> Module

-- | Cached module fingerprint
[usg_mod_hash] :: Usage -> Fingerprint
type PackageTypeEnv = TypeEnv
type PackageRuleBase = RuleBase
type PackageInstEnv = InstEnv
type PackageFamInstEnv = FamInstEnv
type PackageCompleteMatchMap = CompleteMatchMap

-- | Information about other packages that we have slurped in by reading
--   their interface files
data ExternalPackageState
EPS :: !ModuleNameEnv (ModuleName, IsBootInterface) -> !PackageIfaceTable -> InstalledModuleEnv (UniqDSet ModuleName) -> !PackageTypeEnv -> !PackageInstEnv -> !PackageFamInstEnv -> !PackageRuleBase -> !PackageAnnEnv -> !PackageCompleteMatchMap -> !ModuleEnv FamInstEnv -> !EpsStats -> ExternalPackageState

-- | In OneShot mode (only), home-package modules accumulate in the
--   external package state, and are sucked in lazily. For these home-pkg
--   modules (only) we need to record which are boot modules. We set this
--   field after loading all the explicitly-imported interfaces, but before
--   doing anything else
--   
--   The <a>ModuleName</a> part is not necessary, but it's useful for debug
--   prints, and it's convenient because this field comes direct from
--   <a>imp_dep_mods</a>
[eps_is_boot] :: ExternalPackageState -> !ModuleNameEnv (ModuleName, IsBootInterface)

-- | The <a>ModIface</a>s for modules in external packages whose interfaces
--   we have opened. The declarations in these interface files are held in
--   the <tt>eps_decls</tt>, <a>eps_inst_env</a>, <a>eps_fam_inst_env</a>
--   and <tt>eps_rules</tt> fields of this record, not in the
--   <a>mi_decls</a> fields of the interface we have sucked in.
--   
--   What <i>is</i> in the PIT is:
--   
--   <ul>
--   <li>The Module</li>
--   <li>Fingerprint info</li>
--   <li>Its exports</li>
--   <li>Fixities</li>
--   <li>Deprecations and warnings</li>
--   </ul>
[eps_PIT] :: ExternalPackageState -> !PackageIfaceTable

-- | Cache for <a>mi_free_holes</a>. Ordinarily, we can rely on the
--   <a>eps_PIT</a> for this information, EXCEPT that when we do dependency
--   analysis, we need to look at the <a>Dependencies</a> of our imports to
--   determine what their precise free holes are
--   (<tt>moduleFreeHolesPrecise</tt>). We don't want to repeatedly reread
--   in the interface for every import, so cache it here. When the PIT gets
--   filled in we can drop these entries.
[eps_free_holes] :: ExternalPackageState -> InstalledModuleEnv (UniqDSet ModuleName)

-- | Result of typechecking all the external package interface files we
--   have sucked in. The domain of the mapping is external-package modules
[eps_PTE] :: ExternalPackageState -> !PackageTypeEnv

-- | The total <a>InstEnv</a> accumulated from all the external-package
--   modules
[eps_inst_env] :: ExternalPackageState -> !PackageInstEnv

-- | The total <a>FamInstEnv</a> accumulated from all the external-package
--   modules
[eps_fam_inst_env] :: ExternalPackageState -> !PackageFamInstEnv

-- | The total <tt>RuleEnv</tt> accumulated from all the external-package
--   modules
[eps_rule_base] :: ExternalPackageState -> !PackageRuleBase

-- | The total <a>AnnEnv</a> accumulated from all the external-package
--   modules
[eps_ann_env] :: ExternalPackageState -> !PackageAnnEnv

-- | The total <a>CompleteMatchMap</a> accumulated from all the
--   external-package modules
[eps_complete_matches] :: ExternalPackageState -> !PackageCompleteMatchMap

-- | The family instances accumulated from external packages, keyed off the
--   module that declared them
[eps_mod_fam_inst_env] :: ExternalPackageState -> !ModuleEnv FamInstEnv

-- | Stastics about what was loaded from external packages
[eps_stats] :: ExternalPackageState -> !EpsStats

-- | Accumulated statistics about what we are putting into the
--   <a>ExternalPackageState</a>. "In" means stuff that is just <i>read</i>
--   from interface files, "Out" means actually sucked in and type-checked
data EpsStats
EpsStats :: !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> !Int -> EpsStats
[n_ifaces_in] :: EpsStats -> !Int
[n_decls_in] :: EpsStats -> !Int
[n_decls_out] :: EpsStats -> !Int
[n_rules_in] :: EpsStats -> !Int
[n_rules_out] :: EpsStats -> !Int
[n_insts_in] :: EpsStats -> !Int
[n_insts_out] :: EpsStats -> !Int

-- | A ModuleGraph contains all the nodes from the home package (only).
--   There will be a node for each source module, plus a node for each
--   hi-boot module.
--   
--   The graph is not necessarily stored in topologically-sorted order. Use
--   <a>topSortModuleGraph</a> and <a>flattenSCC</a> to achieve this.
data ModuleGraph

-- | A single node in a <a>ModuleGraph</a>. The nodes of the module graph
--   are one of:
--   
--   <ul>
--   <li>A regular Haskell source module</li>
--   <li>A hi-boot source module</li>
--   </ul>
data ModSummary
ModSummary :: Module -> HscSource -> ModLocation -> UTCTime -> Maybe UTCTime -> Maybe UTCTime -> Maybe UTCTime -> [(Maybe FastString, Located ModuleName)] -> [(Maybe FastString, Located ModuleName)] -> Maybe HsParsedModule -> FilePath -> DynFlags -> Maybe StringBuffer -> ModSummary

-- | Identity of the module
[ms_mod] :: ModSummary -> Module

-- | The module source either plain Haskell or hs-boot
[ms_hsc_src] :: ModSummary -> HscSource

-- | Location of the various files belonging to the module
[ms_location] :: ModSummary -> ModLocation

-- | Timestamp of source file
[ms_hs_date] :: ModSummary -> UTCTime

-- | Timestamp of object, if we have one
[ms_obj_date] :: ModSummary -> Maybe UTCTime

-- | Timestamp of hi file, if we *only* are typechecking (it is
--   <a>Nothing</a> otherwise. See Note [Recompilation checking in
--   -fno-code mode] and #9243
[ms_iface_date] :: ModSummary -> Maybe UTCTime

-- | Timestamp of hie file, if we have one
[ms_hie_date] :: ModSummary -> Maybe UTCTime

-- | Source imports of the module
[ms_srcimps] :: ModSummary -> [(Maybe FastString, Located ModuleName)]

-- | Non-source imports of the module from the module *text*
[ms_textual_imps] :: ModSummary -> [(Maybe FastString, Located ModuleName)]

-- | The parsed, nonrenamed source, if we have it. This is also used to
--   support "inline module syntax" in Backpack files.
[ms_parsed_mod] :: ModSummary -> Maybe HsParsedModule

-- | Filename of preprocessed source file
[ms_hspp_file] :: ModSummary -> FilePath

-- | Cached flags from <tt>OPTIONS</tt>, <tt>INCLUDE</tt> and
--   <tt>LANGUAGE</tt> pragmas in the modules source code
[ms_hspp_opts] :: ModSummary -> DynFlags

-- | The actual preprocessed source, if we have it
[ms_hspp_buf] :: ModSummary -> Maybe StringBuffer

-- | Indicates whether a given module's source has been modified since it
--   was last compiled.
data SourceModified

-- | the source has been modified
SourceModified :: SourceModified

-- | the source has not been modified. Compilation may or may not be
--   necessary, depending on whether any dependencies have changed since we
--   last compiled.
SourceUnmodified :: SourceModified

-- | the source has not been modified, and furthermore all of its
--   (transitive) dependencies are up to date; it definitely does not need
--   to be recompiled. This is important for two reasons: (a) we can omit
--   the version check in checkOldIface, and (b) if the module used TH
--   splices we don't need to force recompilation.
SourceUnmodifiedAndStable :: SourceModified

-- | Information about a modules use of Haskell Program Coverage
data HpcInfo
HpcInfo :: Int -> Int -> HpcInfo
[hpcInfoTickCount] :: HpcInfo -> Int
[hpcInfoHash] :: HpcInfo -> Int
NoHpcInfo :: AnyHpcUsage -> HpcInfo

-- | Is hpc used anywhere on the module *tree*?
[hpcUsed] :: HpcInfo -> AnyHpcUsage

-- | This is used to signal if one of my imports used HPC instrumentation
--   even if there is no module-local HPC usage
type AnyHpcUsage = Bool

-- | Is an import a safe import?
type IsSafeImport = Bool

-- | Safe Haskell information for <a>ModIface</a> Simply a wrapper around
--   SafeHaskellMode to sepperate iface and flags
data IfaceTrustInfo
data HsParsedModule
HsParsedModule :: Located (HsModule GhcPs) -> [FilePath] -> ApiAnns -> HsParsedModule
[hpm_module] :: HsParsedModule -> Located (HsModule GhcPs)

-- | extra source files (e.g. from #includes). The lexer collects these
--   from '# <a>file</a> <a>line</a>' 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]
[hpm_annotations] :: HsParsedModule -> ApiAnns

-- | A list of conlikes which represents a complete pattern match. These
--   arise from <tt>COMPLETE</tt> signatures.
data CompleteMatch
CompleteMatch :: [Name] -> Name -> CompleteMatch

-- | The ConLikes that form a covering family (e.g. Nothing, Just)
[completeMatchConLikes] :: CompleteMatch -> [Name]

-- | The TyCon that they cover (e.g. Maybe)
[completeMatchTyCon] :: CompleteMatch -> Name

-- | A map keyed by the <a>completeMatchTyCon</a>.
type CompleteMatchMap = UniqFM [CompleteMatch]
lPatImplicits :: LPat GhcRn -> [(SrcSpan, [Name])]
hsValBindsImplicits :: forall (idR :: Pass). HsValBindsLR GhcRn (GhcPass idR) -> [(SrcSpan, [Name])]
lStmtsImplicits :: forall (idR :: Pass) body. [LStmtLR GhcRn (GhcPass idR) (Located (body (GhcPass idR)))] -> [(SrcSpan, [Name])]

-- | the SrcLoc returned are for the whole declarations, not just the names
hsDataFamInstBinders :: forall (p :: Pass). DataFamInstDecl (GhcPass p) -> ([Located (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
getPatSynBinds :: [(RecFlag, LHsBinds id)] -> [PatSynBind id id]

-- | Collects record pattern-synonym selectors only; the pattern synonym
--   names are collected by collectHsValBinders.
hsPatSynSelectors :: forall (p :: Pass). HsValBinds (GhcPass p) -> [IdP (GhcPass p)]

-- | See Note [SrcSpan for binders]
hsForeignDeclsBinders :: [LForeignDecl pass] -> [Located (IdP pass)]

-- | Returns all the <i>binding</i> 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 <i>whole</i>
--   declaration. See Note [SrcSpan for binders]
hsLTyClDeclBinders :: forall (p :: Pass). Located (TyClDecl (GhcPass p)) -> ([Located (IdP (GhcPass p))], [LFieldOcc (GhcPass p)])
hsTyClForeignBinders :: [TyClGroup GhcRn] -> [LForeignDecl GhcRn] -> [Name]
hsGroupBinders :: HsGroup GhcRn -> [Name]
collectPatsBinders :: forall (p :: Pass). [LPat (GhcPass p)] -> [IdP (GhcPass p)]
collectPatBinders :: forall (p :: Pass). LPat (GhcPass p) -> [IdP (GhcPass p)]
collectStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. StmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
collectLStmtBinders :: forall (idL :: Pass) (idR :: Pass) body. LStmtLR (GhcPass idL) (GhcPass idR) body -> [IdP (GhcPass idL)]
collectStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. [StmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]
collectLStmtsBinders :: forall (idL :: Pass) (idR :: Pass) body. [LStmtLR (GhcPass idL) (GhcPass idR) body] -> [IdP (GhcPass idL)]

-- | Used exclusively for the bindings of an instance decl which are all
--   FunBinds
collectMethodBinders :: LHsBindsLR idL idR -> [Located (IdP idL)]

-- | Same as collectHsBindsBinders, but works over a list of bindings
collectHsBindListBinders :: forall (p :: Pass) idR. [LHsBindLR (GhcPass p) idR] -> [IdP (GhcPass p)]
collectHsBindsBinders :: forall (p :: Pass) idR. LHsBindsLR (GhcPass p) idR -> [IdP (GhcPass p)]

-- | Collect both Ids and pattern-synonym binders
collectHsBindBinders :: (SrcSpanLess (LPat p) ~ Pat p, HasSrcSpan (LPat p)) => HsBindLR p idR -> [IdP p]

-- | Collect Id binders only, or Ids + pattern synonyms, respectively
collectHsValBinders :: forall (idL :: Pass) (idR :: Pass). HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]

-- | Collect Id binders only, or Ids + pattern synonyms, respectively
collectHsIdBinders :: forall (idL :: Pass) (idR :: Pass). HsValBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]
collectLocalBinders :: forall (idL :: Pass) (idR :: Pass). HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> [IdP (GhcPass idL)]

-- | Is a binding a strict variable or pattern bind (e.g. <tt>!x =
--   ...</tt>)?
isBangedHsBind :: HsBind GhcTc -> Bool

-- | 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 check] is DsBinds.
isUnliftedHsBind :: HsBind GhcTc -> Bool
mkMatch :: forall (p :: Pass). HsMatchContext (NameOrRdrName (IdP (GhcPass p))) -> [LPat (GhcPass p)] -> LHsExpr (GhcPass p) -> Located (HsLocalBinds (GhcPass p)) -> LMatch (GhcPass p) (LHsExpr (GhcPass p))

-- | Make a prefix, non-strict function <a>HsMatchContext</a>
mkPrefixFunRhs :: Located id -> HsMatchContext id

-- | Convenience function using <a>mkFunBind</a>. This is for generated
--   bindings only, do not use for user-written code.
mkSimpleGeneratedFunBind :: SrcSpan -> RdrName -> [LPat GhcPs] -> LHsExpr GhcPs -> LHsBind GhcPs

-- | If any of the matches in the <a>FunBind</a> are infix, the
--   <a>FunBind</a> is considered infix.
isInfixFunBind :: HsBindLR id1 id2 -> Bool
mkPatSynBind :: Located RdrName -> HsPatSynDetails (Located RdrName) -> LPat GhcPs -> HsPatSynDir GhcPs -> HsBind GhcPs
mkVarBind :: forall (p :: Pass). IdP (GhcPass p) -> LHsExpr (GhcPass p) -> LHsBind (GhcPass p)
mkHsVarBind :: SrcSpan -> RdrName -> LHsExpr GhcPs -> LHsBind GhcPs

-- | In Name-land, with empty bind_fvs
mkTopFunBind :: Origin -> Located Name -> [LMatch GhcRn (LHsExpr GhcRn)] -> HsBind GhcRn

-- | Not infix, with place holders for coercion and free vars
mkFunBind :: Origin -> Located RdrName -> [LMatch GhcPs (LHsExpr GhcPs)] -> HsBind GhcPs
mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
mkHsWrapPatCo :: forall (id :: Pass). TcCoercionN -> Pat (GhcPass id) -> Type -> Pat (GhcPass id)
mkHsWrapPat :: forall (id :: Pass). HsWrapper -> Pat (GhcPass id) -> Type -> Pat (GhcPass id)
mkLHsCmdWrap :: forall (p :: Pass). HsWrapper -> LHsCmd (GhcPass p) -> LHsCmd (GhcPass p)
mkHsCmdWrap :: forall (p :: Pass). HsWrapper -> HsCmd (GhcPass p) -> HsCmd (GhcPass p)
mkLHsWrapCo :: forall (id :: Pass). TcCoercionN -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
mkHsWrapCoR :: forall (id :: Pass). TcCoercionR -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
mkHsWrapCo :: forall (id :: Pass). TcCoercionN -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)

-- | Avoid (HsWrap co (HsWrap co' _)). See Note [Detecting forced eta
--   expansion] in DsExpr
mkHsWrap :: forall (id :: Pass). HsWrapper -> HsExpr (GhcPass id) -> HsExpr (GhcPass id)
mkLHsWrap :: forall (id :: Pass). HsWrapper -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)

-- | Converting a Type to an HsType RdrName This is needed to implement
--   GeneralizedNewtypeDeriving.
--   
--   Note that we use <a>getRdrName</a> extensively, which generates Exact
--   RdrNames rather than strings.
typeToLHsType :: Type -> LHsType 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]
mkHsSigEnv :: (LSig GhcRn -> Maybe ([Located Name], a)) -> [LSig GhcRn] -> NameEnv a
mkLHsSigWcType :: LHsType GhcPs -> LHsSigWcType GhcPs
mkLHsSigType :: LHsType GhcPs -> LHsSigType GhcPs

-- | Split a list into lists that are small enough to have a corresponding
--   tuple arity. The sub-lists of the result all have length &lt;=
--   <a>mAX_TUPLE_SIZE</a> But there may be more than <a>mAX_TUPLE_SIZE</a>
--   sub-lists
chunkify :: [a] -> [[a]]

-- | Lifts a "small" constructor into a "big" constructor by recursive
--   decompositon
mkChunkified :: ([a] -> a) -> [a] -> a
mkBigLHsPatTup :: [LPat GhcRn] -> LPat GhcRn

-- | The Big equivalents for the source tuple patterns
mkBigLHsVarPatTup :: [IdP GhcRn] -> LPat GhcRn
mkBigLHsTup :: forall (id :: Pass). [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)

-- | The Big equivalents for the source tuple expressions
mkBigLHsVarTup :: forall (id :: Pass). [IdP (GhcPass id)] -> LHsExpr (GhcPass id)
missingTupArg :: HsTupArg GhcPs
nlTuplePat :: [LPat GhcPs] -> Boxity -> LPat GhcPs
mkLHsVarTuple :: forall (a :: Pass). [IdP (GhcPass a)] -> LHsExpr (GhcPass a)
mkLHsTupleExpr :: forall (a :: Pass). [LHsExpr (GhcPass a)] -> LHsExpr (GhcPass a)
nlHsAppKindTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsKind (GhcPass p) -> LHsType (GhcPass p)
nlHsTyConApp :: forall (p :: Pass). IdP (GhcPass p) -> [LHsType (GhcPass p)] -> LHsType (GhcPass p)
nlHsParTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p)
nlHsFunTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
nlHsTyVar :: forall (p :: Pass). IdP (GhcPass p) -> LHsType (GhcPass p)
nlHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
nlList :: [LHsExpr GhcPs] -> LHsExpr GhcPs
nlHsCase :: LHsExpr GhcPs -> [LMatch GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs

-- | Note [Rebindable nlHsIf] nlHsIf should generate if-expressions which
--   are NOT subject to RebindableSyntax, so the first field of HsIf is
--   Nothing. (#12080)
nlHsIf :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
nlHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
nlHsLam :: LMatch GhcPs (LHsExpr GhcPs) -> LHsExpr GhcPs
nlHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs
nlHsDo :: HsStmtContext Name -> [LStmt GhcPs (LHsExpr GhcPs)] -> LHsExpr GhcPs

-- | Wildcard pattern - after renaming
nlWildPatName :: LPat GhcRn

-- | Wildcard pattern - after parsing
nlWildPat :: LPat GhcPs
nlWildConPat :: DataCon -> LPat GhcPs
nlNullaryConPat :: forall (p :: Pass). IdP (GhcPass p) -> LPat (GhcPass p)
nlConPatName :: Name -> [LPat GhcRn] -> LPat GhcRn
nlConPat :: RdrName -> [LPat GhcPs] -> LPat GhcPs
nlInfixConPat :: RdrName -> LPat GhcPs -> LPat GhcPs -> LPat GhcPs
nlConVarPatName :: Name -> [Name] -> LPat GhcRn
nlConVarPat :: RdrName -> [RdrName] -> LPat GhcPs
nlHsVarApps :: forall (id :: Pass). IdP (GhcPass id) -> [IdP (GhcPass id)] -> LHsExpr (GhcPass id)
nlHsApps :: forall (id :: Pass). IdP (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
nlHsSyntaxApps :: forall (id :: Pass). SyntaxExpr (GhcPass id) -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
nlHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
nlLitPat :: HsLit GhcPs -> LPat GhcPs
nlVarPat :: forall (id :: Pass). IdP (GhcPass id) -> LPat (GhcPass id)
nlHsIntLit :: forall (p :: Pass). Integer -> LHsExpr (GhcPass p)
nlHsLit :: forall (p :: Pass). HsLit (GhcPass p) -> LHsExpr (GhcPass p)

-- | NB: Only for LHsExpr **Id**
nlHsDataCon :: DataCon -> LHsExpr GhcTc
nlHsVar :: forall (id :: Pass). IdP (GhcPass id) -> LHsExpr (GhcPass id)
mkHsStringPrimLit :: forall (p :: Pass). FastString -> HsLit (GhcPass p)
mkHsString :: forall (p :: Pass). String -> HsLit (GhcPass p)
unqualQuasiQuote :: RdrName
mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs
mkTypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs
mkUntypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs

-- | A useful function for building <tt>OpApps</tt>. The operator is always
--   a variable, and we don't know the fixity yet.
mkHsOpApp :: LHsExpr GhcPs -> IdP GhcPs -> LHsExpr GhcPs -> HsExpr GhcPs
mkRecStmt :: forall (idL :: Pass) bodyR. [LStmtLR (GhcPass idL) GhcPs bodyR] -> StmtLR (GhcPass idL) GhcPs bodyR
emptyRecStmtId :: StmtLR GhcTc GhcTc bodyR
emptyRecStmtName :: StmtLR GhcRn GhcRn bodyR
emptyRecStmt :: forall (idL :: Pass) bodyR. StmtLR (GhcPass idL) GhcPs bodyR
unitRecStmtTc :: RecStmtTc
mkTcBindStmt :: LPat GhcTc -> Located (bodyR GhcTc) -> StmtLR GhcTc GhcTc (Located (bodyR GhcTc))
mkBindStmt :: forall (idL :: Pass) (idR :: Pass) bodyR. XBindStmt (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR))) ~ NoExtField => LPat (GhcPass idL) -> Located (bodyR (GhcPass idR)) -> StmtLR (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR)))
mkBodyStmt :: forall bodyR (idL :: Pass). Located (bodyR GhcPs) -> StmtLR (GhcPass idL) GhcPs (Located (bodyR GhcPs))
mkLastStmt :: forall bodyR (idR :: Pass) (idL :: Pass). Located (bodyR (GhcPass idR)) -> StmtLR (GhcPass idL) (GhcPass idR) (Located (bodyR (GhcPass idR)))
mkGroupByUsingStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
mkGroupUsingStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
mkTransformByStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
mkTransformStmt :: [ExprLStmt GhcPs] -> LHsExpr GhcPs -> StmtLR GhcPs GhcPs (LHsExpr GhcPs)
emptyTransStmt :: StmtLR GhcPs GhcPs (LHsExpr GhcPs)
mkNPlusKPat :: Located RdrName -> Located (HsOverLit GhcPs) -> Pat GhcPs
mkNPat :: Located (HsOverLit GhcPs) -> Maybe (SyntaxExpr GhcPs) -> Pat GhcPs
mkHsCmdIf :: forall (p :: Pass). LHsExpr (GhcPass p) -> LHsCmd (GhcPass p) -> LHsCmd (GhcPass p) -> HsCmd (GhcPass p)
mkHsIf :: forall (p :: Pass). LHsExpr (GhcPass p) -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p) -> HsExpr (GhcPass p)
mkHsComp :: HsStmtContext Name -> [ExprLStmt GhcPs] -> LHsExpr GhcPs -> HsExpr GhcPs
mkHsDo :: HsStmtContext Name -> [ExprLStmt GhcPs] -> HsExpr GhcPs
mkHsIsString :: SourceText -> FastString -> HsOverLit GhcPs
mkHsFractional :: FractionalLit -> HsOverLit GhcPs
mkHsIntegral :: IntegralLit -> HsOverLit GhcPs
nlParPat :: forall (name :: Pass). LPat (GhcPass name) -> LPat (GhcPass name)
mkParPat :: forall (name :: Pass). LPat (GhcPass name) -> LPat (GhcPass name)

-- | 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). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
nlHsTyApps :: forall (id :: Pass). IdP (GhcPass id) -> [Type] -> [LHsExpr (GhcPass id)] -> LHsExpr (GhcPass id)
nlHsTyApp :: forall (id :: Pass). IdP (GhcPass id) -> [Type] -> LHsExpr (GhcPass id)

-- | A simple case alternative with a single pattern, no binds, no guards;
--   pre-typechecking
mkHsCaseAlt :: forall (p :: Pass) body. LPat (GhcPass p) -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p)))
mkHsLams :: [TyVar] -> [EvVar] -> LHsExpr GhcTc -> LHsExpr GhcTc
mkHsLam :: forall (p :: Pass). XMG (GhcPass p) (LHsExpr (GhcPass p)) ~ NoExtField => [LPat (GhcPass p)] -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)
mkHsAppTypes :: LHsExpr GhcRn -> [LHsWcType GhcRn] -> LHsExpr GhcRn
mkHsAppType :: forall (id :: Pass). NoGhcTc (GhcPass id) ~ GhcRn => LHsExpr (GhcPass id) -> LHsWcType GhcRn -> LHsExpr (GhcPass id)
mkHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
mkMatchGroup :: XMG name (Located (body name)) ~ NoExtField => Origin -> [LMatch name (Located (body name))] -> MatchGroup name (Located (body name))
unguardedRHS :: forall body (p :: Pass). SrcSpan -> Located (body (GhcPass p)) -> [LGRHS (GhcPass p) (Located (body (GhcPass p)))]
unguardedGRHSs :: forall body (p :: Pass). Located (body (GhcPass p)) -> GRHSs (GhcPass p) (Located (body (GhcPass p)))
mkSimpleMatch :: forall (p :: Pass) body. HsMatchContext (NameOrRdrName (IdP (GhcPass p))) -> [LPat (GhcPass p)] -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p)))

-- | e =&gt; (e)
mkHsPar :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
pprStmtInCtxt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => HsStmtContext (IdP (GhcPass idL)) -> StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
pprMatchInCtxt :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable (NameOrRdrName (NameOrRdrName (IdP (GhcPass idR)))), Outputable body) => Match (GhcPass idR) body -> SDoc
matchContextErrString :: Outputable id => HsMatchContext id -> SDoc
pprStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
pprAStmtContext :: (Outputable id, Outputable (NameOrRdrName id)) => HsStmtContext id -> SDoc
pprMatchContextNoun :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
pprMatchContext :: (Outputable (NameOrRdrName id), Outputable id) => HsMatchContext id -> SDoc
matchSeparator :: HsMatchContext id -> SDoc
isMonadCompContext :: HsStmtContext id -> Bool

-- | Should pattern match failure in a <a>HsStmtContext</a> be desugared
--   using <a>MonadFail</a>?
isMonadFailStmtContext :: HsStmtContext id -> Bool
isComprehensionContext :: HsStmtContext id -> Bool
isPatSynCtxt :: HsMatchContext id -> Bool
pp_dotdot :: SDoc
thTyBrackets :: SDoc -> SDoc
thBrackets :: SDoc -> SDoc -> SDoc
pprHsBracket :: forall (p :: Pass). OutputableBndrId p => HsBracket (GhcPass p) -> SDoc
isTypedBracket :: HsBracket id -> Bool
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_splice_decl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
pprPendingSplice :: forall (p :: Pass). OutputableBndrId p => SplicePointName -> LHsExpr (GhcPass p) -> SDoc
isTypedSplice :: HsSplice id -> Bool
pprQuals :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body) => [LStmt (GhcPass p) body] -> SDoc
pprComp :: forall (p :: Pass) body. (OutputableBndrId p, Outputable body) => [LStmt (GhcPass p) body] -> SDoc
ppr_do_stmts :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => [LStmtLR (GhcPass idL) (GhcPass idR) body] -> SDoc
pprDo :: forall (p :: Pass) body any. (OutputableBndrId p, Outputable body) => HsStmtContext any -> [LStmt (GhcPass p) body] -> SDoc
pprBy :: Outputable body => Maybe body -> SDoc
pprTransStmt :: Outputable body => Maybe body -> body -> TransForm -> SDoc
pprTransformStmt :: forall (p :: Pass). OutputableBndrId p => [IdP (GhcPass p)] -> LHsExpr (GhcPass p) -> Maybe (LHsExpr (GhcPass p)) -> SDoc
pprArg :: forall (idL :: Pass). OutputableBndrId idL => ApplicativeArg (GhcPass idL) -> SDoc
pprStmt :: forall (idL :: Pass) (idR :: Pass) body. (OutputableBndrId idL, OutputableBndrId idR, Outputable body) => StmtLR (GhcPass idL) (GhcPass idR) body -> SDoc
pp_rhs :: Outputable body => HsMatchContext idL -> body -> SDoc
pprGRHS :: forall (idR :: Pass) body idL. (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHS (GhcPass idR) body -> SDoc
pprGRHSs :: forall (idR :: Pass) body idL. (OutputableBndrId idR, Outputable body) => HsMatchContext idL -> GRHSs (GhcPass idR) body -> SDoc
pprMatch :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => Match (GhcPass idR) body -> SDoc
pprMatches :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => MatchGroup (GhcPass idR) body -> SDoc
hsLMatchPats :: forall (id :: Pass) body. LMatch (GhcPass id) body -> [LPat (GhcPass id)]
matchGroupArity :: forall (id :: Pass) body. MatchGroup (GhcPass id) body -> Arity

-- | Is there only one RHS in this list of matches?
isSingletonMatchGroup :: [LMatch id body] -> Bool
isEmptyMatchGroup :: MatchGroup id body -> Bool
isInfixMatch :: Match id body -> Bool
pprCmdArg :: forall (p :: Pass). OutputableBndrId p => HsCmdTop (GhcPass p) -> SDoc
ppr_cmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
ppr_lcmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
isQuietHsCmd :: HsCmd id -> Bool
pprCmd :: forall (p :: Pass). OutputableBndrId p => HsCmd (GhcPass p) -> SDoc
pprLCmd :: forall (p :: Pass). OutputableBndrId p => LHsCmd (GhcPass p) -> SDoc
isAtomicHsExpr :: HsExpr id -> Bool

-- | <tt><a>parenthesizeHsExpr</a> p e</tt> checks if
--   <tt><a>hsExprNeedsParens</a> p e</tt> is true, and if so, surrounds
--   <tt>e</tt> with an <a>HsPar</a>. Otherwise, it simply returns
--   <tt>e</tt>.
parenthesizeHsExpr :: forall (p :: Pass). PprPrec -> LHsExpr (GhcPass p) -> LHsExpr (GhcPass p)

-- | <tt><a>hsExprNeedsParens</a> p e</tt> returns <a>True</a> if the
--   expression <tt>e</tt> needs parentheses under precedence <tt>p</tt>.
hsExprNeedsParens :: PprPrec -> HsExpr p -> Bool
pprParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> HsExpr (GhcPass p) -> SDoc
pprParendLExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
pprDebugParendExpr :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LHsExpr (GhcPass p) -> SDoc
pprExternalSrcLoc :: (StringLiteral, (Int, Int), (Int, Int)) -> SDoc
ppr_apps :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> [Either (LHsExpr (GhcPass p)) (LHsWcType (NoGhcTc (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_lexpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
pprBinds :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsLocalBindsLR (GhcPass idL) (GhcPass idR) -> SDoc
isQuietHsExpr :: HsExpr id -> Bool
tupArgPresent :: LHsTupArg id -> Bool
unboundVarOcc :: UnboundVar -> OccName

-- | Make a 'SyntaxExpr Name' (the "rn" is because this is used in the
--   renamer), missing its HsWrappers.
mkRnSyntaxExpr :: Name -> SyntaxExpr GhcRn

-- | Make a 'SyntaxExpr (HsExpr _)', missing its HsWrappers.
mkSyntaxExpr :: forall (p :: Pass). HsExpr (GhcPass p) -> SyntaxExpr (GhcPass p)
noSyntaxExpr :: forall (p :: Pass). 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)

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

-- | 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)]

-- | Command Syntax Table (for Arrow syntax)
type CmdSyntaxTable p = [(Name, HsExpr p)]

-- | An unbound variable; used for treating out-of-scope variables as
--   expression holes
--   
--   Either "x", "y" Plain OutOfScope or "_", "_x" A TrueExprHole
--   
--   Both forms indicate an out-of-scope variable, but the latter indicates
--   that the user <i>expects</i> it to be out of scope, and just wants GHC
--   to report its type
data UnboundVar

-- | An (unqualified) out-of-scope variable, together with the GlobalRdrEnv
--   with respect to which it is unbound
OutOfScope :: OccName -> GlobalRdrEnv -> UnboundVar

-- | A "true" expression hole (_ or _x)
TrueExprHole :: OccName -> UnboundVar

-- | Extra data fields for a <a>RecordCon</a>, added by the type checker
data RecordConTc
RecordConTc :: ConLike -> PostTcExpr -> RecordConTc
[rcon_con_like] :: RecordConTc -> ConLike
[rcon_con_expr] :: RecordConTc -> PostTcExpr

-- | Extra data fields for a <a>RecordUpd</a>, 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

-- | Located Haskell Tuple Argument
--   
--   <a>HsTupArg</a> is used for tuple sections <tt>(,a,)</tt> is
--   represented by <tt>ExplicitTuple [Missing ty1, Present a, Missing
--   ty3]</tt> Which in turn stands for <tt>(x:ty1 y:ty2. (x,a,y))</tt>
type LHsTupArg id = Located HsTupArg id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnComma</a></li>
--   </ul>
--   
--   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

-- | Located Haskell Command (for arrow syntax)
type LHsCmd id = Located HsCmd id

-- | Haskell Array Application Type
data HsArrAppType
HsHigherOrderApp :: HsArrAppType
HsFirstOrderApp :: HsArrAppType

-- | 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 = Located HsCmdTop p

-- | Haskell Top-level Command
data HsCmdTop p
HsCmdTop :: XCmdTop p -> LHsCmd p -> HsCmdTop p
XCmdTop :: XXCmdTop p -> HsCmdTop p
data CmdTopTc
CmdTopTc :: Type -> Type -> CmdSyntaxTable GhcTc -> CmdTopTc

-- | Haskell Record Bindings
type HsRecordBinds p = HsRecFields p LHsExpr p
data MatchGroupTc
MatchGroupTc :: [Type] -> Type -> MatchGroupTc
[mg_arg_tys] :: MatchGroupTc -> [Type]
[mg_res_ty] :: MatchGroupTc -> Type

-- | Located Match
--   
--   May have <a>AnnKeywordId</a> : <a>AnnSemi</a> when in a list
type LMatch id body = Located Match id body
data Match p body
Match :: XCMatch p body -> HsMatchContext (NameOrRdrName (IdP p)) -> [LPat p] -> GRHSs p body -> Match p body
[m_ext] :: Match p body -> XCMatch p body
[m_ctxt] :: Match p body -> HsMatchContext (NameOrRdrName (IdP p))
[m_pats] :: Match p body -> [LPat p]
[m_grhss] :: Match p body -> GRHSs p body
XMatch :: XXMatch p body -> Match p body

-- | Located Guarded Right-Hand Side
type LGRHS id body = Located GRHS id body

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

-- | Located <tt>do</tt> block Statement
type LStmt id body = Located StmtLR id id body

-- | Located Statement with separate Left and Right id's
type LStmtLR idL idR body = Located StmtLR idL idR body

-- | <tt>do</tt> block Statement
type Stmt id body = StmtLR id id body

-- | Command Located Statement
type CmdLStmt id = LStmt id LHsCmd id

-- | Command Statement
type CmdStmt id = Stmt id LHsCmd id

-- | Expression Located Statement
type ExprLStmt id = LStmt id LHsExpr id

-- | Expression Statement
type ExprStmt id = Stmt id LHsExpr id

-- | Guard Located Statement
type GuardLStmt id = LStmt id LHsExpr id

-- | Guard Statement
type GuardStmt id = Stmt id LHsExpr id

-- | Ghci Located Statement
type GhciLStmt id = LStmt id LHsExpr id

-- | Ghci Statement
type GhciStmt id = Stmt id LHsExpr id

-- | API Annotations when in qualifier lists or guards -
--   <a>AnnKeywordId</a> : <a>AnnVbar</a>, <a>AnnComma</a>,<a>AnnThen</a>,
--   <a>AnnBy</a>,<a>AnnBy</a>, <a>AnnGroup</a>,<a>AnnUsing</a>
data StmtLR idL idR body
LastStmt :: XLastStmt idL idR body -> body -> Bool -> SyntaxExpr idR -> StmtLR idL idR body
BindStmt :: XBindStmt idL idR body -> LPat idL -> body -> SyntaxExpr idR -> SyntaxExpr idR -> StmtLR idL idR body

-- | <a>ApplicativeStmt</a> represents an applicative expression built with
--   <a>&lt;$&gt;</a> and <a>&lt;*&gt;</a>. 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 RnExpr
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

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnLet</a> <a>AnnOpen</a>
--   <tt>'{'</tt>,<a>AnnClose</a> <tt>'}'</tt>,</li>
--   </ul>
LetStmt :: XLetStmt idL idR body -> LHsLocalBindsLR 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

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnRec</a></li>
--   </ul>
RecStmt :: XRecStmt idL idR body -> [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 -> [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
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
data TransForm
ThenForm :: TransForm
GroupForm :: TransForm

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

-- | Applicative Argument
data ApplicativeArg idL
ApplicativeArgOne :: XApplicativeArgOne idL -> LPat idL -> LHsExpr idL -> Bool -> SyntaxExpr idL -> ApplicativeArg idL
[xarg_app_arg_one] :: ApplicativeArg idL -> XApplicativeArgOne idL
[app_arg_pattern] :: ApplicativeArg idL -> LPat idL
[arg_expr] :: ApplicativeArg idL -> LHsExpr idL
[is_body_stmt] :: ApplicativeArg idL -> Bool
[fail_operator] :: ApplicativeArg idL -> SyntaxExpr idL
ApplicativeArgMany :: XApplicativeArgMany idL -> [ExprLStmt idL] -> HsExpr idL -> LPat 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
XApplicativeArg :: XXApplicativeArg idL -> ApplicativeArg idL

-- | 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 )
HasParens :: SpliceDecoration

-- | $splice or $$splice
HasDollar :: SpliceDecoration

-- | bare splice
NoParens :: SpliceDecoration

-- | Finalizers produced by a splice with <a>addModFinalizer</a>
--   
--   See Note [Delaying modFinalizers in untyped splices] in RnSplice. For
--   how this is used.
newtype ThModFinalizers
ThModFinalizers :: [ForeignRef (Q ())] -> ThModFinalizers
data DelayedSplice
DelayedSplice :: TcLclEnv -> LHsExpr GhcRn -> TcType -> LHsExpr GhcTcId -> DelayedSplice

-- | 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
type SplicePointName = Name

-- | Pending Renamer Splice
data PendingRnSplice
PendingRnSplice :: UntypedSpliceFlavour -> SplicePointName -> LHsExpr GhcRn -> PendingRnSplice
data UntypedSpliceFlavour
UntypedExpSplice :: UntypedSpliceFlavour
UntypedPatSplice :: UntypedSpliceFlavour
UntypedTypeSplice :: UntypedSpliceFlavour
UntypedDeclSplice :: UntypedSpliceFlavour

-- | Pending Type-checker Splice
data PendingTcSplice
PendingTcSplice :: SplicePointName -> LHsExpr GhcTc -> PendingTcSplice

-- | 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 -> IdP p -> HsBracket p
TExpBr :: XTExpBr p -> LHsExpr p -> HsBracket p
XBracket :: XXBracket p -> HsBracket p

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

-- | Haskell Match Context
--   
--   Context of a pattern match. This is more subtle than it would seem.
--   See Note [Varieties of pattern matches].
data HsMatchContext id

-- | A pattern matching on an argument of a function binding
FunRhs :: Located id -> LexicalFixity -> SrcStrictness -> HsMatchContext id

-- | function binder of <tt>f</tt>
[mc_fun] :: HsMatchContext id -> Located id

-- | fixing of <tt>f</tt>
[mc_fixity] :: HsMatchContext id -> LexicalFixity

-- | was <tt>f</tt> banged? See Note [FunBind vs PatBind]
[mc_strictness] :: HsMatchContext id -> SrcStrictness

-- | Patterns of a lambda
LambdaExpr :: HsMatchContext id

-- | Patterns and guards on a case alternative
CaseAlt :: HsMatchContext id

-- | Guards of a multi-way if alternative
IfAlt :: HsMatchContext id

-- | Patterns of a proc
ProcExpr :: HsMatchContext id

-- | A pattern binding eg [y] &lt;- e = e
PatBindRhs :: HsMatchContext id

-- | Guards of pattern bindings, e.g., (Just b) | Just _ &lt;- x = e |
--   otherwise = e'
PatBindGuards :: HsMatchContext id

-- | Record update [used only in DsExpr to tell matchWrapper what sort of
--   runtime error message to generate]
RecUpd :: HsMatchContext id

-- | Pattern of a do-stmt, list comprehension, pattern guard, etc
StmtCtxt :: HsStmtContext id -> HsMatchContext id

-- | A Template Haskell pattern splice
ThPatSplice :: HsMatchContext id

-- | A Template Haskell pattern quotation [p| (a,b) |]
ThPatQuote :: HsMatchContext id

-- | A pattern synonym declaration
PatSyn :: HsMatchContext id

-- | Haskell Statement Context. It expects to be parameterised with one of
--   <tt>RdrName</tt>, <a>Name</a> or <tt>Id</tt>
data HsStmtContext id
ListComp :: HsStmtContext id
MonadComp :: HsStmtContext id

-- | do { ... }
DoExpr :: HsStmtContext id

-- | mdo { ... } ie recursive do-expression
MDoExpr :: HsStmtContext id

-- | do-notation in an arrow-command context
ArrowExpr :: HsStmtContext id

-- | A command-line Stmt in GHCi pat &lt;- rhs
GhciStmtCtxt :: HsStmtContext id

-- | Pattern guard for specified thing
PatGuard :: HsMatchContext id -> HsStmtContext id

-- | A branch of a parallel stmt
ParStmtCtxt :: HsStmtContext id -> HsStmtContext id

-- | A branch of a transform stmt
TransStmtCtxt :: HsStmtContext id -> HsStmtContext id
roleAnnotDeclName :: forall (p :: Pass). RoleAnnotDecl (GhcPass p) -> IdP (GhcPass p)
annProvenanceName_maybe :: AnnProvenance name -> Maybe name
docDeclDoc :: DocDecl -> HsDocString
pprFullRuleName :: Located (SourceText, RuleName) -> SDoc
collectRuleBndrSigTys :: [RuleBndr pass] -> [LHsSigWcType pass]
flattenRuleDecls :: [LRuleDecls pass] -> [LRuleDecl pass]

-- | Map over the <tt>via</tt> type if dealing with <a>ViaStrategy</a>.
--   Otherwise, return the <a>DerivStrategy</a> unchanged.
mapDerivStrategy :: forall p (pass :: Pass). p ~ GhcPass pass => (XViaStrategy p -> XViaStrategy p) -> DerivStrategy p -> DerivStrategy p

-- | Eliminate a <a>DerivStrategy</a>.
foldDerivStrategy :: forall p (pass :: Pass) r. p ~ GhcPass pass => r -> (XViaStrategy p -> r) -> DerivStrategy p -> r

-- | A short description of a <tt>DerivStrategy'</tt>.
derivStrategyName :: DerivStrategy a -> SDoc
instDeclDataFamInsts :: forall (p :: Pass). [LInstDecl (GhcPass p)] -> [DataFamInstDecl (GhcPass p)]
pprHsFamInstLHS :: forall (p :: Pass). OutputableBndrId p => IdP (GhcPass p) -> Maybe [LHsTyVarBndr (GhcPass p)] -> HsTyPats (GhcPass p) -> LexicalFixity -> LHsContext (GhcPass p) -> SDoc
pprDataFamInstFlavour :: forall (p :: Pass). DataFamInstDecl (GhcPass p) -> SDoc
pprTyFamInstDecl :: forall (p :: Pass). OutputableBndrId p => TopLevelFlag -> TyFamInstDecl (GhcPass p) -> SDoc
hsConDeclTheta :: Maybe (LHsContext pass) -> [LHsType pass]
hsConDeclArgTys :: HsConDeclDetails pass -> [LBangType pass]
getConArgs :: ConDecl pass -> HsConDeclDetails pass
getConNames :: forall (p :: Pass). ConDecl (GhcPass p) -> [Located (IdP (GhcPass p))]

-- | Convert a <a>NewOrData</a> to a <a>TyConFlavour</a>
newOrDataToFlavour :: NewOrData -> TyConFlavour
standaloneKindSigName :: forall (p :: Pass). StandaloneKindSig (GhcPass p) -> IdP (GhcPass p)

-- | Maybe return name of the result type variable
resultVariableName :: forall (a :: Pass). FamilyResultSig (GhcPass a) -> Maybe (IdP (GhcPass a))
famResultKindSignature :: forall (p :: Pass). FamilyResultSig (GhcPass p) -> Maybe (LHsKind (GhcPass p))
familyDeclName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> IdP (GhcPass p)
familyDeclLName :: forall (p :: Pass). FamilyDecl (GhcPass p) -> Located (IdP (GhcPass p))
tyClGroupKindSigs :: [TyClGroup pass] -> [LStandaloneKindSig pass]
tyClGroupRoleDecls :: [TyClGroup pass] -> [LRoleAnnotDecl pass]
tyClGroupInstDecls :: [TyClGroup pass] -> [LInstDecl pass]
tyClGroupTyClDecls :: [TyClGroup pass] -> [LTyClDecl pass]
pprTyClDeclFlavour :: forall (p :: Pass). TyClDecl (GhcPass p) -> SDoc

-- | Does this declaration have a complete, user-supplied kind signature?
--   See Note [CUSKs: complete user-supplied kind signatures]
hsDeclHasCusk :: TyClDecl GhcRn -> Bool
countTyClDecls :: [TyClDecl pass] -> (Int, Int, Int, Int, Int)
tyClDeclTyVars :: TyClDecl pass -> LHsQTyVars pass
tcdName :: forall (p :: Pass). TyClDecl (GhcPass p) -> IdP (GhcPass p)
tyClDeclLName :: forall (p :: Pass). TyClDecl (GhcPass p) -> Located (IdP (GhcPass p))
tyFamInstDeclLName :: forall (p :: Pass). TyFamInstDecl (GhcPass p) -> Located (IdP (GhcPass p))
tyFamInstDeclName :: forall (p :: Pass). TyFamInstDecl (GhcPass p) -> IdP (GhcPass p)

-- | data family declaration
isDataFamilyDecl :: TyClDecl pass -> Bool

-- | closed type family info
isClosedTypeFamilyInfo :: FamilyInfo pass -> Bool

-- | open type family info
isOpenTypeFamilyInfo :: FamilyInfo pass -> Bool

-- | type family declaration
isTypeFamilyDecl :: TyClDecl pass -> Bool

-- | type/data family declaration
isFamilyDecl :: TyClDecl pass -> Bool

-- | type class
isClassDecl :: TyClDecl pass -> Bool

-- | type or type instance declaration
isSynDecl :: TyClDecl pass -> Bool

-- | <tt>True</tt> <a>=</a> argument is a <tt>data</tt>/<tt>newtype</tt>
--   declaration.
isDataDecl :: TyClDecl pass -> Bool
appendGroups :: forall (p :: Pass). HsGroup (GhcPass p) -> HsGroup (GhcPass p) -> HsGroup (GhcPass p)
hsGroupInstDecls :: HsGroup id -> [LInstDecl id]
emptyRnGroup :: forall (p :: Pass). HsGroup (GhcPass p)
emptyRdrGroup :: forall (p :: Pass). HsGroup (GhcPass p)
type LHsDecl p = Located HsDecl p

-- | 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 Group
--   
--   A <a>HsDecl</a> is categorised into a <a>HsGroup</a> 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] -> 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]
XHsGroup :: XXHsGroup p -> HsGroup p

-- | Located Splice Declaration
type LSpliceDecl pass = Located SpliceDecl pass

-- | Splice Declaration
data SpliceDecl p
SpliceDecl :: XSpliceDecl p -> Located (HsSplice p) -> SpliceExplicitFlag -> SpliceDecl p
XSpliceDecl :: XXSpliceDecl p -> SpliceDecl p

-- | Located Declaration of a Type or Class
type LTyClDecl pass = Located TyClDecl pass

-- | A type or class declaration.
data TyClDecl pass

-- | <pre>
--   type/data family T :: *-&gt;*
--   </pre>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnType</a>, <a>AnnData</a>,
--   <a>AnnFamily</a>,<a>AnnDcolon</a>, <a>AnnWhere</a>,<a>AnnOpenP</a>,
--   <a>AnnDcolon</a>,<a>AnnCloseP</a>, <a>AnnEqual</a>,<a>AnnRarrow</a>,
--   <a>AnnVbar</a></li>
--   </ul>
FamDecl :: XFamDecl pass -> FamilyDecl pass -> TyClDecl pass
[tcdFExt] :: TyClDecl pass -> XFamDecl pass
[tcdFam] :: TyClDecl pass -> FamilyDecl pass

-- | <tt>type</tt> declaration
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnType</a>, <a>AnnEqual</a>,</li>
--   </ul>
SynDecl :: XSynDecl pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> LHsType pass -> TyClDecl pass

-- | Post renameer, FVs
[tcdSExt] :: TyClDecl pass -> XSynDecl pass

-- | Type constructor
[tcdLName] :: TyClDecl pass -> Located (IdP 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
[tcdRhs] :: TyClDecl pass -> LHsType pass

-- | <tt>data</tt> declaration
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnData</a>, <a>AnnFamily</a>,
--   <a>AnnNewType</a>, <a>AnnNewType</a>,<a>AnnDcolon</a>
--   <a>AnnWhere</a>,</li>
--   </ul>
DataDecl :: XDataDecl pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> HsDataDefn pass -> TyClDecl pass

-- | Post renamer, CUSK flag, FVs
[tcdDExt] :: TyClDecl pass -> XDataDecl pass

-- | Type constructor
[tcdLName] :: TyClDecl pass -> Located (IdP 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

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnClass</a>,
--   <a>AnnWhere</a>,<a>AnnOpen</a>, <a>AnnClose</a></li>
--   <li>The tcdFDs will have <a>AnnVbar</a>, <a>AnnComma</a>
--   <a>AnnRarrow</a></li>
--   </ul>
ClassDecl :: XClassDecl pass -> LHsContext pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> [LHsFunDep pass] -> [LSig pass] -> LHsBinds pass -> [LFamilyDecl pass] -> [LTyFamDefltDecl pass] -> [LDocDecl] -> TyClDecl pass

-- | Post renamer, FVs
[tcdCExt] :: TyClDecl pass -> XClassDecl pass

-- | Context...
[tcdCtxt] :: TyClDecl pass -> LHsContext pass

-- | Type constructor
[tcdLName] :: TyClDecl pass -> Located (IdP 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]
XTyClDecl :: XXTyClDecl pass -> TyClDecl pass
type LHsFunDep pass = Located FunDep Located IdP 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

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

-- | Located type Family Result Signature
type LFamilyResultSig pass = Located FamilyResultSig pass

-- | type Family Result Signature
data FamilyResultSig pass

-- | <ul>
--   <li><a>AnnKeywordId</a> :</li>
--   </ul>
NoSig :: XNoSig pass -> FamilyResultSig pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpenP</a>,<a>AnnDcolon</a>,
--   <a>AnnCloseP</a></li>
--   </ul>
KindSig :: XCKindSig pass -> LHsKind pass -> FamilyResultSig pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpenP</a>,<a>AnnDcolon</a>,
--   <a>AnnCloseP</a>, <a>AnnEqual</a></li>
--   </ul>
TyVarSig :: XTyVarSig pass -> LHsTyVarBndr pass -> FamilyResultSig pass
XFamilyResultSig :: XXFamilyResultSig pass -> FamilyResultSig pass

-- | Located type Family Declaration
type LFamilyDecl pass = Located FamilyDecl pass

-- | type Family Declaration
data FamilyDecl pass
FamilyDecl :: XCFamilyDecl pass -> FamilyInfo pass -> Located (IdP pass) -> LHsQTyVars pass -> LexicalFixity -> LFamilyResultSig pass -> Maybe (LInjectivityAnn pass) -> FamilyDecl pass
[fdExt] :: FamilyDecl pass -> XCFamilyDecl pass
[fdInfo] :: FamilyDecl pass -> FamilyInfo pass
[fdLName] :: FamilyDecl pass -> Located (IdP pass)
[fdTyVars] :: FamilyDecl pass -> LHsQTyVars pass
[fdFixity] :: FamilyDecl pass -> LexicalFixity
[fdResultSig] :: FamilyDecl pass -> LFamilyResultSig pass
[fdInjectivityAnn] :: FamilyDecl pass -> Maybe (LInjectivityAnn pass)

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnType</a>, <a>AnnData</a>,
--   <a>AnnFamily</a>, <a>AnnWhere</a>, <a>AnnOpenP</a>, <a>AnnDcolon</a>,
--   <a>AnnCloseP</a>, <a>AnnEqual</a>, <a>AnnRarrow</a>,
--   <a>AnnVbar</a></li>
--   </ul>
XFamilyDecl :: XXFamilyDecl pass -> FamilyDecl pass

-- | Located Injectivity Annotation
type LInjectivityAnn pass = Located InjectivityAnn 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 -&gt; a c where ...
--   
--   This will be represented as "InjectivityAnn <tt>r</tt> [<tt>a</tt>,
--   <tt>c</tt>]"
data InjectivityAnn pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnRarrow</a>, <a>AnnVbar</a></li>
--   </ul>
InjectivityAnn :: Located (IdP pass) -> [Located (IdP pass)] -> InjectivityAnn pass
data FamilyInfo pass
DataFamily :: FamilyInfo pass
OpenTypeFamily :: FamilyInfo pass

-- | <a>Nothing</a> if we're in an hs-boot file and the user said "type
--   family Foo x where .."
ClosedTypeFamily :: Maybe [LTyFamInstEqn pass] -> FamilyInfo pass

-- | Haskell Data type Definition
data HsDataDefn pass

-- | Declares a data type or newtype, giving its constructors <tt>
--   data/newtype T a = <a>constrs</a> data/newtype instance T [a] =
--   <a>constrs</a> </tt>
HsDataDefn :: XCHsDataDefn pass -> NewOrData -> LHsContext pass -> Maybe (Located 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 -> LHsContext pass
[dd_cType] :: HsDataDefn pass -> Maybe (Located CType)

-- | Optional kind signature.
--   
--   <tt>(Just k)</tt> for a GADT-style <tt>data</tt>, or <tt>data
--   instance</tt> decl, with explicit kind sig
--   
--   Always <tt>Nothing</tt> for H98-syntax decls
[dd_kindSig] :: HsDataDefn pass -> Maybe (LHsKind pass)

-- | Data constructors
--   
--   For <tt>data T a = T1 | T2 a</tt> the <a>LConDecl</a>s all have
--   <a>ConDeclH98</a>. For <tt>data T a where { T1 :: T a }</tt> the
--   <tt>LConDecls</tt> all have <a>ConDeclGADT</a>.
[dd_cons] :: HsDataDefn pass -> [LConDecl pass]

-- | Optional 'deriving' claues
[dd_derivs] :: HsDataDefn pass -> HsDeriving pass
XHsDataDefn :: XXHsDataDefn pass -> HsDataDefn pass

-- | Haskell Deriving clause
type HsDeriving pass = Located [LHsDerivingClause pass]
type LHsDerivingClause pass = Located HsDerivingClause pass

-- | A single <tt>deriving</tt> clause of a data declaration.
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnDeriving</a>, <a>AnnStock</a>,
--   <a>AnnAnyClass</a>, <a>AnnNewtype</a>,
--   <a>AnnOpen</a>,<a>AnnClose</a></li>
--   </ul>
data HsDerivingClause pass
HsDerivingClause :: XCHsDerivingClause pass -> Maybe (LDerivStrategy pass) -> Located [LHsSigType pass] -> HsDerivingClause pass
[deriv_clause_ext] :: HsDerivingClause pass -> XCHsDerivingClause pass

-- | The user-specified strategy (if any) to use when deriving
--   <a>deriv_clause_tys</a>.
[deriv_clause_strategy] :: HsDerivingClause pass -> Maybe (LDerivStrategy pass)

-- | The types to derive.
--   
--   It uses <a>LHsSigType</a>s because, with
--   <tt>-XGeneralizedNewtypeDeriving</tt>, we can mention type variables
--   that aren't bound by the datatype, e.g.
--   
--   <pre>
--   data T b = ... deriving (C [a])
--   </pre>
--   
--   should produce a derived instance for <tt>C [a] (T b)</tt>.
[deriv_clause_tys] :: HsDerivingClause pass -> Located [LHsSigType pass]
XHsDerivingClause :: XXHsDerivingClause pass -> HsDerivingClause pass

-- | Located Standalone Kind Signature
type LStandaloneKindSig pass = Located StandaloneKindSig pass
data StandaloneKindSig pass
StandaloneKindSig :: XStandaloneKindSig pass -> Located (IdP pass) -> LHsSigType pass -> StandaloneKindSig pass
XStandaloneKindSig :: XXStandaloneKindSig pass -> StandaloneKindSig pass
data NewOrData

-- | <pre>
--   newtype Blah ...
--   </pre>
NewType :: NewOrData

-- | <pre>
--   data Blah ...
--   </pre>
DataType :: NewOrData

-- | Located data Constructor Declaration
type LConDecl pass = Located ConDecl pass

-- | <pre>
--   data T b = forall a. Eq a =&gt; MkT a b
--     MkT :: forall b a. Eq a =&gt; MkT a b
--   
--   data T b where
--        MkT1 :: Int -&gt; T Int
--   
--   data T = Int <tt>MkT</tt> Int
--          | MkT2
--   
--   data T a where
--        Int <tt>MkT</tt> Int :: T Int
--   </pre>
--   
--   <ul>
--   <li><a>AnnKeywordId</a>s : <a>AnnOpen</a>,
--   <a>AnnDotdot</a>,<a>AnnCLose</a>, <a>AnnEqual</a>,<a>AnnVbar</a>,
--   <a>AnnDarrow</a>,<a>AnnDarrow</a>, <a>AnnForall</a>,<a>AnnDot</a></li>
--   </ul>
--   
--   data Constructor Declaration
data ConDecl pass
ConDeclGADT :: XConDeclGADT pass -> [Located (IdP pass)] -> Located Bool -> LHsQTyVars pass -> Maybe (LHsContext pass) -> HsConDeclDetails pass -> LHsType pass -> Maybe LHsDocString -> ConDecl pass
[con_g_ext] :: ConDecl pass -> XConDeclGADT pass
[con_names] :: ConDecl pass -> [Located (IdP pass)]

-- | True <a>=</a> explicit forall False =&gt; hsq_explicit is empty
[con_forall] :: ConDecl pass -> Located Bool
[con_qvars] :: ConDecl pass -> LHsQTyVars pass

-- | User-written context (if any)
[con_mb_cxt] :: ConDecl pass -> Maybe (LHsContext pass)

-- | Arguments; never InfixCon
[con_args] :: ConDecl pass -> HsConDeclDetails pass

-- | Result type
[con_res_ty] :: ConDecl pass -> LHsType pass

-- | A possible Haddock comment.
[con_doc] :: ConDecl pass -> Maybe LHsDocString
ConDeclH98 :: XConDeclH98 pass -> Located (IdP pass) -> Located Bool -> [LHsTyVarBndr pass] -> Maybe (LHsContext pass) -> HsConDeclDetails pass -> Maybe LHsDocString -> ConDecl pass
[con_ext] :: ConDecl pass -> XConDeclH98 pass
[con_name] :: ConDecl pass -> Located (IdP pass)

-- | True <a>=</a> explicit forall False =&gt; hsq_explicit is empty
[con_forall] :: ConDecl pass -> Located Bool

-- | Existentials only
[con_ex_tvs] :: ConDecl pass -> [LHsTyVarBndr pass]

-- | User-written context (if any)
[con_mb_cxt] :: ConDecl pass -> Maybe (LHsContext pass)

-- | Arguments; never InfixCon
[con_args] :: ConDecl pass -> HsConDeclDetails pass

-- | A possible Haddock comment.
[con_doc] :: ConDecl pass -> Maybe LHsDocString
XConDecl :: XXConDecl pass -> ConDecl pass

-- | Haskell data Constructor Declaration Details
type HsConDeclDetails pass = HsConDetails LBangType pass Located [LConDeclField pass]

-- | Located Type Family Instance Equation
type LTyFamInstEqn pass = Located TyFamInstEqn pass

-- | Haskell Type Patterns
type HsTyPats pass = [LHsTypeArg pass]

-- | Type Family Instance Equation
type TyFamInstEqn pass = FamInstEqn pass LHsType pass

-- | Type family default declarations. A convenient synonym for
--   <a>TyFamInstDecl</a>. See <tt>Note [Type family instance declarations
--   in HsSyn]</tt>.
type TyFamDefltDecl = TyFamInstDecl

-- | Located type family default declarations.
type LTyFamDefltDecl pass = Located TyFamDefltDecl pass

-- | Located Type Family Instance Declaration
type LTyFamInstDecl pass = Located TyFamInstDecl pass

-- | Type Family Instance Declaration
newtype TyFamInstDecl pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnType</a>, <a>AnnInstance</a>,</li>
--   </ul>
TyFamInstDecl :: TyFamInstEqn pass -> TyFamInstDecl pass
[tfid_eqn] :: TyFamInstDecl pass -> TyFamInstEqn pass

-- | Located Data Family Instance Declaration
type LDataFamInstDecl pass = Located DataFamInstDecl pass

-- | Data Family Instance Declaration
newtype DataFamInstDecl pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnData</a>,
--   <a>AnnNewType</a>,<a>AnnInstance</a>, <a>AnnDcolon</a>
--   <a>AnnWhere</a>,<a>AnnOpen</a>, <a>AnnClose</a></li>
--   </ul>
DataFamInstDecl :: FamInstEqn pass (HsDataDefn pass) -> DataFamInstDecl pass
[dfid_eqn] :: DataFamInstDecl pass -> FamInstEqn pass (HsDataDefn pass)

-- | Located Family Instance Equation
type LFamInstEqn pass rhs = Located FamInstEqn pass rhs

-- | Family Instance Equation
type FamInstEqn pass rhs = HsImplicitBndrs pass FamEqn pass rhs

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

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnEqual</a></li>
--   </ul>
FamEqn :: XCFamEqn pass rhs -> Located (IdP pass) -> Maybe [LHsTyVarBndr pass] -> HsTyPats pass -> LexicalFixity -> rhs -> FamEqn pass rhs
[feqn_ext] :: FamEqn pass rhs -> XCFamEqn pass rhs
[feqn_tycon] :: FamEqn pass rhs -> Located (IdP pass)

-- | Optional quantified type vars
[feqn_bndrs] :: FamEqn pass rhs -> Maybe [LHsTyVarBndr 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

-- | Located Class Instance Declaration
type LClsInstDecl pass = Located ClsInstDecl pass

-- | Class Instance Declaration
data ClsInstDecl pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnInstance</a>, <a>AnnWhere</a>,
--   <a>AnnOpen</a>,<a>AnnClose</a>,</li>
--   </ul>
ClsInstDecl :: XCClsInstDecl pass -> LHsSigType pass -> LHsBinds pass -> [LSig pass] -> [LTyFamInstDecl pass] -> [LDataFamInstDecl pass] -> Maybe (Located 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]

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>, <a>AnnClose</a>,</li>
--   </ul>
[cid_overlap_mode] :: ClsInstDecl pass -> Maybe (Located OverlapMode)
XClsInstDecl :: XXClsInstDecl pass -> ClsInstDecl pass

-- | Located Instance Declaration
type LInstDecl pass = Located InstDecl 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

-- | Located stand-alone 'deriving instance' declaration
type LDerivDecl pass = Located DerivDecl pass

-- | Stand-alone 'deriving instance' declaration
data DerivDecl pass
DerivDecl :: XCDerivDecl pass -> LHsSigWcType pass -> Maybe (LDerivStrategy pass) -> Maybe (Located OverlapMode) -> DerivDecl pass
[deriv_ext] :: DerivDecl pass -> XCDerivDecl pass

-- | The instance type to derive.
--   
--   It uses an <a>LHsSigWcType</a> because the context is allowed to be a
--   single wildcard:
--   
--   <pre>
--   deriving instance _ =&gt; Eq (Foo a)
--   </pre>
--   
--   Which signifies that the context should be inferred.
[deriv_type] :: DerivDecl pass -> LHsSigWcType pass
[deriv_strategy] :: DerivDecl pass -> Maybe (LDerivStrategy pass)

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnDeriving</a>, <a>AnnInstance</a>,
--   <a>AnnStock</a>, <a>AnnAnyClass</a>, <a>AnnNewtype</a>,
--   <a>AnnOpen</a>,<a>AnnClose</a></li>
--   </ul>
[deriv_overlap_mode] :: DerivDecl pass -> Maybe (Located OverlapMode)
XDerivDecl :: XXDerivDecl pass -> DerivDecl pass

-- | A <a>Located</a> <a>DerivStrategy</a>.
type LDerivStrategy pass = Located DerivStrategy pass

-- | 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., <a>Eq</a>, <a>Show</a>, <a>Functor</a> when
--   <tt>-XDeriveFunctor</tt> is enabled, etc.)
StockStrategy :: DerivStrategy pass

-- | <pre>
--   -XDeriveAnyClass
--   </pre>
AnyclassStrategy :: DerivStrategy pass

-- | <pre>
--   -XGeneralizedNewtypeDeriving
--   </pre>
NewtypeStrategy :: DerivStrategy pass

-- | <pre>
--   -XDerivingVia
--   </pre>
ViaStrategy :: XViaStrategy pass -> DerivStrategy pass

-- | Located Default Declaration
type LDefaultDecl pass = Located DefaultDecl pass

-- | Default Declaration
data DefaultDecl pass

-- | <ul>
--   <li><a>AnnKeywordId</a>s : <a>AnnDefault</a>,
--   <a>AnnOpen</a>,<a>AnnClose</a></li>
--   </ul>
DefaultDecl :: XCDefaultDecl pass -> [LHsType pass] -> DefaultDecl pass
XDefaultDecl :: XXDefaultDecl pass -> DefaultDecl pass

-- | Located Foreign Declaration
type LForeignDecl pass = Located ForeignDecl pass

-- | Foreign Declaration
data ForeignDecl pass
ForeignImport :: XForeignImport pass -> Located (IdP pass) -> LHsSigType pass -> ForeignImport -> ForeignDecl pass
[fd_i_ext] :: ForeignDecl pass -> XForeignImport pass
[fd_name] :: ForeignDecl pass -> Located (IdP pass)
[fd_sig_ty] :: ForeignDecl pass -> LHsSigType pass
[fd_fi] :: ForeignDecl pass -> ForeignImport

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnForeign</a>,
--   <a>AnnImport</a>,<a>AnnExport</a>, <a>AnnDcolon</a></li>
--   </ul>
ForeignExport :: XForeignExport pass -> Located (IdP pass) -> LHsSigType pass -> ForeignExport -> ForeignDecl pass
[fd_e_ext] :: ForeignDecl pass -> XForeignExport pass
[fd_name] :: ForeignDecl pass -> Located (IdP pass)
[fd_sig_ty] :: ForeignDecl pass -> LHsSigType pass
[fd_fe] :: ForeignDecl pass -> ForeignExport
XForeignDecl :: XXForeignDecl pass -> ForeignDecl pass
data ForeignImport
CImport :: Located CCallConv -> Located Safety -> Maybe Header -> CImportSpec -> Located SourceText -> ForeignImport
data CImportSpec
CLabel :: CLabelString -> CImportSpec
CFunction :: CCallTarget -> CImportSpec
CWrapper :: CImportSpec
data ForeignExport
CExport :: Located CExportSpec -> Located SourceText -> ForeignExport

-- | Located Rule Declarations
type LRuleDecls pass = Located RuleDecls pass

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

-- | Located Rule Declaration
type LRuleDecl pass = Located RuleDecl pass

-- | Rule Declaration
data RuleDecl pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>,<a>AnnTilde</a>,
--   <a>AnnVal</a>, <a>AnnClose</a>, <a>AnnForall</a>,<a>AnnDot</a>,
--   <a>AnnEqual</a>,</li>
--   </ul>
HsRule :: XHsRule pass -> Located (SourceText, RuleName) -> Activation -> Maybe [LHsTyVarBndr (NoGhcTc pass)] -> [LRuleBndr pass] -> Located (HsExpr pass) -> Located (HsExpr pass) -> RuleDecl pass

-- | After renamer, free-vars from the LHS and RHS
[rd_ext] :: RuleDecl pass -> XHsRule pass

-- | Note [Pragma source text] in BasicTypes
[rd_name] :: RuleDecl pass -> Located (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 -> Located (HsExpr pass)
[rd_rhs] :: RuleDecl pass -> Located (HsExpr pass)
XRuleDecl :: XXRuleDecl pass -> RuleDecl pass
data HsRuleRn
HsRuleRn :: NameSet -> NameSet -> HsRuleRn

-- | Located Rule Binder
type LRuleBndr pass = Located RuleBndr pass

-- | Rule Binder
data RuleBndr pass
RuleBndr :: XCRuleBndr pass -> Located (IdP pass) -> RuleBndr pass
RuleBndrSig :: XRuleBndrSig pass -> Located (IdP pass) -> LHsSigWcType pass -> RuleBndr pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>,
--   <a>AnnDcolon</a>,<a>AnnClose</a></li>
--   </ul>
XRuleBndr :: XXRuleBndr pass -> RuleBndr pass

-- | Located Documentation comment Declaration
type LDocDecl = Located DocDecl

-- | Documentation comment Declaration
data DocDecl
DocCommentNext :: HsDocString -> DocDecl
DocCommentPrev :: HsDocString -> DocDecl
DocCommentNamed :: String -> HsDocString -> DocDecl
DocGroup :: Int -> HsDocString -> DocDecl

-- | Located Warning Declarations
type LWarnDecls pass = Located WarnDecls pass

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

-- | Located Warning pragma Declaration
type LWarnDecl pass = Located WarnDecl pass

-- | Warning pragma Declaration
data WarnDecl pass
Warning :: XWarning pass -> [Located (IdP pass)] -> WarningTxt -> WarnDecl pass
XWarnDecl :: XXWarnDecl pass -> WarnDecl pass

-- | Located Annotation Declaration
type LAnnDecl pass = Located AnnDecl pass

-- | Annotation Declaration
data AnnDecl pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>, <a>AnnType</a>
--   <a>AnnModule</a> <a>AnnClose</a></li>
--   </ul>
HsAnnotation :: XHsAnnotation pass -> SourceText -> AnnProvenance (IdP pass) -> Located (HsExpr pass) -> AnnDecl pass
XAnnDecl :: XXAnnDecl pass -> AnnDecl pass

-- | Annotation Provenance
data AnnProvenance name
ValueAnnProvenance :: Located name -> AnnProvenance name
TypeAnnProvenance :: Located name -> AnnProvenance name
ModuleAnnProvenance :: AnnProvenance name

-- | Located Role Annotation Declaration
type LRoleAnnotDecl pass = Located RoleAnnotDecl pass

-- | Role Annotation Declaration
data RoleAnnotDecl pass

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnType</a>, <a>AnnRole</a></li>
--   </ul>
RoleAnnotDecl :: XCRoleAnnotDecl pass -> Located (IdP pass) -> [Located (Maybe Role)] -> RoleAnnotDecl pass
XRoleAnnotDecl :: XXRoleAnnotDecl pass -> RoleAnnotDecl pass
collectEvVarsPat :: Pat GhcTc -> Bag EvVar
collectEvVarsPats :: [Pat GhcTc] -> Bag EvVar

-- | <tt><a>parenthesizePat</a> p pat</tt> checks if
--   <tt><a>patNeedsParens</a> p pat</tt> is true, and if so, surrounds
--   <tt>pat</tt> with a <a>ParPat</a>. Otherwise, it simply returns
--   <tt>pat</tt>.
parenthesizePat :: forall (p :: Pass). PprPrec -> LPat (GhcPass p) -> LPat (GhcPass p)

-- | <tt><a>patNeedsParens</a> p pat</tt> returns <a>True</a> if the
--   pattern <tt>pat</tt> needs parentheses under precedence <tt>p</tt>.
patNeedsParens :: PprPrec -> Pat p -> Bool
isIrrefutableHsPat :: forall (p :: Pass). OutputableBndrId p => LPat (GhcPass p) -> Bool
looksLazyPatBind :: forall (p :: Pass). HsBind (GhcPass p) -> Bool
isBangedLPat :: forall (p :: Pass). LPat (GhcPass p) -> Bool
mkCharLitPat :: forall (p :: Pass). SourceText -> Char -> OutPat (GhcPass p)
mkNilPat :: forall (p :: Pass). Type -> OutPat (GhcPass p)
mkPrefixConPat :: forall (p :: Pass). DataCon -> [OutPat (GhcPass p)] -> [Type] -> OutPat (GhcPass p)
pprConArgs :: forall (p :: Pass). OutputableBndrId p => HsConPatDetails (GhcPass p) -> SDoc
pprParendLPat :: forall (p :: Pass). OutputableBndrId p => PprPrec -> LPat (GhcPass p) -> SDoc
hsRecUpdFieldOcc :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> LFieldOcc GhcTc
hsRecUpdFieldId :: HsRecField' (AmbiguousFieldOcc GhcTc) arg -> Located Id
hsRecUpdFieldRdr :: forall (p :: Pass). HsRecUpdField (GhcPass p) -> Located RdrName
hsRecFieldId :: HsRecField GhcTc arg -> Located Id
hsRecFieldSel :: HsRecField pass arg -> Located (XCFieldOcc pass)
hsRecFieldsArgs :: HsRecFields p arg -> [arg]
hsRecFields :: HsRecFields p arg -> [XCFieldOcc p]
hsConPatArgs :: HsConPatDetails p -> [LPat p]
type InPat p = LPat p
type OutPat p = LPat p
data ListPatTc
ListPatTc :: Type -> Maybe (Type, SyntaxExpr GhcTc) -> ListPatTc

-- | Haskell Constructor Pattern Details
type HsConPatDetails p = HsConDetails LPat p HsRecFields p LPat 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)

-- | Located Haskell Record Field
type LHsRecField' p arg = Located HsRecField' p arg

-- | Located Haskell Record Field
type LHsRecField p arg = Located HsRecField p arg

-- | Located Haskell Record Update Field
type LHsRecUpdField p = Located HsRecUpdField p

-- | Haskell Record Field
type HsRecField p arg = HsRecField' FieldOcc p arg

-- | Haskell Record Update Field
type HsRecUpdField p = HsRecField' AmbiguousFieldOcc p LHsExpr p

-- | Haskell Record Field
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnEqual</a>,</li>
--   </ul>
--   
--   For details on above see note [Api annotations] in ApiAnnotation
data HsRecField' id arg
HsRecField :: Located id -> arg -> Bool -> HsRecField' id arg
[hsRecFieldLbl] :: HsRecField' id arg -> Located id

-- | Filled in by renamer when punning
[hsRecFieldArg] :: HsRecField' id arg -> arg

-- | Note [Punning]
[hsRecPun] :: HsRecField' id arg -> Bool
pprMinimalSig :: OutputableBndr name => LBooleanFormula (Located name) -> SDoc
pprTcSpecPrags :: TcSpecPrags -> SDoc
pprSpec :: OutputableBndr id => id -> SDoc -> InlinePragma -> SDoc
pprVarSig :: OutputableBndr id => [id] -> SDoc -> SDoc

-- | 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
hsSigDoc :: Sig name -> SDoc
isCompleteMatchSig :: LSig name -> Bool
isSCCFunSig :: LSig name -> Bool
isMinimalLSig :: LSig name -> Bool
isInlineLSig :: LSig name -> Bool
isPragLSig :: LSig name -> Bool
isSpecInstLSig :: LSig name -> Bool
isSpecLSig :: LSig name -> Bool
isTypeLSig :: LSig name -> Bool
isFixityLSig :: LSig name -> Bool
isDefaultMethod :: TcSpecPrags -> Bool
hasSpecPrags :: TcSpecPrags -> Bool
noSpecPrags :: TcSpecPrags
isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool
isEmptyIPBindsPR :: forall (p :: Pass). HsIPBinds (GhcPass p) -> Bool
pprTicks :: SDoc -> SDoc -> SDoc
ppr_monobind :: forall (idL :: Pass) (idR :: Pass). (OutputableBndrId idL, OutputableBndrId idR) => HsBindLR (GhcPass idL) (GhcPass idR) -> SDoc
plusHsValBinds :: forall (a :: Pass). HsValBinds (GhcPass a) -> HsValBinds (GhcPass a) -> HsValBinds (GhcPass a)
isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
emptyLHsBinds :: LHsBindsLR idL idR
emptyValBindsOut :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
emptyValBindsIn :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b)
isEmptyValBinds :: forall (a :: Pass) (b :: Pass). HsValBindsLR (GhcPass a) (GhcPass b) -> Bool
eqEmptyLocalBinds :: HsLocalBindsLR a b -> Bool
isEmptyLocalBindsPR :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b) -> Bool
isEmptyLocalBindsTc :: forall (a :: Pass). HsLocalBindsLR (GhcPass a) GhcTc -> Bool
emptyLocalBinds :: forall (a :: Pass) (b :: Pass). HsLocalBindsLR (GhcPass a) (GhcPass b)
pprDeclList :: [SDoc] -> 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

-- | Haskell Local Bindings
type HsLocalBinds id = HsLocalBindsLR id id

-- | Located Haskell local bindings
type LHsLocalBinds id = Located HsLocalBinds id

-- | 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
type LHsLocalBindsLR idL idR = Located HsLocalBindsLR idL idR

-- | Haskell Value Bindings
type HsValBinds id = HsValBindsLR id 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
data NHsValBindsLR idL
NValBinds :: [(RecFlag, LHsBinds idL)] -> [LSig GhcRn] -> NHsValBindsLR idL

-- | Located Haskell Binding
type LHsBind id = LHsBindLR id id

-- | Located Haskell Bindings
type LHsBinds id = LHsBindsLR id id

-- | Haskell Binding
type HsBind id = HsBindLR id id

-- | Located Haskell Bindings with separate Left and Right identifier types
type LHsBindsLR idL idR = Bag LHsBindLR idL idR

-- | Located Haskell Binding with separate Left and Right identifier types
type LHsBindLR idL idR = Located HsBindLR idL idR

-- | Haskell Binding with separate Left and Right id's
data HsBindLR idL idR

-- | Function-like Binding
--   
--   FunBind is used for both functions <tt>f x = e</tt> and variables
--   <tt>f = x -&gt; e</tt> and strict variables <tt>!x = x + 1</tt>
--   
--   Reason 1: Special case for type inference: see <a>tcMonoBinds</a>.
--   
--   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 <tt>f :: a-&gt;a = ...</tt> parses as a pattern
--   binding, just like <tt>(f :: a -&gt; a) = ... </tt>
--   
--   Strict bindings have their strictness recorded in the
--   <a>SrcStrictness</a> of their <tt>MatchContext</tt>. See Note [FunBind
--   vs PatBind] for details about the relationship between FunBind and
--   PatBind.
--   
--   <a>AnnKeywordId</a>s
--   
--   <ul>
--   <li><a>AnnFunId</a>, attached to each element of fun_matches</li>
--   <li><a>AnnEqual</a>,<a>AnnWhere</a>,
--   <a>AnnOpen</a>,<a>AnnClose</a>,</li>
--   </ul>
FunBind :: XFunBind idL idR -> Located (IdP idL) -> MatchGroup idR (LHsExpr idR) -> HsWrapper -> [Tickish Id] -> HsBindLR idL idR

-- | After the renamer, this contains the locally-bound free variables of
--   this defn. See Note [Bind free vars]
[fun_ext] :: HsBindLR idL idR -> XFunBind idL idR
[fun_id] :: HsBindLR idL idR -> Located (IdP idL)

-- | The payload
[fun_matches] :: HsBindLR idL idR -> MatchGroup idR (LHsExpr idR)

-- | Coercion from the type of the MatchGroup to the type of the Id.
--   Example:
--   
--   <pre>
--   f :: Int -&gt; forall a. a -&gt; a
--   f x y = y
--   </pre>
--   
--   Then the MatchGroup will have type (Int -&gt; a' -&gt; 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 -&gt; forall a'. a' -&gt; a'
--   Notice that the coercion captures the free a'.
[fun_co_fn] :: HsBindLR idL idR -> HsWrapper

-- | Ticks to put on the rhs, if any
[fun_tick] :: HsBindLR idL idR -> [Tickish Id]

-- | 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) -> ([Tickish Id], [[Tickish Id]]) -> 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 -> ([Tickish Id], [[Tickish Id]])

-- | Variable Binding
--   
--   Dictionary binding and suchlike. All VarBinds are introduced by the
--   type checker
VarBind :: XVarBind idL idR -> IdP idL -> LHsExpr idR -> Bool -> 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

-- | True <a>=</a> inline this binding regardless (used for implication
--   constraints only)
[var_inline] :: HsBindLR idL idR -> Bool

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

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnPattern</a>,
--   <a>AnnLarrow</a>,<a>AnnEqual</a>, <a>AnnWhere</a> <a>AnnOpen</a>
--   <tt>'{'</tt>,<a>AnnClose</a> <tt>'}'</tt></li>
--   </ul>
PatSynBind :: XPatSynBind idL idR -> PatSynBind idL idR -> HsBindLR idL idR
XHsBindsLR :: XXHsBindsLR idL idR -> HsBindLR idL idR
data NPatBindTc
NPatBindTc :: NameSet -> Type -> NPatBindTc

-- | Free variables
[pat_fvs] :: NPatBindTc -> NameSet

-- | Type of the GRHSs
[pat_rhs_ty] :: NPatBindTc -> Type

-- | Abtraction 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 =&gt;
--   abe_mono) ~ abe_poly
[abe_wrap] :: ABExport p -> HsWrapper

-- | SPECIALISE pragmas
[abe_prags] :: ABExport p -> TcSpecPrags
XABExport :: XXABExport p -> ABExport p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnPattern</a>,
--   <a>AnnEqual</a>,<a>AnnLarrow</a> <a>AnnWhere</a>,<a>AnnOpen</a>
--   <tt>'{'</tt>, <a>AnnClose</a> <tt>'}'</tt>,</li>
--   </ul>
--   
--   Pattern Synonym binding
data PatSynBind idL idR
PSB :: XPSB idL idR -> Located (IdP idL) -> HsPatSynDetails (Located (IdP 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 -> Located (IdP idL)

-- | Formal parameter names
[psb_args] :: PatSynBind idL idR -> HsPatSynDetails (Located (IdP 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

-- | Haskell Implicit Parameter Bindings
data HsIPBinds id
IPBinds :: XIPBinds id -> [LIPBind id] -> HsIPBinds id
XHsIPBinds :: XXHsIPBinds id -> HsIPBinds id

-- | Located Implicit Parameter Binding
--   
--   May have <a>AnnKeywordId</a> : <a>AnnSemi</a> when in a list
type LIPBind id = Located IPBind id

-- | 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.
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnEqual</a></li>
--   </ul>
data IPBind id
IPBind :: XCIPBind id -> Either (Located HsIPName) (IdP id) -> LHsExpr id -> IPBind id
XIPBind :: XXIPBind id -> IPBind id

-- | Located Signature
type LSig pass = Located Sig pass

-- | Signatures and pragmas
data Sig pass

-- | An ordinary type signature
--   
--   <pre>
--   f :: Num a =&gt; a -&gt; a
--   </pre>
--   
--   After renaming, this list of Names contains the named wildcards
--   brought into scope by this signature. For a signature <tt>_ -&gt; _a
--   -&gt; Bool</tt>, the renamer will leave the unnamed wildcard
--   <tt>_</tt> untouched, and the named wildcard <tt>_a</tt> 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.
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnDcolon</a>, <a>AnnComma</a></li>
--   </ul>
TypeSig :: XTypeSig pass -> [Located (IdP pass)] -> LHsSigWcType pass -> Sig pass

-- | A pattern synonym type signature
--   
--   <pre>
--   pattern Single :: () =&gt; (Show a) =&gt; a -&gt; [a]
--   </pre>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnPattern</a>,
--   <a>AnnDcolon</a>,<a>AnnForall</a> <a>AnnDot</a>,<a>AnnDarrow</a></li>
--   </ul>
PatSynSig :: XPatSynSig pass -> [Located (IdP 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 -&gt; a -- Ordinary default op :: Eq a =&gt; a -&gt; a -- Generic
--   default No wildcards allowed here
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnDefault</a>, <a>AnnDcolon</a></li>
--   </ul>
ClassOpSig :: XClassOpSig pass -> Bool -> [Located (IdP 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
--   
--   <pre>
--   infixl 8 ***
--   </pre>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnInfix</a>, <a>AnnVal</a></li>
--   </ul>
FixSig :: XFixSig pass -> FixitySig pass -> Sig pass

-- | An inline pragma
--   
--   <pre>
--   {#- INLINE f #-}
--   </pre>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'{-# INLINE'</tt> and
--   <tt>'['</tt>, <a>AnnClose</a>,<a>AnnOpen</a>,
--   <a>AnnVal</a>,<a>AnnTilde</a>, <a>AnnClose</a></li>
--   </ul>
InlineSig :: XInlineSig pass -> Located (IdP pass) -> InlinePragma -> Sig pass

-- | A specialisation pragma
--   
--   <pre>
--   {-# SPECIALISE f :: Int -&gt; Int #-}
--   </pre>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>, <a>AnnOpen</a> <tt>'{-#
--   SPECIALISE'</tt> and <tt>'['</tt>, <a>AnnTilde</a>, <a>AnnVal</a>,
--   <a>AnnClose</a> <tt>']'</tt> and <tt>'#-}'</tt>, <a>AnnDcolon</a></li>
--   </ul>
SpecSig :: XSpecSig pass -> Located (IdP pass) -> [LHsSigType pass] -> InlinePragma -> Sig pass

-- | A specialisation pragma for instance declarations only
--   
--   <pre>
--   {-# SPECIALISE instance Eq [Int] #-}
--   </pre>
--   
--   (Class tys); should be a specialisation of the current instance
--   declaration
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>,
--   <a>AnnInstance</a>,<a>AnnClose</a></li>
--   </ul>
SpecInstSig :: XSpecInstSig pass -> SourceText -> LHsSigType pass -> Sig pass

-- | A minimal complete definition pragma
--   
--   <pre>
--   {-# MINIMAL a | (b, c | (d | e)) #-}
--   </pre>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>,
--   <a>AnnVbar</a>,<a>AnnComma</a>, <a>AnnClose</a></li>
--   </ul>
MinimalSig :: XMinimalSig pass -> SourceText -> LBooleanFormula (Located (IdP pass)) -> Sig pass

-- | A "set cost centre" pragma for declarations
--   
--   <pre>
--   {-# SCC funName #-}
--   </pre>
--   
--   or
--   
--   <pre>
--   {-# SCC funName "cost_centre_name" #-}
--   </pre>
SCCFunSig :: XSCCFunSig pass -> SourceText -> Located (IdP pass) -> Maybe (Located StringLiteral) -> Sig pass

-- | A complete match pragma
--   
--   <pre>
--   {-# COMPLETE C, D [:: T] #-}
--   </pre>
--   
--   Used to inform the pattern match checker about additional complete
--   matchings which, for example, arise from pattern synonym definitions.
CompleteMatchSig :: XCompleteMatchSig pass -> SourceText -> Located [Located (IdP pass)] -> Maybe (Located (IdP pass)) -> Sig pass
XSig :: XXSig pass -> Sig pass

-- | Located Fixity Signature
type LFixitySig pass = Located FixitySig pass

-- | Fixity Signature
data FixitySig pass
FixitySig :: XFixitySig pass -> [Located (IdP pass)] -> Fixity -> FixitySig pass
XFixitySig :: XXFixitySig pass -> FixitySig pass

-- | Type checker Specialisation Pragmas
--   
--   <a>TcSpecPrags</a> conveys <tt>SPECIALISE</tt> 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

-- | Located Type checker Specification Pragmas
type LTcSpecPrag = Located TcSpecPrag

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

-- | Haskell Pattern Synonym Details
type HsPatSynDetails arg = HsConDetails arg [RecordPatSynField arg]

-- | Record Pattern Synonym Field
data RecordPatSynField a
RecordPatSynField :: a -> a -> RecordPatSynField a
[recordPatSynSelectorId] :: RecordPatSynField a -> a
[recordPatSynPatVar] :: RecordPatSynField a -> a

-- | Haskell Pattern Synonym Direction
data HsPatSynDir id
Unidirectional :: HsPatSynDir id
ImplicitBidirectional :: HsPatSynDir id
ExplicitBidirectional :: MatchGroup id (LHsExpr id) -> HsPatSynDir id

-- | Create a <a>Coercion</a> that wraps a value in an implicit-parameter
--   dictionary. See <a>unwrapIP</a>.
wrapIP :: Type -> CoercionR

-- | Create a <a>Coercion</a> that unwraps an implicit-parameter or
--   overloaded-label dictionary to expose the underlying value. We expect
--   the <a>Type</a> to have the form `IP sym ty` or `IsLabel sym ty`, and
--   return a <a>Coercion</a> `co :: IP sym ty ~ ty` or `co :: IsLabel sym
--   ty ~ Proxy# sym -&gt; ty`. See also Note [Type-checking overloaded
--   labels] in TcExpr.
unwrapIP :: Type -> CoercionR
pprHsWrapper :: HsWrapper -> (Bool -> SDoc) -> SDoc
evVarsOfTerm :: EvTerm -> VarSet
findNeededEvVars :: EvBindMap -> VarSet -> VarSet
evTermCoercion :: EvTerm -> TcCoercion
evTermCoercion_maybe :: EvTerm -> Maybe TcCoercion
isEmptyTcEvBinds :: TcEvBinds -> Bool
emptyTcEvBinds :: TcEvBinds
mkEvScSelectors :: Class -> [TcType] -> [(TcPredType, EvExpr)]
mkEvCast :: EvExpr -> TcCoercion -> EvTerm
evTypeable :: Type -> EvTypeable -> EvTerm
evSelector :: Id -> [Type] -> [EvExpr] -> EvExpr
evDataConApp :: DataCon -> [Type] -> [EvExpr] -> EvTerm
evDFunApp :: DFunId -> [Type] -> [EvExpr] -> EvTerm

-- | d |&gt; co
evCast :: EvExpr -> TcCoercion -> EvTerm
evCoercion :: TcCoercion -> EvTerm

-- | Any sort of evidence Id, including coercions
evId :: EvId -> EvExpr
mkGivenEvBind :: EvVar -> EvTerm -> EvBind
mkWantedEvBind :: EvVar -> EvTerm -> EvBind
evBindVar :: EvBind -> EvVar
filterEvBindMap :: (EvBind -> Bool) -> EvBindMap -> EvBindMap
foldEvBindMap :: (EvBind -> a -> a) -> a -> EvBindMap -> a
evBindMapBinds :: EvBindMap -> Bag EvBind
lookupEvBind :: EvBindMap -> EvVar -> Maybe EvBind
isEmptyEvBindMap :: EvBindMap -> Bool
extendEvBinds :: EvBindMap -> EvBind -> EvBindMap
emptyEvBindMap :: EvBindMap
isCoEvBindsVar :: EvBindsVar -> Bool
collectHsWrapBinders :: HsWrapper -> ([Var], HsWrapper)

-- | Is the wrapper erasable, i.e., will not affect runtime semantics?
isErasableHsWrapper :: HsWrapper -> Bool
isIdHsWrapper :: HsWrapper -> Bool
idHsWrapper :: HsWrapper
mkWpLet :: TcEvBinds -> HsWrapper
mkWpLams :: [Var] -> HsWrapper
mkWpTyLams :: [TyVar] -> HsWrapper
mkWpEvVarApps :: [EvVar] -> HsWrapper
mkWpEvApps :: [EvTerm] -> HsWrapper
mkWpTyApps :: [Type] -> HsWrapper
mkWpCastN :: TcCoercionN -> HsWrapper
mkWpCastR :: TcCoercionR -> HsWrapper
mkWpFun :: HsWrapper -> HsWrapper -> TcType -> TcType -> SDoc -> HsWrapper
(<.>) :: HsWrapper -> HsWrapper -> HsWrapper

-- | If the EqRel is ReprEq, makes a SubCo; otherwise, does nothing. Note
--   that the input coercion should always be nominal.
maybeTcSubCo :: EqRel -> TcCoercion -> TcCoercion
tcCoToMCo :: TcCoercion -> TcMCoercion

-- | This version does a slow check, calculating the related types and
--   seeing if they are equal.
isTcReflexiveCo :: TcCoercion -> Bool
isTcGReflMCo :: TcMCoercion -> Bool
isTcReflCo :: TcCoercion -> Bool
coVarsOfTcCo :: TcCoercion -> TcTyCoVarSet
tcCoercionRole :: TcCoercion -> Role
tcCoercionKind :: TcCoercion -> Pair TcType
mkTcCoVarCo :: CoVar -> TcCoercion
mkTcKindCo :: TcCoercion -> TcCoercionN
mkTcPhantomCo :: TcCoercionN -> TcType -> TcType -> TcCoercionP
mkTcCoherenceRightCo :: Role -> TcType -> TcCoercionN -> TcCoercion -> TcCoercion
mkTcCoherenceLeftCo :: Role -> TcType -> TcCoercionN -> TcCoercion -> TcCoercion
mkTcGReflLeftCo :: Role -> TcType -> TcCoercionN -> TcCoercion
mkTcGReflRightCo :: Role -> TcType -> TcCoercionN -> TcCoercion
mkTcAxiomRuleCo :: CoAxiomRule -> [TcCoercion] -> TcCoercionR
tcDowngradeRole :: Role -> Role -> TcCoercion -> TcCoercion
mkTcSubCo :: TcCoercionN -> TcCoercionR
mkTcLRCo :: LeftOrRight -> TcCoercion -> TcCoercion
mkTcNthCo :: Role -> Int -> TcCoercion -> TcCoercion
mkTcForAllCos :: [(TyVar, TcCoercionN)] -> TcCoercion -> TcCoercion
mkTcForAllCo :: TyVar -> TcCoercionN -> TcCoercion -> TcCoercion
mkTcUnbranchedAxInstCo :: CoAxiom Unbranched -> [TcType] -> [TcCoercion] -> TcCoercionR
mkTcAxInstCo :: forall (br :: BranchFlag). Role -> CoAxiom br -> BranchIndex -> [TcType] -> [TcCoercion] -> TcCoercion
mkTcFunCo :: Role -> TcCoercion -> TcCoercion -> TcCoercion
mkTcAppCo :: TcCoercion -> TcCoercionN -> TcCoercion
mkTcTyConAppCo :: Role -> TyCon -> [TcCoercion] -> TcCoercion
mkTcRepReflCo :: TcType -> TcCoercionR
mkTcNomReflCo :: TcType -> TcCoercionN
mkTcTransCo :: TcCoercion -> TcCoercion -> TcCoercion
mkTcSymCo :: TcCoercion -> TcCoercion
mkTcReflCo :: Role -> TcType -> TcCoercion
type TcCoercion = Coercion
type TcCoercionN = CoercionN
type TcCoercionR = CoercionR
type TcCoercionP = CoercionP
type TcMCoercion = MCoercion
data HsWrapper
WpHole :: HsWrapper
WpCompose :: HsWrapper -> HsWrapper -> HsWrapper
WpFun :: HsWrapper -> HsWrapper -> TcType -> SDoc -> HsWrapper
WpCast :: TcCoercionR -> HsWrapper
WpEvLam :: EvVar -> HsWrapper
WpEvApp :: EvTerm -> HsWrapper
WpTyLam :: TyVar -> HsWrapper
WpTyApp :: KindOrType -> HsWrapper
WpLet :: TcEvBinds -> HsWrapper
data TcEvBinds
TcEvBinds :: EvBindsVar -> TcEvBinds
EvBinds :: Bag EvBind -> TcEvBinds
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
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

-- | Instructions on how to make a <tt>Typeable</tt> dictionary. See Note
--   [Typeable evidence terms]
data EvTypeable

-- | Dictionary for <tt>Typeable T</tt> where <tt>T</tt> is a type
--   constructor with all of its kind variables saturated. The
--   <tt>[EvTerm]</tt> is <tt>Typeable</tt> evidence for the applied
--   kinds..
EvTypeableTyCon :: TyCon -> [EvTerm] -> EvTypeable

-- | Dictionary for <tt>Typeable (s t)</tt>, given a dictionaries for
--   <tt>s</tt> and <tt>t</tt>.
EvTypeableTyApp :: EvTerm -> EvTerm -> EvTypeable

-- | Dictionary for <tt>Typeable (s -&gt; t)</tt>, given a dictionaries for
--   <tt>s</tt> and <tt>t</tt>.
EvTypeableTrFun :: EvTerm -> EvTerm -> EvTypeable

-- | Dictionary for a type literal, e.g. <tt>Typeable "foo"</tt> or
--   <tt>Typeable 3</tt> The <a>EvTerm</a> is evidence of, e.g.,
--   <tt>KnownNat 3</tt> (see #10348)
EvTypeableTyLit :: EvTerm -> EvTypeable

-- | Evidence for <tt>CallStack</tt> implicit parameters.
data EvCallStack
EvCsEmpty :: EvCallStack

-- | <tt>EvCsPushCall name loc stk</tt> represents a call to <tt>name</tt>,
--   occurring at <tt>loc</tt>, in a calling context <tt>stk</tt>.
EvCsPushCall :: Name -> RealSrcSpan -> EvExpr -> EvCallStack
instanceBindFun :: TyCoVar -> BindFlag

-- | See Note [Rules for instance lookup] ^ See Note [Safe Haskell
--   Overlapping Instances] in TcSimplify ^ See Note [Safe Haskell
--   Overlapping Instances Implementation] in TcSimplify
lookupInstEnv :: Bool -> InstEnvs -> Class -> [Type] -> ClsInstLookupResult

-- | Look up an instance in the given instance environment. The given class
--   application must match exactly one instance and the match may not
--   contain any flexi type variables. If the lookup is unsuccessful, yield
--   'Left errorMessage'.
lookupUniqueInstEnv :: InstEnvs -> Class -> [Type] -> Either MsgDoc (ClsInst, [Type])

-- | True when when the instance heads are the same e.g. both are Eq
--   [(a,b)] Used for overriding in GHCi Obviously should be insenstive to
--   alpha-renaming
identicalClsInstHead :: ClsInst -> ClsInst -> Bool
deleteDFunFromInstEnv :: InstEnv -> DFunId -> InstEnv
deleteFromInstEnv :: InstEnv -> ClsInst -> InstEnv
extendInstEnv :: InstEnv -> ClsInst -> InstEnv
extendInstEnvList :: InstEnv -> [ClsInst] -> InstEnv

-- | Checks for an exact match of ClsInst in the instance environment. We
--   use this when we do signature checking in TcRnDriver
memberInstEnv :: InstEnv -> ClsInst -> Bool
classInstances :: InstEnvs -> Class -> [ClsInst]

-- | Test if an instance is visible, by checking that its origin module is
--   in <a>VisibleOrphanModules</a>. See Note [Instance lookup and orphan
--   instances]
instIsVisible :: VisibleOrphanModules -> ClsInst -> Bool
instEnvClasses :: InstEnv -> [Class]
instEnvElts :: InstEnv -> [ClsInst]
emptyInstEnv :: InstEnv
mkImportedInstance :: Name -> [Maybe Name] -> Name -> DFunId -> OverlapFlag -> IsOrphan -> ClsInst
mkLocalInstance :: DFunId -> OverlapFlag -> [TyVar] -> Class -> [Type] -> ClsInst
instanceSig :: ClsInst -> ([TyVar], [Type], Class, [Type])

-- | Collects the names of concrete types and type constructors that make
--   up the head of a class instance. For instance, given `class Foo a b`:
--   
--   `instance Foo (Either (Maybe Int) a) Bool` would yield [Either, Maybe,
--   Int, Bool]
--   
--   Used in the implementation of ":info" in GHCi.
--   
--   The <a>tcSplitSigmaTy</a> is because of instance Foo a =&gt; Baz T
--   where ... The decl is an orphan if Baz and T are both not locally
--   defined, even if Foo *is* locally defined
orphNamesOfClsInst :: ClsInst -> NameSet
instanceHead :: ClsInst -> ([TyVar], Class, [Type])
pprInstances :: [ClsInst] -> SDoc
pprInstanceHdr :: ClsInst -> SDoc
pprInstance :: ClsInst -> SDoc
instanceRoughTcs :: ClsInst -> [Maybe Name]
updateClsInstDFun :: (DFunId -> DFunId) -> ClsInst -> ClsInst
instanceDFunId :: ClsInst -> DFunId
isIncoherent :: ClsInst -> Bool
isOverlapping :: ClsInst -> Bool
isOverlappable :: ClsInst -> Bool

-- | A fuzzy comparison function for class instances, intended for sorting
--   instances before displaying them to the user.
fuzzyClsInstCmp :: ClsInst -> ClsInst -> Ordering

-- | A type-class instance. Note that there is some tricky laziness at work
--   here. See Note [ClsInst laziness and the rough-match fields] for more
--   details.
data ClsInst
ClsInst :: Name -> [Maybe Name] -> Name -> [TyVar] -> Class -> [Type] -> DFunId -> OverlapFlag -> IsOrphan -> ClsInst

-- | Class name
[is_cls_nm] :: ClsInst -> Name

-- | Top of type args
[is_tcs] :: ClsInst -> [Maybe Name]

-- | <tt>is_dfun_name = idName . is_dfun</tt>.
--   
--   We use <a>is_dfun_name</a> for the visibility check,
--   <a>instIsVisible</a>, which needs to know the <a>Module</a> which the
--   dictionary is defined in. However, we cannot use the <a>Module</a>
--   attached to <a>is_dfun</a> since doing so would mean we would
--   potentially pull in an entire interface file unnecessarily. This was
--   the cause of #12367.
[is_dfun_name] :: ClsInst -> Name
[is_tvs] :: ClsInst -> [TyVar]
[is_cls] :: ClsInst -> Class
[is_tys] :: ClsInst -> [Type]
[is_dfun] :: ClsInst -> DFunId
[is_flag] :: ClsInst -> OverlapFlag
[is_orphan] :: ClsInst -> IsOrphan
type InstEnv = UniqDFM ClsInstEnv

-- | <a>InstEnvs</a> represents the combination of the global type class
--   instance environment, the local type class instance environment, and
--   the set of transitively reachable orphan modules (according to what
--   modules have been directly imported) used to test orphan instance
--   visibility.
data InstEnvs
InstEnvs :: InstEnv -> InstEnv -> VisibleOrphanModules -> InstEnvs
[ie_global] :: InstEnvs -> InstEnv
[ie_local] :: InstEnvs -> InstEnv
[ie_visible] :: InstEnvs -> VisibleOrphanModules

-- | Set of visible orphan modules, according to what modules have been
--   directly imported. This is based off of the dep_orphs field, which
--   records transitively reachable orphan modules (modules that define
--   orphan instances).
type VisibleOrphanModules = ModuleSet
type DFunInstType = Maybe Type
type InstMatch = (ClsInst, [DFunInstType])
type ClsInstLookupResult = ([InstMatch], [ClsInst], [InstMatch])
setLclEnvTcLevel :: TcLclEnv -> TcLevel -> TcLclEnv
getLclEnvTcLevel :: TcLclEnv -> TcLevel
setLclEnvLoc :: TcLclEnv -> RealSrcSpan -> TcLclEnv
getLclEnvLoc :: TcLclEnv -> RealSrcSpan
data TcLclEnv
TcLclEnv :: RealSrcSpan -> [ErrCtxt] -> TcLevel -> ThStage -> ThBindEnv -> ArrowCtxt -> LocalRdrEnv -> TcTypeEnv -> TcBinderStack -> TcRef WantedConstraints -> TcRef Messages -> TcLclEnv
[tcl_loc] :: TcLclEnv -> RealSrcSpan
[tcl_ctxt] :: TcLclEnv -> [ErrCtxt]
[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_bndrs] :: TcLclEnv -> TcBinderStack
[tcl_lie] :: TcLclEnv -> TcRef WantedConstraints
[tcl_errs] :: TcLclEnv -> TcRef Messages

-- | Should this type be applied to a visible argument?
isNextArgVisible :: TcType -> Bool

-- | If the tycon is applied to the types, is the next argument visible?
isNextTyConArgVisible :: TyCon -> [Type] -> Bool

-- | For every arg a tycon can take, the returned list says True if the
--   argument is taken visibly, and False otherwise. Ends with an infinite
--   tail of Trues to allow for oversaturation.
tcTyConVisibilities :: TyCon -> [Bool]
sizeTypes :: [Type] -> TypeSize
sizeType :: Type -> TypeSize
isFunPtrTy :: Type -> Bool
isFFIPrimResultTy :: DynFlags -> Type -> Validity
isFFIPrimArgumentTy :: DynFlags -> Type -> Validity
isFFILabelTy :: Type -> Validity
isFFIDynTy :: Type -> Type -> Validity
isFFIExportResultTy :: Type -> Validity
isFFIImportResultTy :: DynFlags -> Type -> Validity
isFFIExternalTy :: Type -> Validity
isFFIArgumentTy :: DynFlags -> Safety -> Type -> Validity
isFFITy :: Type -> Bool
deNoteType :: Type -> Type

-- | Is this type *almost function-free*? See Note [Almost function-free]
--   in TcRnTypes
isAlmostFunctionFree :: TcType -> Bool
isRigidTy :: TcType -> Bool

-- | Does the given tyvar appear at the head of a chain of applications (a
--   t1 ... tn)
isTyVarHead :: TcTyVar -> TcType -> Bool

-- | Is a <a>PredType</a> a <tt>CallStack</tt> implicit parameter?
--   
--   If so, return the name of the parameter.
isCallStackPred :: Class -> [Type] -> Maybe FastString

-- | Is a type a <tt>CallStack</tt>?
isCallStackTy :: Type -> Bool

-- | Is a type <a>String</a>?
isStringTy :: Type -> Bool

-- | Does a type represent a floating-point number?
isFloatingTy :: Type -> Bool
isCharTy :: Type -> Bool
isUnitTy :: Type -> Bool
isBoolTy :: Type -> Bool
isWordTy :: Type -> Bool
isIntTy :: Type -> Bool
isIntegerTy :: Type -> Bool
isDoubleTy :: Type -> Bool
isFloatTy :: Type -> Bool
isOverloadedTy :: Type -> Bool

-- | Like <a>isRhoTy</a>, but also says <a>True</a> for <a>Infer</a> types
isRhoExpTy :: ExpType -> Bool
isRhoTy :: TcType -> Bool
isSigmaTy :: TcType -> Bool

-- | Is the equality a ~r ...a.... definitely insoluble or not? a ~r Maybe
--   a -- Definitely insoluble a ~N ...(F a)... -- Not definitely insoluble
--   -- Perhaps (F a) reduces to Int a ~R ...(N a)... -- Not definitely
--   insoluble -- Perhaps newtype N a = MkN Int See Note [Occurs check
--   error] in TcCanonical for the motivation for this function.
isInsolubleOccursCheck :: EqRel -> TcTyVar -> TcType -> Bool
isImprovementPred :: PredType -> Bool
immSuperClasses :: Class -> [Type] -> [PredType]
transSuperClasses :: PredType -> [PredType]
mkMinimalBySCs :: (a -> PredType) -> [a] -> [a]
pickCapturedPreds :: TyVarSet -> TcThetaType -> TcThetaType
boxEqPred :: EqRel -> Type -> Type -> Maybe (Class, [Type])

-- | When inferring types, should we quantify over a given predicate?
--   Generally true of classes; generally false of equality constraints.
--   Equality constraints that mention quantified type variables and
--   implicit variables complicate the story. See Notes [Inheriting
--   implicit parameters] and [Quantifying over equality constraints]
pickQuantifiablePreds :: TyVarSet -> TcThetaType -> TcThetaType
evVarPred :: EvVar -> PredType
hasTyVarHead :: Type -> Bool
checkValidClsArgs :: Bool -> Class -> [KindOrType] -> Bool
isTyVarClassPred :: PredType -> Bool

-- | Like <tt>pickyEqTypeVis</tt>, but returns a Bool for convenience
pickyEqType :: TcType -> TcType -> Bool

-- | Like <a>tcEqType</a>, but returns True if the <i>visible</i> part of
--   the types are equal, even if they are really unequal (in the invisible
--   bits)
tcEqTypeVis :: TcType -> TcType -> Bool

-- | Just like <a>tcEqType</a>, but will return True for types of different
--   kinds as long as their non-coercion structure is identical.
tcEqTypeNoKindCheck :: TcType -> TcType -> Bool
tcEqType :: HasDebugCallStack => TcType -> TcType -> Bool
tcEqKind :: HasDebugCallStack => TcKind -> TcKind -> Bool
tcSplitMethodTy :: Type -> ([TyVar], PredType, Type)
tcSplitDFunHead :: Type -> (Class, [Type])
tcSplitDFunTy :: Type -> ([TyVar], [Type], Class, [Type])
tcIsTyVarTy :: Type -> Bool
tcGetTyVar :: String -> Type -> TyVar
tcGetTyVar_maybe :: Type -> Maybe TyVar

-- | If the type is a tyvar, possibly under a cast, returns it, along with
--   the coercion. Thus, the co is :: kind tv ~N kind type
tcGetCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN)

-- | Returns the number of arguments in the given type, without looking
--   through synonyms. This is used only for error reporting. We don't look
--   through synonyms because of #11313.
tcRepGetNumAppTys :: Type -> Arity
tcSplitAppTys :: Type -> (Type, [Type])
tcSplitAppTy :: Type -> (Type, Type)
tcSplitAppTy_maybe :: Type -> Maybe (Type, Type)

-- | Strips off n *visible* arguments and returns the resulting type
tcFunResultTyN :: HasDebugCallStack => Arity -> Type -> Type
tcFunResultTy :: Type -> Type
tcFunArgTy :: Type -> Type

-- | Split off exactly the specified number argument types Returns (Left m)
--   if there are <tt>m</tt> missing arrows in the type (Right (tys,res))
--   if the type looks like t1 -&gt; ... -&gt; tn -&gt; res
tcSplitFunTysN :: Arity -> TcRhoType -> Either Arity ([TcSigmaType], TcSigmaType)
tcSplitFunTy_maybe :: Type -> Maybe (Type, Type)
tcSplitFunTys :: Type -> ([Type], Type)
tcSplitTyConApp :: Type -> (TyCon, [Type])
tcTyConAppArgs :: Type -> [Type]

-- | Like <tt>tcRepSplitTyConApp_maybe</tt>, but only returns the
--   <a>TyCon</a>.
tcTyConAppTyCon_maybe :: Type -> Maybe TyCon
tcTyConAppTyCon :: Type -> TyCon
tcDeepSplitSigmaTy_maybe :: TcSigmaType -> Maybe ([TcType], [TyVar], ThetaType, TcSigmaType)

-- | Split a sigma type into its parts, going underneath as many
--   <tt>ForAllTy</tt>s as possible. For example, given this type synonym:
--   
--   <pre>
--   type Traversal s t a b = forall f. Applicative f =&gt; (a -&gt; f b) -&gt; s -&gt; f t
--   </pre>
--   
--   if you called <tt>tcSplitSigmaTy</tt> on this type:
--   
--   <pre>
--   forall s t a b. Each s t a b =&gt; Traversal s t a b
--   </pre>
--   
--   then it would return <tt>([s,t,a,b], [Each s t a b], Traversal s t a
--   b)</tt>. But if you instead called <tt>tcSplitNestedSigmaTys</tt> on
--   the type, it would return <tt>([s,t,a,b,f], [Each s t a b, Applicative
--   f], (a -&gt; f b) -&gt; s -&gt; f t)</tt>.
tcSplitNestedSigmaTys :: Type -> ([TyVar], ThetaType, Type)

-- | Split a sigma type into its parts.
tcSplitSigmaTy :: Type -> ([TyVar], ThetaType, Type)
tcSplitPhiTy :: Type -> (ThetaType, Type)
tcSplitPredFunTy_maybe :: Type -> Maybe (PredType, Type)

-- | Is this a ForAllTy with a named binder?
tcIsForAllTy :: Type -> Bool

-- | Like <a>tcSplitForAllTys</a>, but splits off only named binders.
tcSplitForAllVarBndrs :: Type -> ([TyVarBinder], Type)

-- | Like <a>tcSplitForAllTys</a>, but only splits a <a>ForAllTy</a> if
--   <tt><a>sameVis</a> argf supplied_argf</tt> is <a>True</a>, where
--   <tt>argf</tt> is the visibility of the <tt>ForAllTy</tt>'s binder and
--   <tt>supplied_argf</tt> is the visibility provided as an argument to
--   this function.
tcSplitForAllTysSameVis :: ArgFlag -> Type -> ([TyVar], Type)

-- | Like <a>tcSplitPiTys</a>, but splits off only named binders, returning
--   just the tycovars.
tcSplitForAllTys :: Type -> ([TyVar], Type)
tcSplitForAllTy_maybe :: Type -> Maybe (TyVarBinder, Type)

-- | Splits a type into a TyBinder and a body, if possible. Panics
--   otherwise
tcSplitPiTy_maybe :: Type -> Maybe (TyBinder, Type)

-- | Splits a forall type into a list of <a>TyBinder</a>s and the inner
--   type. Always succeeds, even if it returns an empty list.
tcSplitPiTys :: Type -> ([TyBinder], Type)
mkTcCastTy :: Type -> Coercion -> Type
mkTcAppTy :: Type -> Type -> Type
mkTcAppTys :: Type -> [Type] -> Type
getDFunTyKey :: Type -> OccName
mkPhiTy :: [PredType] -> Type -> Type

-- | Make a sigma ty where all type variables are "specified". That is,
--   they can be used with visible type application
mkSpecSigmaTy :: [TyVar] -> [PredType] -> Type -> Type

-- | Make a sigma ty where all type variables are <a>Inferred</a>. That is,
--   they cannot be used with visible type application.
mkInfSigmaTy :: [TyCoVar] -> [PredType] -> Type -> Type
mkSigmaTy :: [TyCoVarBinder] -> [PredType] -> Type -> Type
findDupTyVarTvs :: [(Name, TcTyVar)] -> [(Name, Name)]
mkTyVarNamePairs :: [TyVar] -> [(Name, TyVar)]
isRuntimeUnkSkol :: TyVar -> Bool
isIndirect :: MetaDetails -> Bool
isFlexi :: MetaDetails -> Bool
isTyVarTyVar :: Var -> Bool
setMetaTyVarTcLevel :: TcTyVar -> TcLevel -> TcTyVar
metaTyVarRef :: TyVar -> IORef MetaDetails
metaTyVarTcLevel_maybe :: TcTyVar -> Maybe TcLevel
metaTyVarTcLevel :: TcTyVar -> TcLevel
metaTyVarInfo :: TcTyVar -> MetaInfo
isMetaTyVarTy :: TcType -> Bool
isAmbiguousTyVar :: TcTyVar -> Bool
isMetaTyVar :: TcTyVar -> Bool
isOverlappableTyVar :: TcTyVar -> Bool
isSkolemTyVar :: TcTyVar -> Bool

-- | True of both given and wanted flatten-skolems (fmv and fsk)
isFlattenTyVar :: TcTyVar -> Bool
isFskTyVar :: TcTyVar -> Bool
isFmvTyVar :: TcTyVar -> Bool
isTyConableTyVar :: TcTyVar -> Bool
isImmutableTyVar :: TyVar -> Bool
isFloatedTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
isTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
tcIsTcTyVar :: TcTyVar -> Bool
anyRewritableTyVar :: Bool -> EqRel -> (EqRel -> TcTyVar -> Bool) -> TcType -> Bool

-- | Check that a type does not contain any type family applications.
isTyFamFree :: Type -> Bool

-- | In an application of a <a>TyCon</a> to some arguments, find the
--   outermost occurrences of type family applications within the
--   arguments. This function will not consider the <a>TyCon</a> itself
--   when checking for type family applications.
--   
--   See <a>tcTyFamInstsAndVis</a> for more details on how this works (as
--   this function is called inside of <a>tcTyFamInstsAndVis</a>).
tcTyConAppTyFamInstsAndVis :: TyCon -> [Type] -> [(Bool, TyCon, [Type])]

-- | Like <a>tcTyFamInsts</a>, except that the output records whether the
--   type family and its arguments occur as an <i>invisible</i> argument in
--   some type application. This information is useful because it helps GHC
--   know when to turn on <tt>-fprint-explicit-kinds</tt> during error
--   reporting so that users can actually see the type family being
--   mentioned.
--   
--   As an example, consider:
--   
--   <pre>
--   class C a
--   data T (a :: k)
--   type family F a :: k
--   instance C (T @(F Int) (F Bool))
--   </pre>
--   
--   There are two occurrences of the type family <tt>F</tt> in that
--   <tt>C</tt> instance, so <tt><a>tcTyFamInstsAndVis</a> (C (T @(F Int)
--   (F Bool)))</tt> will return:
--   
--   <pre>
--   [ (<a>True</a>,  F, [Int])
--   , (<a>False</a>, F, [Bool]) ]
--   </pre>
--   
--   <tt>F Int</tt> is paired with <a>True</a> since it appears as an
--   <i>invisible</i> argument to <tt>C</tt>, whereas <tt>F Bool</tt> is
--   paired with <a>False</a> since it appears an a <i>visible</i> argument
--   to <tt>C</tt>.
--   
--   See also <tt>Note [Kind arguments in error messages]</tt> in
--   <a>TcErrors</a>.
tcTyFamInstsAndVis :: Type -> [(Bool, TyCon, [Type])]

-- | Finds outermost type-family applications occurring in a type, after
--   expanding synonyms. In the list (F, tys) that is returned we guarantee
--   that tys matches F's arity. For example, given type family F a :: *
--   -&gt; * (arity 1) calling tcTyFamInsts on (Maybe (F Int Bool) will
--   return (F, [Int]), not (F, [Int,Bool])
--   
--   This is important for its use in deciding termination of type
--   instances (see #11581). E.g. type instance G [Int] = ...(F Int
--   <a>type</a>)... we don't need to take <a>type</a> into account when
--   asking if the calls on the RHS are smaller than the LHS
tcTyFamInsts :: Type -> [(TyCon, [Type])]
promoteSkolemsX :: TcLevel -> TCvSubst -> [TcTyVar] -> (TCvSubst, [TcTyVar])

-- | Change the TcLevel in a skolem, extending a substitution
promoteSkolemX :: TcLevel -> TCvSubst -> TcTyVar -> (TCvSubst, TcTyVar)
promoteSkolem :: TcLevel -> TcTyVar -> TcTyVar
tcTypeLevel :: TcType -> TcLevel
tcTyVarLevel :: TcTyVar -> TcLevel
sameDepthAs :: TcLevel -> TcLevel -> Bool
strictlyDeeperThan :: TcLevel -> TcLevel -> Bool
pushTcLevel :: TcLevel -> TcLevel
isTopTcLevel :: TcLevel -> Bool
topTcLevel :: TcLevel
maxTcLevel :: TcLevel -> TcLevel -> TcLevel
superSkolemTv :: TcTyVarDetails

-- | Like <tt>mkFunTys</tt> but for <a>SyntaxOpType</a>
mkSynFunTys :: [SyntaxOpType] -> ExpType -> SyntaxOpType

-- | Like <a>SynType</a> but accepts a regular TcType
synKnownType :: TcType -> SyntaxOpType

-- | Make an <a>ExpType</a> suitable for checking.
mkCheckExpType :: TcType -> ExpType
type TcCoVar = CoVar
type TcType = Type
type TcTyCoVar = Var
type TcTyVarBinder = TyVarBinder
type TcTyCon = TyCon
type TcPredType = PredType
type TcThetaType = ThetaType
type TcSigmaType = TcType
type TcRhoType = TcType
type TcTauType = TcType
type TcKind = Kind
type TcTyVarSet = TyVarSet
type TcTyCoVarSet = TyCoVarSet
type TcDTyVarSet = DTyVarSet
type TcDTyCoVarSet = DTyCoVarSet

-- | An expected type to check against during type-checking. See Note
--   [ExpType] in TcMType, where you'll also find manipulators.
data ExpType
Check :: TcType -> ExpType
Infer :: !InferResult -> ExpType
data InferResult
IR :: Unique -> TcLevel -> Bool -> IORef (Maybe TcType) -> InferResult
[ir_uniq] :: InferResult -> Unique
[ir_lvl] :: InferResult -> TcLevel
[ir_inst] :: InferResult -> Bool
[ir_ref] :: InferResult -> IORef (Maybe TcType)
type ExpSigmaType = ExpType
type ExpRhoType = ExpType

-- | What to expect for an argument to a rebindable-syntax operator. Quite
--   like <a>Type</a>, but allows for holes to be filled in by tcSyntaxOp.
--   The callback called from tcSyntaxOp gets a list of types; the meaning
--   of these types is determined by a left-to-right depth-first traversal
--   of the <a>SyntaxOpType</a> tree. So if you pass in
--   
--   <pre>
--   SynAny `SynFun` (SynList `SynFun` SynType Int) `SynFun` SynAny
--   </pre>
--   
--   you'll get three types back: one for the first <a>SynAny</a>, the
--   <i>element</i> type of the list, and one for the last <a>SynAny</a>.
--   You don't get anything for the <a>SynType</a>, because you've said
--   positively that it should be an Int, and so it shall be.
--   
--   This is defined here to avoid defining it in TcExpr.hs-boot.
data SyntaxOpType

-- | Any type
SynAny :: SyntaxOpType

-- | A rho type, deeply skolemised or instantiated as appropriate
SynRho :: SyntaxOpType

-- | A list type. You get back the element type of the list
SynList :: SyntaxOpType

-- | A function.
SynFun :: SyntaxOpType -> SyntaxOpType -> SyntaxOpType

-- | A known type.
SynType :: ExpType -> SyntaxOpType
infixr 0 `SynFun`
data MetaInfo
TauTv :: MetaInfo
TyVarTv :: MetaInfo
FlatMetaTv :: MetaInfo
FlatSkolTv :: MetaInfo
newtype TcLevel
TcLevel :: Int -> TcLevel
type TypeSize = IntWithInf
orphNamesOfCoCon :: forall (br :: BranchFlag). CoAxiom br -> NameSet
orphNamesOfCo :: Coercion -> NameSet
orphNamesOfTypes :: [Type] -> NameSet
orphNamesOfType :: Type -> NameSet

-- | Information we can use to dynamically link modules into the compiler
data Linkable
LM :: UTCTime -> Module -> [Unlinked] -> Linkable

-- | Time at which this linkable was built (i.e. when the bytecodes were
--   produced, or the mod date on the files)
[linkableTime] :: Linkable -> UTCTime

-- | The linkable module itself
[linkableModule] :: Linkable -> Module

-- | Those files and chunks of code we have yet to link.
--   
--   INVARIANT: A valid linkable always has at least one <a>Unlinked</a>
--   item. If this list is empty, the Linkable represents a fake linkable,
--   which is generated in HscNothing mode to avoid recompiling modules.
--   
--   ToDo: Do items get removed from this list when they get linked?
[linkableUnlinked] :: Linkable -> [Unlinked]

-- | Objects which have yet to be linked by the compiler
data Unlinked

-- | An object file (.o)
DotO :: FilePath -> Unlinked

-- | Static archive file (.a)
DotA :: FilePath -> Unlinked

-- | Dynamically linked library file (.so, .dll, .dylib)
DotDLL :: FilePath -> Unlinked

-- | A byte-code object, lives only in memory. Also carries some static
--   pointer table entries which should be loaded along with the BCOs. See
--   Note [Grant plan for static forms] in StaticPtrTable.
BCOs :: CompiledByteCode -> [SptEntry] -> Unlinked

-- | An entry to be inserted into a module's static pointer table. See Note
--   [Grand plan for static forms] in StaticPtrTable.
data SptEntry
SptEntry :: Id -> Fingerprint -> SptEntry

-- | Construct an empty ModBreaks
emptyModBreaks :: ModBreaks
data CompiledByteCode

-- | All the information about the breakpoints for a module
data ModBreaks
ModBreaks :: ForeignRef BreakArray -> !Array BreakIndex SrcSpan -> !Array BreakIndex [OccName] -> !Array BreakIndex [String] -> !Array BreakIndex (RemotePtr CostCentre) -> IntMap CgBreakInfo -> ModBreaks

-- | The array of flags, one per breakpoint, indicating which breakpoints
--   are enabled.
[modBreaks_flags] :: ModBreaks -> ForeignRef BreakArray

-- | An array giving the source span of each breakpoint.
[modBreaks_locs] :: ModBreaks -> !Array BreakIndex SrcSpan

-- | An array giving the names of the free variables at each breakpoint.
[modBreaks_vars] :: ModBreaks -> !Array BreakIndex [OccName]

-- | An array giving the names of the declarations enclosing each
--   breakpoint.
[modBreaks_decls] :: ModBreaks -> !Array BreakIndex [String]

-- | Array pointing to cost centre for each breakpoint
[modBreaks_ccs] :: ModBreaks -> !Array BreakIndex (RemotePtr CostCentre)

-- | info about each breakpoint from the bytecode generator
[modBreaks_breakInfo] :: ModBreaks -> IntMap CgBreakInfo
mkHsAppKindTy :: forall (p :: Pass). XAppKindTy (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
mkHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
extendNameCache :: OrigNameCache -> Module -> OccName -> Name -> OrigNameCache
lookupOrigNameCache :: OrigNameCache -> Module -> OccName -> Maybe Name
promotedNilDataCon :: TyCon
promotedConsDataCon :: TyCon
promotedGTDataCon :: TyCon
promotedEQDataCon :: TyCon
promotedLTDataCon :: TyCon
promotedJustDataCon :: TyCon
promotedNothingDataCon :: TyCon
promotedFalseDataCon :: TyCon
promotedTrueDataCon :: TyCon
mkSumTy :: [Type] -> Type

-- | Make a tuple type. The list of types should <i>not</i> include any
--   RuntimeRep specifications. Boxed 1-tuples are *not* flattened. See
--   Note [One-tuples] and Note [Don't flatten tuples from HsSyn] in MkCore
mkTupleTy1 :: Boxity -> [Type] -> Type

-- | Make a tuple type. The list of types should <i>not</i> include any
--   RuntimeRep specifications. Boxed 1-tuples are flattened. See Note
--   [One-tuples]
mkTupleTy :: Boxity -> [Type] -> Type
justDataCon :: DataCon
nothingDataCon :: DataCon
maybeTyCon :: TyCon
consDataCon :: DataCon
nilDataCon :: DataCon
mkListTy :: Type -> Type
ordGTDataConId :: Id
ordEQDataConId :: Id
ordLTDataConId :: Id
ordGTDataCon :: DataCon
ordEQDataCon :: DataCon
ordLTDataCon :: DataCon
orderingTyCon :: TyCon
trueDataConId :: Id
falseDataConId :: Id
trueDataCon :: DataCon
falseDataCon :: DataCon
boolTyCon :: TyCon
boolTy :: Type
doubleDataCon :: DataCon
doubleTyCon :: TyCon
doubleTy :: Type
floatDataCon :: DataCon
floatTyCon :: TyCon
floatTy :: Type
word8DataCon :: DataCon
word8TyCon :: TyCon
word8Ty :: Type
wordDataCon :: DataCon
wordTyCon :: TyCon
wordTy :: Type
intDataCon :: DataCon
intTyCon :: TyCon
intTy :: Type
stringTy :: Type
charDataCon :: DataCon
charTyCon :: TyCon
charTy :: Type
boxingDataCon_maybe :: TyCon -> Maybe DataCon
liftedRepTy :: Type
liftedRepDataCon :: DataCon
sumRepDataConTyCon :: TyCon
liftedTypeKindTyCon :: TyCon
coercibleDataCon :: DataCon
coercibleClass :: Class
heqDataCon :: DataCon
heqClass :: Class
eqDataCon :: DataCon
eqClass :: Class
eqTyCon :: TyCon

-- | Specialization of <a>unboxedTupleSumKind</a> for sums
unboxedSumKind :: [Type] -> Kind

-- | Data constructor for i-th alternative of a n-ary unboxed sum.
sumDataCon :: ConTag -> Arity -> DataCon

-- | Type constructor for n-ary unboxed sum.
sumTyCon :: Arity -> TyCon
unboxedUnitDataCon :: DataCon
unboxedUnitTyCon :: TyCon
pairTyCon :: TyCon
unitDataConId :: Id
unitDataCon :: DataCon
unitTyCon :: TyCon
tupleDataConName :: Boxity -> Arity -> Name
tupleDataCon :: Boxity -> Arity -> DataCon
promotedTupleDataCon :: Boxity -> Arity -> TyCon
tupleTyCon :: Boxity -> Arity -> TyCon
cTupleDataConNames :: [Name]
cTupleDataConName :: Arity -> Name

-- | If the given name is that of a constraint tuple, return its arity.
--   Note that this is inefficient.
cTupleTyConNameArity_maybe :: Name -> Maybe Arity
isCTupleTyConName :: Name -> Bool
cTupleTyConNames :: [Name]
cTupleTyConName :: Arity -> Name
mkTupleStr :: Boxity -> Arity -> String

-- | 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
typeToTypeKind :: Kind
constraintKindTyCon :: TyCon
typeSymbolKindCon :: TyCon
typeNatKindCon :: TyCon
consDataCon_RDR :: RdrName
listTyCon_RDR :: RdrName
intDataCon_RDR :: RdrName
charTyCon_RDR :: RdrName
intTyCon_RDR :: RdrName
true_RDR :: RdrName
false_RDR :: RdrName
boolTyCon_RDR :: RdrName
liftedTypeKindTyConName :: Name
constraintKindTyConName :: Name

-- | Make a fake, recovery <a>TyCon</a> from an existing one. Used when
--   recovering from errors in type declarations
makeRecoveryTyCon :: TyCon -> TyCon
anyTy :: Type
anyTyCon :: TyCon
doubleTyConName :: Name
floatTyConName :: Name
word8TyConName :: Name
wordTyConName :: Name
justDataConName :: Name
nothingDataConName :: Name
maybeTyConName :: Name
consDataConName :: Name
nilDataConName :: Name
listTyConName :: Name
boolTyConName :: Name
intTyConName :: Name
charTyConName :: Name
coercibleTyConName :: Name
heqTyConName :: Name
eqTyCon_RDR :: RdrName
eqTyConName :: Name
mkWiredInIdName :: Module -> FastString -> Unique -> Id -> Name
mkWiredInTyConName :: BuiltInSyntax -> Module -> FastString -> Unique -> TyCon -> Name
wiredInTyCons :: [TyCon]
isNeverLevPolyId :: Id -> Bool
transferPolyIdInfo :: Id -> [Var] -> Id -> Id
zapStableUnfolding :: Id -> Id
zapIdTailCallInfo :: Id -> Id
zapIdUsedOnceInfo :: Id -> Id
zapIdUsageEnvInfo :: Id -> Id
zapIdUsageInfo :: Id -> Id
zapIdDemandInfo :: Id -> Id
zapFragileIdInfo :: Id -> Id
zapLamIdInfo :: Id -> Id
updOneShotInfo :: Id -> OneShotInfo -> Id
setIdOneShotInfo :: Id -> OneShotInfo -> Id
infixl 1 `setIdOneShotInfo`
clearOneShotLambda :: Id -> Id
setOneShotLambda :: Id -> Id
isProbablyOneShotLambda :: Id -> Bool
isStateHackType :: Type -> Bool
typeOneShot :: Type -> OneShotInfo

-- | Should we apply the state hack to values of this <a>Type</a>?
stateHackOneShot :: OneShotInfo

-- | Returns whether the lambda associated with the <a>Id</a> is certainly
--   applied at most once This one is the "business end", called
--   externally. It works on type variables as well as Ids, returning True
--   Its main purpose is to encapsulate the Horrible State Hack See Note
--   [The state-transformer hack] in CoreArity
isOneShotBndr :: Var -> Bool

-- | Like <a>idOneShotInfo</a>, but taking the Horrible State Hack in to
--   account See Note [The state-transformer hack] in CoreArity
idStateHackOneShotInfo :: Id -> OneShotInfo
idOneShotInfo :: Id -> OneShotInfo
isConLikeId :: Id -> Bool
idRuleMatchInfo :: Id -> RuleMatchInfo
setInlineActivation :: Id -> Activation -> Id
infixl 1 `setInlineActivation`
idInlineActivation :: Id -> Activation
modifyInlinePragma :: Id -> (InlinePragma -> InlinePragma) -> Id
setInlinePragma :: Id -> InlinePragma -> Id
infixl 1 `setInlinePragma`
idInlinePragma :: Id -> InlinePragma
zapIdOccInfo :: Id -> Id
setIdOccInfo :: Id -> OccInfo -> Id
infixl 1 `setIdOccInfo`
idOccInfo :: Id -> OccInfo
setIdCafInfo :: Id -> CafInfo -> Id
idCafInfo :: Id -> CafInfo
infixl 1 `idCafInfo`
setIdSpecialisation :: Id -> RuleInfo -> Id
infixl 1 `setIdSpecialisation`
idHasRules :: Id -> Bool
idCoreRules :: Id -> [CoreRule]
idSpecialisation :: Id -> RuleInfo
setCaseBndrEvald :: StrictnessMark -> Id -> Id
setIdDemandInfo :: Id -> Demand -> Id
infixl 1 `setIdDemandInfo`
idDemandInfo :: Id -> Demand
setIdUnfolding :: Id -> Unfolding -> Id
infixl 1 `setIdUnfolding`
realIdUnfolding :: Id -> Unfolding
idUnfolding :: Id -> Unfolding

-- | This predicate says whether the <a>Id</a> has a strict demand placed
--   on it or has a type such that it can always be evaluated strictly (i.e
--   an unlifted type, as of GHC 7.6). We need to check separately whether
--   the <a>Id</a> has a so-called "strict type" because if the demand for
--   the given <tt>id</tt> hasn't been computed yet but <tt>id</tt> has a
--   strict type, we still want <tt>isStrictId id</tt> to be <tt>True</tt>.
isStrictId :: Id -> Bool
zapIdStrictness :: Id -> Id
setIdStrictness :: Id -> StrictSig -> Id
infixl 1 `setIdStrictness`

-- | Accesses the <tt>Id'</tt>s <a>strictnessInfo</a>.
idStrictness :: Id -> StrictSig

-- | Returns true if an application to n args would diverge
isBottomingId :: Var -> Bool
idFunRepArity :: Id -> RepArity
setIdCallArity :: Id -> Arity -> Id
infixl 1 `setIdCallArity`
idCallArity :: Id -> Arity
setIdArity :: Id -> Arity -> Id
infixl 1 `setIdArity`
idArity :: Id -> Arity
asJoinId_maybe :: Id -> Maybe JoinArity -> Id
infixl 1 `asJoinId_maybe`
zapJoinId :: Id -> Id
asJoinId :: Id -> JoinArity -> JoinId
infixl 1 `asJoinId`
idJoinArity :: JoinId -> JoinArity
isDeadBinder :: Id -> Bool
idIsFrom :: Module -> Id -> Bool

-- | <a>isImplicitId</a> tells whether an <a>Id</a>s info is implied by
--   other declarations, so we don't need to put its signature in an
--   interface file, even if it's mentioned in some other interface
--   unfolding.
isImplicitId :: Id -> Bool

-- | Returns <tt>True</tt> of an <a>Id</a> which may not have a binding,
--   even though it is defined in this module.
hasNoBinding :: Id -> Bool

-- | Get from either the worker or the wrapper <a>Id</a> to the
--   <a>DataCon</a>. Currently used only in the desugarer.
--   
--   INVARIANT: <tt>idDataCon (dataConWrapId d) = d</tt>: remember,
--   <a>dataConWrapId</a> can return either the wrapper or the worker
idDataCon :: Id -> DataCon
isJoinId_maybe :: Var -> Maybe JoinArity
isJoinId :: Var -> Bool
isDataConId_maybe :: Id -> Maybe DataCon
isDataConWrapId_maybe :: Id -> Maybe DataCon
isDataConWrapId :: Id -> Bool
isDataConWorkId_maybe :: Id -> Maybe DataCon
isDataConWorkId :: Id -> Bool
isFCallId_maybe :: Id -> Maybe ForeignCall
isFCallId :: Id -> Bool
isPrimOpId_maybe :: Id -> Maybe PrimOp
isDFunId :: Id -> Bool
isPrimOpId :: Id -> Bool
isClassOpId_maybe :: Id -> Maybe Class
isNaughtyRecordSelector :: Id -> Bool
isPatSynRecordSelector :: Id -> Bool
isDataConRecordSelector :: Id -> Bool
isRecordSelector :: Id -> Bool

-- | If the <a>Id</a> is that for a record selector, extract the
--   <a>sel_tycon</a>. Panic otherwise.
recordSelectorTyCon :: Id -> RecSelParent

-- | Create a template local for a series of type, but start from a
--   specified template local
mkTemplateLocalsNum :: Int -> [Type] -> [Id]

-- | Create a template local for a series of types
mkTemplateLocals :: [Type] -> [Id]

-- | Create a <i>template local</i>: a family of system local <a>Id</a>s in
--   bijection with <tt>Int</tt>s, typically used in unfoldings
mkTemplateLocal :: Int -> Type -> Id

-- | Workers get local names. <a>CoreTidy</a> will externalise these if
--   necessary
mkWorkerId :: Unique -> Id -> Type -> Id

-- | Like <a>mkUserLocal</a>, but checks if we have a coercion type
mkUserLocalOrCoVar :: OccName -> Unique -> Type -> SrcSpan -> Id

-- | Create a user local <a>Id</a>. These are local <a>Id</a>s (see
--   <a>Var#globalvslocal</a>) with a name and location that the user might
--   recognize
mkUserLocal :: OccName -> Unique -> Type -> SrcSpan -> Id
mkSysLocalOrCoVarM :: MonadUnique m => FastString -> Type -> m Id
mkSysLocalM :: MonadUnique m => FastString -> Type -> m Id

-- | Like <a>mkSysLocal</a>, but checks to see if we have a covar type
mkSysLocalOrCoVar :: FastString -> Unique -> Type -> Id

-- | Create a system local <a>Id</a>. These are local <a>Id</a>s (see
--   <a>Var#globalvslocal</a>) that are created by the compiler out of thin
--   air
mkSysLocal :: FastString -> Unique -> Type -> Id
mkExportedVanillaId :: Name -> Type -> Id

-- | Create a local <a>Id</a> that is marked as exported. This prevents
--   things attached to it from being removed as dead code. See Note
--   [Exported LocalIds]
mkExportedLocalId :: IdDetails -> Name -> Type -> Id
mkLocalIdWithInfo :: Name -> Type -> IdInfo -> Id

-- | Make a local id, with the IdDetails set to CoVarId if the type
--   indicates so.
mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id

-- | Like <a>mkLocalId</a>, but checks the type to see if it should make a
--   covar
mkLocalIdOrCoVar :: Name -> Type -> Id

-- | Make a local CoVar
mkLocalCoVar :: Name -> Type -> CoVar

-- | For an explanation of global vs. local <a>Id</a>s, see
--   <a>Var#globalvslocal</a>
mkLocalId :: Name -> Type -> Id

-- | Make a global <a>Id</a> with no global information but some generic
--   <a>IdInfo</a>
mkVanillaGlobalWithInfo :: Name -> Type -> IdInfo -> Id

-- | Make a global <a>Id</a> without any extra information at all
mkVanillaGlobal :: Name -> Type -> Id

-- | For an explanation of global vs. local <a>Id</a>s, see
--   <a>Var#globalvslocal</a>
mkGlobalId :: IdDetails -> Name -> Type -> IdInfo -> Id
maybeModifyIdInfo :: Maybe IdInfo -> Id -> Id
modifyIdInfo :: HasDebugCallStack => (IdInfo -> IdInfo) -> Id -> Id
setIdInfo :: Id -> IdInfo -> Id
lazySetIdInfo :: Id -> IdInfo -> Id
localiseId :: Id -> Id
setIdNotExported :: Id -> Id
setIdExported :: Id -> Id

-- | Not only does this set the <a>Id</a> <a>Type</a>, it also evaluates
--   the type to try and reduce space usage
setIdType :: Id -> Type -> Id
setIdUnique :: Id -> Unique -> Id
setIdName :: Id -> Name -> Id
idType :: Id -> Kind
idUnique :: Id -> Unique
idName :: Id -> Name
hasIPPred :: PredType -> Bool
isIPPred :: PredType -> Bool
isEqPrimPred :: PredType -> Bool
isEqPred :: PredType -> Bool
isClassPred :: PredType -> Bool
isEqPredClass :: Class -> Bool
mkClassPred :: Class -> [Type] -> PredType
instanceCantMatch :: [Maybe Name] -> [Maybe Name] -> Bool
roughMatchTcs :: [Type] -> [Maybe Name]

-- | <tt><a>hsOverLitNeedsParens</a> p ol</tt> returns <a>True</a> if an
--   overloaded literal <tt>ol</tt> needs to be parenthesized under
--   precedence <tt>p</tt>.
hsOverLitNeedsParens :: PprPrec -> HsOverLit x -> Bool

-- | <tt><a>hsLitNeedsParens</a> p l</tt> returns <a>True</a> if a literal
--   <tt>l</tt> needs to be parenthesized under precedence <tt>p</tt>.
hsLitNeedsParens :: PprPrec -> HsLit x -> Bool

-- | 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
pp_st_suffix :: SourceText -> SDoc -> SDoc -> SDoc

-- | Convert a literal from one index type to another, updating the
--   annotations according to the relevant <a>Convertable</a> instance
convertLit :: ConvertIdX a b => HsLit a -> HsLit b
overLitType :: HsOverLit GhcTc -> Type
negateOverLitVal :: OverLitVal -> OverLitVal

-- | 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 <tt>TcGenDeriv</tt>, and from
--   TRANSLATION
HsInt :: XHsInt x -> IntegralLit -> HsLit x

-- | literal <tt>Int#</tt>
HsIntPrim :: XHsIntPrim x -> Integer -> HsLit x

-- | literal <tt>Word#</tt>
HsWordPrim :: XHsWordPrim x -> Integer -> HsLit x

-- | literal <tt>Int64#</tt>
HsInt64Prim :: XHsInt64Prim x -> Integer -> HsLit x

-- | literal <tt>Word64#</tt>
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

-- | 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
data OverLitTc
OverLitTc :: Bool -> Type -> OverLitTc
[ol_rebindable] :: OverLitTc -> Bool
[ol_type] :: OverLitTc -> Type

-- | Overloaded Literal Value
data OverLitVal

-- | Integer-looking literals;
HsIntegral :: !IntegralLit -> OverLitVal

-- | Frac-looking literals
HsFractional :: !FractionalLit -> OverLitVal

-- | String-looking literals
HsIsString :: !SourceText -> !FastString -> OverLitVal

-- | Does a <a>TyCon</a> (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 <tt>Note [When does a tycon
--   application need an explicit kind signature?]</tt> for a full
--   explanation of what this function checks for.)
tyConAppNeedsKindSig :: Bool -> TyCon -> Int -> Bool

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

-- | Tests whether the given kind (which should look like <tt>TYPE x</tt>)
--   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
isConstraintKindCon :: TyCon -> Bool
setJoinResTy :: Int -> Type -> Type -> Type
modifyJoinResTy :: Int -> (Type -> Type) -> Type -> Type
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

-- | Find the result <a>Kind</a> of a type synonym, after applying it to
--   its <tt>arity</tt> number of type variables Actually this function
--   works fine on data types too, but they'd always return <a>*</a>, so we
--   never need to ask
synTyConResKind :: TyCon -> Kind

-- | 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
occCheckExpand :: [Var] -> Type -> Maybe Type

-- | Looking past all pi-types, is the end result potentially levity
--   polymorphic? Example: True for (forall r (a :: TYPE r). String -&gt;
--   a) Example: False for (forall r1 r2 (a :: TYPE r1) (b :: TYPE r2). a
--   -&gt; b -&gt; Type)
resultIsLevPoly :: 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
tcReturnsConstraintKind :: Kind -> Bool

-- | Is this kind equivalent to <tt>TYPE r</tt> (for some unknown r)?
--   
--   This considers <tt>Constraint</tt> to be distinct from <tt>*</tt>.
tcIsRuntimeTypeKind :: Kind -> Bool

-- | Is this kind equivalent to <tt>*</tt>?
--   
--   This considers <tt>Constraint</tt> to be distinct from <tt>*</tt>. For
--   a version that treats them as the same type, see
--   <a>isLiftedTypeKind</a>.
tcIsLiftedTypeKind :: Kind -> Bool
tcIsConstraintKind :: Kind -> Bool
tcTypeKind :: HasDebugCallStack => Type -> Kind
typeKind :: HasDebugCallStack => Type -> Kind

-- | Compare two <a>TyCon</a>s. NB: This should <i>never</i> see
--   <tt>Constraint</tt> (as recognized by Kind.isConstraintKindCon) which
--   is considered a synonym for <a>Type</a> in Core. See Note [Kind
--   Constraint and kind Type] in Kind. See Note [nonDetCmpType
--   nondeterminism]
nonDetCmpTc :: TyCon -> TyCon -> Ordering
nonDetCmpTypesX :: RnEnv2 -> [Type] -> [Type] -> Ordering
nonDetCmpTypeX :: RnEnv2 -> Type -> Type -> Ordering
nonDetCmpTypes :: [Type] -> [Type] -> Ordering
nonDetCmpType :: Type -> Type -> Ordering
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 <a>RnEnv2</a>.
eqTypeX :: RnEnv2 -> Type -> Type -> Bool
seqTypes :: [Type] -> ()
seqType :: 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 <tt>a </tt>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 CoreSyn.) 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 -&gt; Int
--   then j could be a binary join point returning an Int, but it could
--   *not* be a unary join point returning a -&gt; Int.
--   
--   TODO: See Note [Excess polymorphism and join points]
isValidJoinPointType :: JoinArity -> Type -> Bool

-- | Returns true of types that are opaque to Haskell.
isPrimitiveType :: 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 <a>isUnliftedType</a>. Panics on levity-polymorphic types.
isStrictType :: HasDebugCallStack => Type -> Bool

-- | Check whether a type is a data family type
isDataFamilyAppType :: Type -> Bool

-- | See <a>Type#type_classification</a> for what an algebraic type is.
--   Should only be applied to <i>types</i>, as opposed to e.g. partially
--   saturated type constructors
isAlgType :: Type -> Bool
isUnboxedSumType :: Type -> Bool
isUnboxedTupleType :: Type -> Bool

-- | Extract the RuntimeRep classifier of a type. For instance,
--   <tt>getRuntimeRep_maybe Int = LiftedRep</tt>. Panics if this is not
--   possible.
getRuntimeRep :: HasDebugCallStack => Type -> Type

-- | Extract the RuntimeRep classifier of a type. For instance,
--   <tt>getRuntimeRep_maybe Int = LiftedRep</tt>. Returns <a>Nothing</a>
--   if this is not possible.
getRuntimeRep_maybe :: HasDebugCallStack => Type -> Maybe Type

-- | Drops prefix of RuntimeRep constructors in <a>TyConApp</a>s. Useful
--   for e.g. dropping 'LiftedRep arguments of unboxed tuple TyCon
--   applications:
--   
--   dropRuntimeRepArgs [ 'LiftedRep, 'IntRep , String, Int# ] == [String,
--   Int#]
dropRuntimeRepArgs :: [Type] -> [Type]

-- | Is this a type of kind RuntimeRep? (e.g. LiftedRep)
isRuntimeRepKindedTy :: Type -> Bool

-- | Returns:
--   
--   <ul>
--   <li><a>False</a> if the type is <i>guaranteed</i> lifted or</li>
--   <li><a>True</a> if it is unlifted, OR we aren't sure (e.g. in a
--   levity-polymorphic case)</li>
--   </ul>
mightBeUnliftedType :: Type -> Bool

-- | See <a>Type#type_classification</a> for what an unlifted type is.
--   Panics on levity polymorphic types; See <a>mightBeUnliftedType</a> for
--   a more approximate predicate that behaves better in the presence of
--   levity polymorphism.
isUnliftedType :: HasDebugCallStack => 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

-- | 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 TyCoRep
isCoVarType :: Type -> Bool
isFamFreeTy :: Type -> Bool

-- | Get the type on the LHS of a coercion induced by a type/data family
--   instance.
coAxNthLHS :: forall (br :: BranchFlag). CoAxiom br -> Int -> Type

-- | Given a family instance TyCon and its arg types, return the
--   corresponding family type. E.g:
--   
--   <pre>
--   data family T a
--   data instance T (Maybe b) = MkT b
--   </pre>
--   
--   Where the instance tycon is :RTL, so:
--   
--   <pre>
--   mkFamilyTyConApp :RTL Int  =  T (Maybe Int)
--   </pre>
mkFamilyTyConApp :: TyCon -> [Type] -> Type

-- | Add the kind variables free in the kinds of the tyvars in the given
--   set. Returns a deterministic set.
closeOverKindsDSet :: DTyVarSet -> DTyVarSet

-- | Add the kind variables free in the kinds of the tyvars in the given
--   set. Returns a deterministically ordered list.
closeOverKindsList :: [TyVar] -> [TyVar]

-- | Given a list of tyvars returns a deterministic FV computation that
--   returns the given tyvars with the kind variables free in the kinds of
--   the given tyvars.
closeOverKindsFV :: [TyVar] -> FV

-- | Add the kind variables free in the kinds of the tyvars in the given
--   set. Returns a non-deterministic set.
closeOverKinds :: TyVarSet -> TyVarSet

-- | Extract a relevant type, if there is one.
binderRelevantType_maybe :: TyCoBinder -> Maybe Type
tyBinderType :: TyBinder -> Type
tyCoBinderType :: TyCoBinder -> Type
tyCoBinderVar_maybe :: TyCoBinder -> Maybe TyCoVar

-- | Does this binder bind a variable that is <i>not</i> erased? Returns
--   <a>True</a> for anonymous binders.
isAnonTyCoBinder :: TyCoBinder -> Bool

-- | Make an anonymous binder
mkAnonBinder :: AnonArgFlag -> Type -> TyCoBinder
isTauTy :: Type -> Bool

-- | Given a <a>Type</a> and a list of argument types to which the
--   <a>Type</a> is applied, determine each argument's visibility
--   (<a>Inferred</a>, <a>Specified</a>, or <a>Required</a>).
--   
--   Most of the time, the arguments will be <a>Required</a>, but not
--   always. Consider <tt>f :: forall a. a -&gt; Type</tt>. In <tt>f Type
--   Bool</tt>, the first argument (<tt>Type</tt>) is <a>Specified</a> and
--   the second argument (<tt>Bool</tt>) is <a>Required</a>. It is
--   precisely this sort of higher-rank situation in which
--   <a>appTyArgFlags</a> comes in handy, since <tt>f Type Bool</tt> would
--   be represented in Core using <a>AppTy</a>s. (See also #15792).
appTyArgFlags :: Type -> [Type] -> [ArgFlag]

-- | Given a <a>TyCon</a> and a list of argument types to which the
--   <a>TyCon</a> is applied, determine each argument's visibility
--   (<a>Inferred</a>, <a>Specified</a>, or <a>Required</a>).
--   
--   Wrinkle: consider the following scenario:
--   
--   <pre>
--   T :: forall k. k -&gt; k
--   tyConArgFlags T [forall m. m -&gt; m -&gt; m, S, R, Q]
--   </pre>
--   
--   After substituting, we get
--   
--   <pre>
--   T (forall m. m -&gt; m -&gt; m) :: (forall m. m -&gt; m -&gt; m) -&gt; forall n. n -&gt; n -&gt; n
--   </pre>
--   
--   Thus, the first argument is invisible, <tt>S</tt> is visible,
--   <tt>R</tt> is invisible again, and <tt>Q</tt> is visible.
tyConArgFlags :: TyCon -> [Type] -> [ArgFlag]

-- | Given a list of things paired with their visibilities, partition the
--   things into (invisible things, visible things).
partitionInvisibles :: [(a, ArgFlag)] -> ([a], [a])

-- | Given a <a>TyCon</a> and a list of argument types, filter out any
--   <a>Inferred</a> arguments.
filterOutInferredTypes :: TyCon -> [Type] -> [Type]

-- | Given a <a>TyCon</a> and a list of argument types, filter out any
--   invisible (i.e., <a>Inferred</a> or <a>Specified</a>) arguments.
filterOutInvisibleTypes :: TyCon -> [Type] -> [Type]
splitPiTysInvisibleN :: Int -> Type -> ([TyCoBinder], Type)
splitPiTysInvisible :: Type -> ([TyCoBinder], Type)
invisibleTyBndrCount :: Type -> Int

-- | Like <a>splitPiTys</a> but split off only <i>named</i> binders and
--   returns TyCoVarBinders rather than TyCoBinders
splitForAllVarBndrs :: Type -> ([TyCoVarBinder], Type)

-- | Split off all TyCoBinders to a type, splitting both proper foralls and
--   functions
splitPiTys :: Type -> ([TyCoBinder], Type)

-- | Takes a forall type apart, or panics
splitPiTy :: Type -> (TyCoBinder, Type)

-- | Attempts to take a forall type apart; works with proper foralls and
--   functions
splitPiTy_maybe :: Type -> Maybe (TyCoBinder, Type)

-- | Like splitForAllTy_maybe, but only returns Just if it is a covar
--   binder.
splitForAllTy_co_maybe :: Type -> Maybe (TyCoVar, Type)

-- | Like splitForAllTy_maybe, but only returns Just if it is a tyvar
--   binder.
splitForAllTy_ty_maybe :: Type -> Maybe (TyCoVar, Type)

-- | Attempts to take a forall type apart, but only if it's a proper
--   forall, with a named binder
splitForAllTy_maybe :: Type -> Maybe (TyCoVar, Type)

-- | Drops all ForAllTys
dropForAlls :: Type -> Type

-- | Take a forall type apart, or panics if that is not possible.
splitForAllTy :: Type -> (TyCoVar, Type)

-- | Is this a function?
isFunTy :: Type -> Bool

-- | Is this a function or forall?
isPiTy :: Type -> Bool

-- | Like <a>isForAllTy</a>, but returns True only if it is a covar binder
isForAllTy_co :: Type -> Bool

-- | Like <a>isForAllTy</a>, but returns True only if it is a tyvar binder
isForAllTy_ty :: Type -> Bool

-- | Checks whether this is a proper forall (with a named binder)
isForAllTy :: Type -> Bool

-- | Like <a>splitForAllTys</a>, but only splits a <a>ForAllTy</a> if
--   <tt><a>sameVis</a> argf supplied_argf</tt> is <a>True</a>, where
--   <tt>argf</tt> is the visibility of the <tt>ForAllTy</tt>'s binder and
--   <tt>supplied_argf</tt> is the visibility provided as an argument to
--   this function.
splitForAllTysSameVis :: ArgFlag -> Type -> ([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.
splitForAllTys :: Type -> ([TyCoVar], 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
--   <a>(k:*),(b:k),(c:k)</a> We want (k:*) Named, (b:k) Anon, (c:k) Anon
--   
--   All non-coercion binders are <i>visible</i>.
mkTyConBindersPreferAnon :: [TyVar] -> TyCoVarSet -> [TyConBinder]

-- | <a>mkLamType</a> for multiple type or value arguments
mkLamTypes :: [Var] -> Type -> Type

-- | Makes a <tt>(-&gt;)</tt> type or an implicit forall type, depending on
--   whether it is given a type variable or a term variable. This is used,
--   for example, when producing the type of a lambda. Always uses Inferred
--   binders.
mkLamType :: Var -> Type -> Type

-- | Like mkForAllTys, but assumes all variables are dependent and visible
mkVisForAllTys :: [TyVar] -> Type -> Type

-- | Like <a>mkForAllTys</a>, but assumes all variables are dependent and
--   <a>Specified</a>, a common case
mkSpecForAllTys :: [TyVar] -> Type -> Type

-- | Like <a>mkForAllTy</a>, but assumes the variable is dependent and
--   <a>Specified</a>, a common case
mkSpecForAllTy :: TyVar -> Type -> Type

-- | Like <a>mkTyCoInvForAllTys</a>, but tvs should be a list of tyvar
mkInvForAllTys :: [TyVar] -> Type -> Type

-- | Like <a>mkForAllTys</a>, but assumes all variables are dependent and
--   <a>Inferred</a>, a common case
mkTyCoInvForAllTys :: [TyCoVar] -> Type -> Type

-- | Like <a>mkTyCoInvForAllTy</a>, but tv should be a tyvar
mkInvForAllTy :: TyVar -> Type -> Type

-- | Make a dependent forall over an <a>Inferred</a> variable
mkTyCoInvForAllTy :: TyCoVar -> Type -> Type
stripCoercionTy :: Type -> Coercion
isCoercionTy_maybe :: Type -> Maybe Coercion
mkCoercionTy :: Coercion -> Type

-- | Drop the cast on a type, if any. If there is no cast, just return the
--   original type. This is rarely what you want. The CastTy data
--   constructor (in TyCoRep) has the invariant that another CastTy is not
--   inside. See the data constructor for a full description of this
--   invariant. Since CastTy cannot be nested, the result of discardCast
--   cannot be a CastTy.
discardCast :: Type -> Type
tyConBindersTyCoBinders :: [TyConBinder] -> [TyCoBinder]
splitCastTy_maybe :: Type -> Maybe (Type, Coercion)

-- | Unwrap one <tt>layer</tt> of newtype on a type constructor and its
--   arguments, using an eta-reduced version of the <tt>newtype</tt> if
--   possible. This requires tys to have at least <tt>newTyConInstArity
--   tycon</tt> elements.
newTyConInstRhs :: TyCon -> [Type] -> Type
nextRole :: Type -> Role

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

-- | Like <a>splitTyConApp_maybe</a>, 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 [FunTy and decomposing tycon
--   applications] in TcCanonical
repSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])

-- | Split a type constructor application into its type constructor and
--   applied types. Note that this may fail in the case of a <a>FunTy</a>
--   with an argument of unknown kind <a>FunTy</a> (e.g. <tt>FunTy (a :: k)
--   Int</tt>. since the kind of <tt>a</tt> isn't of the form <tt>TYPE
--   rep</tt>). Consequently, you may need to zonk your type before using
--   this function.
--   
--   If you only need the <a>TyCon</a>, consider using
--   <tt>tcTyConAppTyCon_maybe</tt>.
tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type])

-- | 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 <a>splitTyConApp_maybe</a>
splitTyConApp :: Type -> (TyCon, [Type])
tyConAppArgN :: Int -> Type -> Type
tyConAppArgs :: Type -> [Type]

-- | The same as <tt>snd . splitTyConApp</tt>
tyConAppArgs_maybe :: Type -> Maybe [Type]
tyConAppTyCon :: Type -> TyCon

-- | The same as <tt>fst . splitTyConApp</tt>
tyConAppTyCon_maybe :: Type -> Maybe TyCon

-- | Retrieve the tycon heading this type, if there is one. Does <i>not</i>
--   look through synonyms.
tyConAppTyConPicky_maybe :: Type -> Maybe TyCon

-- | A key function: builds a <a>TyConApp</a> or <a>FunTy</a> as
--   appropriate to its arguments. Applies its arguments to the constructor
--   from left to right.
mkTyConApp :: TyCon -> [Type] -> Type
applyTysX :: [TyVar] -> Type -> [Type] -> Type

-- | (piResultTys f_ty [ty1, .., tyn]) gives the type of (f ty1 .. tyn)
--   where f :: f_ty <a>piResultTys</a> is interesting because: 1.
--   <tt>f_ty</tt> 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 <tt>(forall b. b-&gt;b)
--   </tt>Int This term should have type (Int -&gt; Int), but notice that
--   there are more type args than foralls in <a>undefined</a>s type.
piResultTys :: HasDebugCallStack => Type -> [Type] -> Type

-- | Just like <a>piResultTys</a> but for a single argument Try not to
--   iterate <a>piResultTy</a>, 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

-- | Extract the function result type and panic if that is not possible
funResultTy :: Type -> Type
splitFunTys :: Type -> ([Type], Type)

-- | Attempts to extract the argument and result types from a type
splitFunTy_maybe :: Type -> Maybe (Type, Type)

-- | Attempts to extract the argument and result types from a type, and
--   panics if that is not possible. See also <a>splitFunTy_maybe</a>
splitFunTy :: Type -> (Type, Type)

-- | Render a type corresponding to a user type error into a SDoc.
pprUserTypeErrorTy :: Type -> SDoc

-- | Is this type a custom user error? If so, give us the kind and the
--   error message.
userTypeError_maybe :: Type -> Maybe Type

-- | Is this a type literal (symbol or numeric).
isLitTy :: Type -> Maybe TyLit

-- | Is this a symbol literal. We also look through type synonyms.
isStrLitTy :: Type -> Maybe FastString
mkStrLitTy :: FastString -> Type

-- | Is this a numeric literal. We also look through type synonyms.
isNumLitTy :: Type -> Maybe Integer
mkNumLitTy :: Integer -> Type

-- | Like <a>splitAppTys</a>, but doesn't look through type synonyms
repSplitAppTys :: HasDebugCallStack => Type -> (Type, [Type])

-- | 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])

-- | Attempts to take a type application apart, as in
--   <a>splitAppTy_maybe</a>, and panics if this is not possible
splitAppTy :: Type -> (Type, Type)

-- | Does the AppTy split as in <tt>tcSplitAppTy_maybe</tt>, but assumes
--   that any coreView stuff is already done. Refuses to look through (c
--   =&gt; t)
tcRepSplitAppTy_maybe :: Type -> Maybe (Type, Type)

-- | Does the AppTy split as in <a>splitAppTy_maybe</a>, but assumes that
--   any Core view stuff is already done
repSplitAppTy_maybe :: HasDebugCallStack => Type -> Maybe (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)
mkAppTys :: Type -> [Type] -> Type

-- | Attempts to obtain the type variable underlying a <a>Type</a>, without
--   any expansion
repGetTyVar_maybe :: Type -> Maybe TyVar

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

-- | Attempts to obtain the type variable underlying a <a>Type</a>
getTyVar_maybe :: Type -> Maybe TyVar
isTyVarTy :: Type -> Bool

-- | Attempts to obtain the type variable underlying a <a>Type</a>, and
--   panics with the given message if this is not a type variable type. See
--   also <a>getTyVar_maybe</a>
getTyVar :: String -> Type -> TyVar
mapCoercion :: Monad m => TyCoMapper env m -> env -> Coercion -> m Coercion
mapType :: Monad m => TyCoMapper env m -> env -> Type -> m Type

-- | Is a tyvar of type <a>RuntimeRep</a>?
isRuntimeRepVar :: TyVar -> Bool
isUnliftedRuntimeRep :: Type -> Bool

-- | Returns True if the kind classifies unlifted types 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
isLiftedRuntimeRep :: Type -> Bool

-- | Given a kind (TYPE rr), extract its RuntimeRep classifier rr. For
--   example, <tt>kindRep_maybe * = Just LiftedRep</tt> Returns
--   <a>Nothing</a> 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, <tt>kindRep * = LiftedRep</tt>; Panics if this is not
--   possible. Treats * and Constraint as the same
kindRep :: HasDebugCallStack => Kind -> 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.
--   
--   <a>expandTypeSynonyms</a> 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 <tt>synonymTyConsOfType</tt>
expandTypeSynonyms :: Type -> Type

-- | 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 TyCoRep.
[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 TcTyClsDecls
[tcm_tycon] :: TyCoMapper env (m :: Type -> Type) -> TyCon -> m TyCon
cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar])
cloneTyVarBndr :: TCvSubst -> TyVar -> Unique -> (TCvSubst, TyVar)
substVarBndrs :: HasCallStack => TCvSubst -> [TyCoVar] -> (TCvSubst, [TyCoVar])
substVarBndr :: HasCallStack => TCvSubst -> TyCoVar -> (TCvSubst, TyCoVar)
substTyVarBndrs :: HasCallStack => TCvSubst -> [TyVar] -> (TCvSubst, [TyVar])
substTyVarBndr :: HasCallStack => TCvSubst -> TyVar -> (TCvSubst, TyVar)

-- | Substitute within a <a>Coercion</a> 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
lookupTyVar :: TCvSubst -> TyVar -> Maybe Type
substTyVars :: TCvSubst -> [TyVar] -> [Type]
substTyVar :: TCvSubst -> TyVar -> Type

-- | Substitute within a <a>ThetaType</a> 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 <a>ThetaType</a> The substitution has to satisfy
--   the invariants described in Note [The substitution invariant].
substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType

-- | Substitute within several <a>Type</a>s 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 <a>Type</a>s The substitution has to satisfy
--   the invariants described in Note [The substitution invariant].
substTys :: HasCallStack => TCvSubst -> [Type] -> [Type]

-- | Substitute within a <a>Type</a> 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

-- | Substitute within a <a>Type</a> The substitution has to satisfy the
--   invariants described in Note [The substitution invariant].
substTy :: HasCallStack => TCvSubst -> Type -> Type

-- | Substitute within a <a>Type</a> 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

-- | Type substitution, see <a>zipTvSubst</a>
substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type]

-- | Substitute covars within a type
substTyWithCoVars :: [CoVar] -> [Coercion] -> Type -> Type

-- | Coercion substitution, see <a>zipTvSubst</a>. 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

-- | Type substitution, see <a>zipTvSubst</a>. 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 <a>zipTvSubst</a>
substTyWith :: HasCallStack => [TyVar] -> [Type] -> Type -> Type
zipCoEnv :: HasDebugCallStack => [CoVar] -> [Coercion] -> CvSubstEnv
zipTyEnv :: HasDebugCallStack => [TyVar] -> [Type] -> TvSubstEnv

-- | Generates the in-scope set for the <a>TCvSubst</a> from the types in
--   the incoming environment. No CoVars, please!
mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst
zipTCvSubst :: HasDebugCallStack => [TyCoVar] -> [Type] -> TCvSubst

-- | Generates the in-scope set for the <a>TCvSubst</a> from the types in
--   the incoming environment. No CoVars, please!
zipTvSubst :: HasDebugCallStack => [TyVar] -> [Type] -> TCvSubst
unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
extendTCvSubstList :: TCvSubst -> [Var] -> [Type] -> TCvSubst
extendTvSubstList :: TCvSubst -> [Var] -> [Type] -> TCvSubst
extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
extendCvSubst :: TCvSubst -> CoVar -> Coercion -> TCvSubst
extendTvSubstWithClone :: TCvSubst -> TyVar -> TyVar -> TCvSubst
extendTvSubstBinderAndInScope :: TCvSubst -> TyCoBinder -> Type -> TCvSubst
extendTvSubst :: TCvSubst -> TyVar -> Type -> TCvSubst
extendTCvSubstWithClone :: TCvSubst -> TyCoVar -> TyCoVar -> TCvSubst
extendTCvSubst :: TCvSubst -> TyCoVar -> Type -> TCvSubst
extendTCvInScopeSet :: TCvSubst -> VarSet -> TCvSubst
extendTCvInScopeList :: TCvSubst -> [Var] -> TCvSubst
extendTCvInScope :: TCvSubst -> Var -> TCvSubst
zapTCvSubst :: TCvSubst -> TCvSubst
setTvSubstEnv :: TCvSubst -> TvSubstEnv -> TCvSubst
notElemTCvSubst :: Var -> TCvSubst -> Bool
isInScope :: Var -> TCvSubst -> Bool

-- | Returns the free variables of the types in the range of a substitution
--   as a non-deterministic set.
getTCvSubstRangeFVs :: TCvSubst -> VarSet
getTCvInScope :: TCvSubst -> InScopeSet
getTvSubstEnv :: TCvSubst -> TvSubstEnv

-- | Make a TCvSubst with specified tyvar subst and empty covar subst
mkTvSubst :: InScopeSet -> TvSubstEnv -> TCvSubst
mkTCvSubst :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> TCvSubst
isEmptyTCvSubst :: TCvSubst -> Bool
mkEmptyTCvSubst :: InScopeSet -> TCvSubst
emptyTCvSubst :: TCvSubst

-- | Composes two substitutions, applying the second one provided first,
--   like in function composition.
composeTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst

-- | <tt>(compose env1 env2)(x)</tt> is <tt>env1(env2(x))</tt>; i.e. apply
--   <tt>env2</tt> then <tt>env1</tt>. It assumes that both are idempotent.
--   Typically, <tt>env1</tt> is the refinement to a base substitution
--   <tt>env2</tt>
composeTCvSubstEnv :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv)
emptyTvSubstEnv :: TvSubstEnv

-- | Type &amp; coercion substitution
--   
--   The following invariants must hold of a <a>TCvSubst</a>:
--   
--   <ol>
--   <li>The in-scope set is needed <i>only</i> to guide the generation of
--   fresh uniques</li>
--   <li>In particular, the <i>kind</i> of the type variables in the
--   in-scope set is not relevant</li>
--   <li>The substitution is only applied ONCE! This is because in general
--   such application will not reach a fixed point.</li>
--   </ol>
data TCvSubst
TCvSubst :: InScopeSet -> TvSubstEnv -> CvSubstEnv -> TCvSubst

-- | A substitution of <a>Type</a>s for <a>TyVar</a>s and <a>Kind</a>s for
--   <a>KindVar</a>s
type TvSubstEnv = TyVarEnv Type
pprTypeApp :: TyCon -> [Type] -> SDoc
pprTCvBndr :: TyCoVarBinder -> SDoc
pprTCvBndrs :: [TyCoVarBinder] -> SDoc
pprSigmaType :: Type -> SDoc
pprThetaArrowTy :: ThetaType -> SDoc
pprParendTheta :: ThetaType -> SDoc
pprTheta :: ThetaType -> SDoc
pprClassPred :: Class -> [Type] -> SDoc
pprParendKind :: Kind -> SDoc
pprParendType :: Type -> SDoc
tidyKind :: TidyEnv -> Kind -> Kind
tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind)

-- | Calls <a>tidyType</a> on a top-level type (i.e. with an empty tidying
--   environment)
tidyTopType :: Type -> Type
tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type)

-- | Grabs the free type variables, tidies them and then uses
--   <a>tidyType</a> to work over the type itself
tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type])
tidyType :: TidyEnv -> Type -> Type
tidyTypes :: TidyEnv -> [Type] -> [Type]
tidyTyCoVarOcc :: TidyEnv -> TyCoVar -> TyCoVar

-- | Treat a new <a>TyCoVar</a> as a binder, and give it a fresh tidy name
--   using the environment if one has not already been allocated. See also
--   <a>tidyVarBndr</a>
tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])

-- | Add the free <a>TyVar</a>s to the env in tidy form, so that we can
--   tidy the type they are free in
tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
tidyTyCoVarBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis])
tidyTyCoVarBinder :: TidyEnv -> VarBndr TyCoVar vis -> (TidyEnv, VarBndr TyCoVar vis)
tidyVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)

-- | 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])

-- | Get the free vars of types in scoped order
tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar]

-- | Get the free vars of a type in scoped order
tyCoVarsOfTypeWellScoped :: Type -> [TyVar]

-- | 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 RnTypes
scopedSort :: [TyCoVar] -> [TyCoVar]

-- | Returns True if this type has no free variables. Should be the same as
--   isEmptyVarSet . tyCoVarsOfType, but faster in the non-forall case.
noFreeVarsOfType :: Type -> Bool
coVarsOfTypes :: [Type] -> TyCoVarSet
coVarsOfType :: Type -> CoVarSet
tyCoFVsOfTypes :: [Type] -> FV
tyCoFVsVarBndr :: Var -> FV -> FV
tyCoFVsVarBndrs :: [Var] -> FV -> FV
tyCoFVsBndr :: TyCoVarBinder -> FV -> FV

-- | The worker for <a>tyCoFVsOfType</a> and <tt>tyCoFVsOfTypeList</tt>.
--   The previous implementation used <a>unionVarSet</a> 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 FV.
--   
--   Eta-expanded because that makes it run faster (apparently) See Note
--   [FV eta expansion] in FV for explanation.
tyCoFVsOfType :: Type -> FV
exactTyCoVarsOfTypes :: [Type] -> TyVarSet
exactTyCoVarsOfType :: Type -> TyCoVarSet

-- | Returns free variables of types, including kind variables as a
--   deterministically ordered list. For type synonyms it does <i>not</i>
--   expand the synonym.
tyCoVarsOfTypesList :: [Type] -> [TyCoVar]

-- | Returns free variables of types, including kind variables as a
--   deterministic set. For type synonyms it does <i>not</i> expand the
--   synonym.
tyCoVarsOfTypesDSet :: [Type] -> DTyCoVarSet

-- | <a>tyCoFVsOfType</a> that returns free variables of a type in
--   deterministic order. For explanation of why using <a>VarSet</a> is not
--   deterministic see Note [Deterministic FV] in FV.
tyCoVarsOfTypeList :: Type -> [TyCoVar]

-- | <a>tyCoFVsOfType</a> that returns free variables of a type in a
--   deterministic set. For explanation of why using <a>VarSet</a> is not
--   deterministic see Note [Deterministic FV] in FV.
tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet
tyCoVarsOfTypes :: [Type] -> TyCoVarSet
tyCoVarsOfType :: Type -> TyCoVarSet

-- | The <tt>(-&gt;)</tt> type constructor.
--   
--   <pre>
--   (-&gt;) :: forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep).
--           TYPE rep1 -&gt; TYPE rep2 -&gt; *
--   </pre>
funTyCon :: TyCon
provSize :: UnivCoProvenance -> Int
coercionSize :: Coercion -> Int
typeSize :: Type -> Int
setCoHoleCoVar :: CoercionHole -> CoVar -> CoercionHole
coHoleCoVar :: CoercionHole -> CoVar

-- | Create the plain type constructor type which has been applied to no
--   type arguments at all.
mkTyConTy :: TyCon -> Type
mkPiTys :: [TyCoBinder] -> Type -> Type
mkPiTy :: TyCoBinder -> Type -> Type

-- | Wraps foralls over the type using the provided <a>TyCoVar</a>s from
--   left to right
mkForAllTys :: [TyCoVarBinder] -> Type -> Type

-- | Make nested arrow types
mkInvisFunTys :: [Type] -> Type -> Type

-- | Make nested arrow types
mkVisFunTys :: [Type] -> Type -> Type
mkInvisFunTy :: Type -> Type -> Type
infixr 3 `mkInvisFunTy`
mkVisFunTy :: Type -> Type -> Type
infixr 3 `mkVisFunTy`
mkTyCoVarTys :: [TyCoVar] -> [Type]
mkTyCoVarTy :: TyCoVar -> Type
mkTyVarTys :: [TyVar] -> [Type]
mkTyVarTy :: TyVar -> Type

-- | If its a named binder, is the binder a tyvar? Returns True for
--   nondependent binder. This check that we're really returning a
--   *Ty*Binder (as opposed to a coercion binder). That way, if/when we
--   allow coercion quantification in more places, we'll know we missed
--   updating some function.
isTyBinder :: TyCoBinder -> Bool
isNamedBinder :: TyCoBinder -> Bool

-- | Does this binder bind a visible argument?
isVisibleBinder :: TyCoBinder -> Bool

-- | Does this binder bind an invisible argument?
isInvisibleBinder :: TyCoBinder -> Bool

-- | Remove the binder's variable from the set, if the binder has a
--   variable.
delBinderVar :: VarSet -> TyCoVarBinder -> VarSet
tyThingCategory :: TyThing -> String
pprTyThingCategory :: TyThing -> SDoc
pprShortTyThing :: TyThing -> SDoc

-- | The key representation of types within the compiler
type KindOrType = Type

-- | A type labeled <a>KnotTied</a> might have knot-tied tycons in it. See
--   Note [Type checking recursive type and class declarations] in
--   TcTyClsDecls
type KnotTied ty = ty

-- | <a>TyBinder</a> is like <a>TyCoBinder</a>, but there can only be
--   <a>TyVarBinder</a> in the <a>Named</a> field.
type TyBinder = TyCoBinder
type CoercionR = Coercion
type CoercionP = Coercion
type KindCoercion = CoercionN
type MCoercionR = MCoercion

-- | A coercion to be filled in by the type-checker. See Note [Coercion
--   holes]
data CoercionHole
CoercionHole :: CoVar -> IORef (Maybe Coercion) -> CoercionHole
[ch_co_var] :: CoercionHole -> CoVar
[ch_ref] :: CoercionHole -> IORef (Maybe Coercion)

-- | Returns whether or not this <a>TyCon</a> is definite, or a hole that
--   may be filled in at some later point. See Note [Skolem abstract data]
tyConSkolem :: TyCon -> Bool
checkRecTc :: RecTcChecker -> TyCon -> Maybe RecTcChecker

-- | Change the upper bound for the number of times a <a>RecTcChecker</a>
--   is allowed to encounter each <a>TyCon</a>.
setRecTcMaxBound :: Int -> RecTcChecker -> RecTcChecker

-- | The default upper bound (100) for the number of times a
--   <a>RecTcChecker</a> is allowed to encounter each <a>TyCon</a>.
defaultRecTcMaxBound :: Int

-- | Initialise a <a>RecTcChecker</a> with <a>defaultRecTcMaxBound</a>.
initRecTc :: RecTcChecker
pprPromotionQuote :: TyCon -> SDoc

-- | Is this flavour of <a>TyCon</a> an open type family or a data family?
tcFlavourIsOpen :: TyConFlavour -> Bool
tyConFlavour :: TyCon -> TyConFlavour
mkTyConTagMap :: TyCon -> NameEnv ConTag

-- | Extract any <a>RuntimeRepInfo</a> from this TyCon
tyConRuntimeRepInfo :: TyCon -> RuntimeRepInfo

-- | If this <a>TyCon</a> is that of a data family instance, return a
--   <a>TyCon</a> which represents a coercion identifying the
--   representation type with the type instance family. Otherwise, return
--   <tt>Nothing</tt>
tyConFamilyCoercion_maybe :: TyCon -> Maybe (CoAxiom Unbranched)

-- | If this <a>TyCon</a> is that of a data family instance, return the
--   family in question and the instance types. Otherwise, return
--   <tt>Nothing</tt>
tyConFamInst_maybe :: TyCon -> Maybe (TyCon, [Type])
tyConFamInstSig_maybe :: TyCon -> Maybe (TyCon, [Type], CoAxiom Unbranched)

-- | Is this <a>TyCon</a> that for a data family instance?
isFamInstTyCon :: TyCon -> Bool

-- | Return the associated types of the <a>TyCon</a>, if any
tyConATs :: TyCon -> [TyCon]

-- | If this <a>TyCon</a> is that for a class instance, return the class it
--   is for. Otherwise returns <tt>Nothing</tt>
tyConClass_maybe :: TyCon -> Maybe Class

-- | Is this <a>TyCon</a> that for a class instance?
isClassTyCon :: TyCon -> Bool

-- | Extract the flavour of a type family (with all the extra information
--   that it carries)
famTyConFlav_maybe :: TyCon -> Maybe FamTyConFlav

-- | Extract the information pertaining to the right hand side of a type
--   synonym (<tt>type</tt>) declaration.
synTyConRhs_maybe :: TyCon -> Maybe Type

-- | Extract the <a>TyVar</a>s bound by a vanilla type synonym and the
--   corresponding (unsubstituted) right hand side.
synTyConDefn_maybe :: TyCon -> Maybe ([TyVar], Type)

-- | Find the "stupid theta" of the <a>TyCon</a>. A "stupid theta" is the
--   context to the left of an algebraic type declaration, e.g. <tt>Eq
--   a</tt> in the declaration <tt>data Eq a =&gt; T a ...</tt>
tyConStupidTheta :: TyCon -> [PredType]
newTyConDataCon_maybe :: TyCon -> Maybe DataCon
newTyConCo :: TyCon -> CoAxiom Unbranched

-- | Extracts the <tt>newtype</tt> coercion from such a <a>TyCon</a>, which
--   can be used to construct something with the <tt>newtype</tt>s type
--   from its representation type (right hand side). If the supplied
--   <a>TyCon</a> is not a <tt>newtype</tt>, returns <tt>Nothing</tt>
newTyConCo_maybe :: TyCon -> Maybe (CoAxiom Unbranched)

-- | Extract the bound type variables and type expansion of an
--   eta-contracted type synonym <a>TyCon</a>. Panics if the <a>TyCon</a>
--   is not a synonym
newTyConEtadRhs :: TyCon -> ([TyVar], Type)

-- | The number of type parameters that need to be passed to a newtype to
--   resolve it. May be less than in the definition if it can be
--   eta-contracted.
newTyConEtadArity :: TyCon -> Int

-- | Extract the bound type variables and type expansion of a type synonym
--   <a>TyCon</a>. Panics if the <a>TyCon</a> is not a synonym
newTyConRhs :: TyCon -> ([TyVar], Type)

-- | Get the list of roles for the type parameters of a TyCon
tyConRoles :: TyCon -> [Role]

-- | Extract type variable naming the result of injective type family
tyConFamilyResVar_maybe :: TyCon -> Maybe Name

-- | Extract an <a>AlgTyConRhs</a> with information about data constructors
--   from an algebraic or tuple <a>TyCon</a>. Panics for any other sort of
--   <a>TyCon</a>
algTyConRhs :: TyCon -> AlgTyConRhs

-- | Determine the number of value constructors a <a>TyCon</a> has. Panics
--   if the <a>TyCon</a> is not algebraic or a tuple
tyConFamilySize :: TyCon -> Int
tyConSingleAlgDataCon_maybe :: TyCon -> Maybe DataCon
tyConSingleDataCon :: TyCon -> DataCon

-- | If the given <a>TyCon</a> has a <i>single</i> data constructor, i.e.
--   it is a <tt>data</tt> type with one alternative, a tuple type or a
--   <tt>newtype</tt> then that constructor is returned. If the
--   <a>TyCon</a> has more than one constructor, or represents a primitive
--   or function type constructor then <tt>Nothing</tt> is returned. In any
--   other case, the function panics
tyConSingleDataCon_maybe :: TyCon -> Maybe DataCon

-- | Determine the <a>DataCon</a>s originating from the given <a>TyCon</a>,
--   if the <a>TyCon</a> is the sort that can have any constructors (note:
--   this does not include abstract algebraic types)
tyConDataCons_maybe :: TyCon -> Maybe [DataCon]

-- | As <a>tyConDataCons_maybe</a>, but returns the empty list of
--   constructors if no constructors could be found
tyConDataCons :: TyCon -> [DataCon]

-- | Check if the tycon actually refers to a proper `data` or `newtype`
--   with user defined constructors rather than one from a class or other
--   construction.
isTyConWithSrcDataCons :: TyCon -> Bool

-- | Expand a type synonym application, if any
expandSynTyCon_maybe :: TyCon -> [tyco] -> Maybe ([(TyVar, tyco)], Type, [tyco])

-- | Could this TyCon ever be levity-polymorphic when fully applied? True
--   is safe. False means we're sure. Does only a quick check based on the
--   TyCon's category. Precondition: The fully-applied TyCon has kind (TYPE
--   blah)
isTcLevPoly :: TyCon -> Bool
setTcTyConKind :: TyCon -> Kind -> TyCon

-- | Is this a TcTyCon? (That is, one only used during type-checking?)
isTcTyCon :: TyCon -> Bool
tyConCType_maybe :: TyCon -> Maybe CType

-- | Identifies implicit tycons that, in particular, do not go into
--   interface files (because they are implicitly reconstructed when the
--   interface is read).
--   
--   Note that:
--   
--   <ul>
--   <li>Associated families are implicit, as they are re-constructed from
--   the class declaration in which they reside, and</li>
--   <li>Family instances are <i>not</i> implicit as they represent the
--   instance body (similar to a <tt>dfun</tt> does that for a class
--   instance).</li>
--   <li>Tuples are implicit iff they have a wired-in name (namely: boxed
--   and unboxed tuples are wired-in and implicit, but constraint tuples
--   are not)</li>
--   </ul>
isImplicitTyCon :: TyCon -> Bool
isLiftedTypeKindTyConName :: Name -> Bool

-- | Is this tycon really meant for use at the kind level? That is, should
--   it be permitted without -XDataKinds?
isKindTyCon :: TyCon -> Bool

-- | Retrieves the promoted DataCon if this is a PromotedDataCon;
isPromotedDataCon_maybe :: TyCon -> Maybe DataCon

-- | Is this a PromotedDataCon?
isPromotedDataCon :: TyCon -> Bool

-- | Is this the <a>TyCon</a> for a <i>promoted</i> tuple?
isPromotedTupleTyCon :: TyCon -> Bool

-- | Is this the <a>TyCon</a> for an unboxed sum?
isUnboxedSumTyCon :: TyCon -> Bool

-- | Is this the <a>TyCon</a> for a boxed tuple?
isBoxedTupleTyCon :: TyCon -> Bool
tyConTuple_maybe :: TyCon -> Maybe TupleSort

-- | Get the enclosing class TyCon (if there is one) for the given
--   TyConFlavour
tyConFlavourAssoc_maybe :: TyConFlavour -> Maybe TyCon

-- | Get the enclosing class TyCon (if there is one) for the given TyCon.
tyConAssoc_maybe :: TyCon -> Maybe TyCon

-- | Is this TyCon for an associated type?
isTyConAssoc :: TyCon -> Bool
isBuiltInSynFamTyCon_maybe :: TyCon -> Maybe BuiltInSynFamily

-- | <tt><a>tyConInjectivityInfo</a> tc</tt> returns <tt><a>Injective</a>
--   is</tt> is <tt>tc</tt> is an injective tycon (where <tt>is</tt> states
--   for which <a>tyConBinders</a> <tt>tc</tt> is injective), or
--   <a>NotInjective</a> otherwise.
tyConInjectivityInfo :: TyCon -> Injectivity

-- | Is this a non-empty closed type family? Returns <a>Nothing</a> for
--   abstract or empty closed families.
isClosedSynFamilyTyConWithAxiom_maybe :: TyCon -> Maybe (CoAxiom Branched)

-- | Is this an open type family TyCon?
isOpenTypeFamilyTyCon :: TyCon -> Bool

-- | Is this a synonym <a>TyCon</a> that can have may have further
--   instances appear?
isDataFamilyTyCon :: TyCon -> Bool

-- | Is this a synonym <a>TyCon</a> that can have may have further
--   instances appear?
isTypeFamilyTyCon :: TyCon -> Bool

-- | Is this a <a>TyCon</a>, synonym or otherwise, that defines a family
--   with instances?
isOpenFamilyTyCon :: TyCon -> Bool

-- | Is this a <a>TyCon</a>, synonym or otherwise, that defines a family?
isFamilyTyCon :: TyCon -> Bool

-- | Is this an algebraic <a>TyCon</a> which is just an enumeration of
--   values?
isEnumerationTyCon :: TyCon -> Bool

-- | Is this an algebraic <a>TyCon</a> declared with the GADT syntax?
isGadtSyntaxTyCon :: TyCon -> Bool

-- | True iff we can decompose (T a b c) into ((T a b) c) I.e. is it
--   injective and generative w.r.t nominal equality? That is, if (T a b)
--   ~N d e f, is it always the case that (T ~N d), (a ~N e) and (b ~N f)?
--   Specifically NOT true of synonyms (open and otherwise)
--   
--   It'd be unusual to call mustBeSaturated on a regular H98 type synonym,
--   because you should probably have expanded it first But regardless,
--   it's not decomposable
mustBeSaturated :: TyCon -> Bool
isFamFreeTyCon :: TyCon -> Bool
isTauTyCon :: TyCon -> Bool

-- | Is this a <a>TyCon</a> representing a regular H98 type synonym
--   (<tt>type</tt>)?
isTypeSynonymTyCon :: TyCon -> Bool
isDataSumTyCon_maybe :: TyCon -> Maybe [DataCon]
isDataProductTyCon_maybe :: TyCon -> Maybe DataCon
isProductTyCon :: TyCon -> Bool
unwrapNewTyConEtad_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched)

-- | Take a <a>TyCon</a> apart into the <a>TyVar</a>s it scopes over, the
--   <a>Type</a> it expands into, and (possibly) a coercion from the
--   representation type to the <tt>newtype</tt>. Returns <tt>Nothing</tt>
--   if this is not possible.
unwrapNewTyCon_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched)

-- | Is this <a>TyCon</a> that for a <tt>newtype</tt>
isNewTyCon :: TyCon -> Bool

-- | Is this an <a>AlgTyConRhs</a> of a <a>TyCon</a> that is generative and
--   injective with respect to representational equality?
isGenInjAlgRhs :: AlgTyConRhs -> Bool

-- | <a>isGenerativeTyCon</a> is true of <a>TyCon</a>s for which this
--   property holds (where X is the role passed in): If (T tys ~X t), then
--   (t's head ~X T). See also Note [Decomposing equality] in TcCanonical
isGenerativeTyCon :: TyCon -> Role -> Bool

-- | <a>isInjectiveTyCon</a> is true of <a>TyCon</a>s for which this
--   property holds (where X is the role passed in): If (T a1 b1 c1) ~X (T
--   a2 b2 c2), then (a1 ~X1 a2), (b1 ~X2 b2), and (c1 ~X3 c2) (where X1,
--   X2, and X3, are the roles given by tyConRolesX tc X) See also Note
--   [Decomposing equality] in TcCanonical
isInjectiveTyCon :: TyCon -> Role -> Bool

-- | Returns <tt>True</tt> for data types that are <i>definitely</i>
--   represented by heap-allocated constructors. These are scrutinised by
--   Core-level <tt>case</tt> expressions, and they get info tables
--   allocated for them.
--   
--   Generally, the function will be true for all <tt>data</tt> types and
--   false for <tt>newtype</tt>s, unboxed tuples, unboxed sums and type
--   family <a>TyCon</a>s. But it is not guaranteed to return <tt>True</tt>
--   in all cases that it could.
--   
--   NB: for a data type family, only the <i>instance</i> <a>TyCon</a>s get
--   an info table. The family declaration <a>TyCon</a> does not
isDataTyCon :: TyCon -> Bool

-- | Returns <tt>True</tt> for vanilla AlgTyCons -- that is, those created
--   with a <tt>data</tt> or <tt>newtype</tt> declaration.
isVanillaAlgTyCon :: TyCon -> Bool

-- | Returns <tt>True</tt> if the supplied <a>TyCon</a> resulted from
--   either a <tt>data</tt> or <tt>newtype</tt> declaration
isAlgTyCon :: TyCon -> Bool

-- | Is this <a>TyCon</a> unlifted (i.e. cannot contain bottom)? Note that
--   this can only be true for primitive and unboxed-tuple <a>TyCon</a>s
isUnliftedTyCon :: TyCon -> Bool

-- | Does this <a>TyCon</a> represent something that cannot be defined in
--   Haskell?
isPrimTyCon :: TyCon -> Bool

-- | Test if the <a>TyCon</a> is algebraic but abstract (invisible data
--   constructors)
isAbstractTyCon :: TyCon -> Bool

-- | Create a promoted data constructor <a>TyCon</a> Somewhat dodgily, we
--   give it the same Name as the data constructor itself; when we
--   pretty-print the TyCon we add a quote; see the Outputable TyCon
--   instance
mkPromotedDataCon :: DataCon -> Name -> TyConRepName -> [TyConTyCoBinder] -> Kind -> [Role] -> RuntimeRepInfo -> TyCon

-- | Create a type family <a>TyCon</a>
mkFamilyTyCon :: Name -> [TyConBinder] -> Kind -> Maybe Name -> FamTyConFlav -> Maybe Class -> Injectivity -> TyCon

-- | Create a type synonym <a>TyCon</a>
mkSynonymTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Type -> Bool -> Bool -> TyCon

-- | Create a lifted primitive <a>TyCon</a> such as <tt>RealWorld</tt>
mkLiftedPrimTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> TyCon

-- | Kind constructors
mkKindTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Name -> TyCon

-- | Create an unlifted primitive <a>TyCon</a>, such as <tt>Int#</tt>.
mkPrimTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> TyCon

-- | No scoped type variables (to be used with mkTcTyCon).
noTcTyConScopedTyVars :: [(Name, TcTyVar)]

-- | Makes a tycon suitable for use during type-checking. It stores a
--   variety of details about the definition of the TyCon, but no
--   right-hand side. It lives only during the type-checking of a
--   mutually-recursive group of tycons; it is then zonked to a proper
--   TyCon in zonkTcTyCon. See also Note [Kind checking recursive type and
--   class declarations] in TcTyClsDecls.
mkTcTyCon :: Name -> [TyConBinder] -> Kind -> [(Name, TcTyVar)] -> Bool -> TyConFlavour -> TyCon
mkSumTyCon :: Name -> [TyConBinder] -> Kind -> Arity -> [TyVar] -> [DataCon] -> AlgTyConFlav -> TyCon
mkTupleTyCon :: Name -> [TyConBinder] -> Kind -> Arity -> DataCon -> TupleSort -> AlgTyConFlav -> TyCon

-- | Simpler specialization of <a>mkAlgTyCon</a> for classes
mkClassTyCon :: Name -> [TyConBinder] -> [Role] -> AlgTyConRhs -> Class -> Name -> TyCon

-- | This is the making of an algebraic <a>TyCon</a>. Notably, you have to
--   pass in the generic (in the -XGenerics sense) information about the
--   type constructor - you can get hold of it easily (see Generics module)
mkAlgTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Maybe CType -> [PredType] -> AlgTyConRhs -> AlgTyConFlav -> Bool -> TyCon

-- | Given the name of the function type constructor and it's kind, create
--   the corresponding <a>TyCon</a>. It is recommended to use
--   <a>funTyCon</a> if you want this functionality
mkFunTyCon :: Name -> [TyConBinder] -> Name -> TyCon

-- | Look up a field label belonging to this <a>TyCon</a>
lookupTyConFieldLabel :: FieldLabelString -> TyCon -> Maybe FieldLabel

-- | The labels for the fields of this particular <a>TyCon</a>
tyConFieldLabels :: TyCon -> [FieldLabel]

-- | Return if Rep stands for floating type, returns Nothing for vector
--   types.
primRepIsFloat :: PrimRep -> Maybe Bool
primElemRepSizeB :: PrimElemRep -> Int

-- | The size of a <a>PrimRep</a> in bytes.
--   
--   This applies also when used in a constructor, where we allow packing
--   the fields. For instance, in <tt>data Foo = Foo Float# Float#</tt> the
--   two fields will take only 8 bytes, which for 64-bit arch will be equal
--   to 1 word. See also mkVirtHeapOffsetsWithPadding for details of how
--   data fields are layed out.
primRepSizeB :: DynFlags -> PrimRep -> Int
primRepsCompatible :: DynFlags -> [PrimRep] -> [PrimRep] -> Bool
primRepCompatible :: DynFlags -> PrimRep -> PrimRep -> Bool
isGcPtrRep :: PrimRep -> Bool
isVoidRep :: PrimRep -> Bool

-- | The name (and defining module) for the Typeable representation (TyCon)
--   of a type constructor.
--   
--   See Note [Grand plan for Typeable] in <tt>TcTypeable</tt> in
--   TcTypeable.
tyConRepModOcc :: Module -> OccName -> (Module, OccName)

-- | Make a <a>Name</a> for the <tt>Typeable</tt> representation of the
--   given wired-in type
mkPrelTyConRepName :: Name -> TyConRepName
tyConRepName_maybe :: TyCon -> Maybe TyConRepName
isNoParent :: AlgTyConFlav -> Bool

-- | Both type classes as well as family instances imply implicit type
--   constructors. These implicit type constructors refer to their parent
--   structure (ie, the class or family from which they derive) using a
--   type of the following form.
--   
--   Extract those <a>DataCon</a>s that we are able to learn about. Note
--   that visibility in this sense does not correspond to visibility in the
--   context of any particular user program!
visibleDataCons :: AlgTyConRhs -> [DataCon]
mkDataTyConRhs :: [DataCon] -> AlgTyConRhs
tyConVisibleTyVars :: TyCon -> [TyVar]
tyConTyVarBinders :: [TyConBinder] -> [TyVarBinder]
mkTyConKind :: [TyConBinder] -> Kind -> Kind
isInvisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool
isVisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool
isNamedTyConBinder :: TyConBinder -> Bool
tyConBndrVisArgFlag :: TyConBndrVis -> ArgFlag
tyConBinderArgFlag :: TyConBinder -> ArgFlag

-- | Make a Required TyConBinder. It chooses between NamedTCB and AnonTCB
--   based on whether the tv is mentioned in the dependent set
mkRequiredTyConBinder :: TyCoVarSet -> TyVar -> TyConBinder
mkNamedTyConBinders :: ArgFlag -> [TyVar] -> [TyConBinder]
mkNamedTyConBinder :: ArgFlag -> TyVar -> TyConBinder
mkAnonTyConBinders :: AnonArgFlag -> [TyVar] -> [TyConBinder]
mkAnonTyConBinder :: AnonArgFlag -> TyVar -> TyConBinder
type TyConBinder = VarBndr TyVar TyConBndrVis
type TyConTyCoBinder = VarBndr TyCoVar TyConBndrVis
data TyConBndrVis
NamedTCB :: ArgFlag -> TyConBndrVis
AnonTCB :: AnonArgFlag -> TyConBndrVis

-- | Represents right-hand-sides of <a>TyCon</a>s for algebraic types
data AlgTyConRhs

-- | Says that we know nothing about this data type, except that it's
--   represented by a pointer. Used when we export a data type abstractly
--   into an .hi file.
AbstractTyCon :: AlgTyConRhs

-- | Information about those <a>TyCon</a>s derived from a <tt>data</tt>
--   declaration. This includes data types with no constructors at all.
DataTyCon :: [DataCon] -> Int -> Bool -> AlgTyConRhs

-- | The data type constructors; can be empty if the user declares the type
--   to have no constructors
--   
--   INVARIANT: Kept in order of increasing <a>DataCon</a> tag (see the tag
--   assignment in mkTyConTagMap)
[data_cons] :: AlgTyConRhs -> [DataCon]

-- | Cached value: length data_cons
[data_cons_size] :: AlgTyConRhs -> Int

-- | Cached value: is this an enumeration type? See Note [Enumeration
--   types]
[is_enum] :: AlgTyConRhs -> Bool
TupleTyCon :: DataCon -> TupleSort -> AlgTyConRhs

-- | The unique constructor for the <tt>newtype</tt>. It has no
--   existentials
[data_con] :: AlgTyConRhs -> DataCon

-- | Is this a boxed, unboxed or constraint tuple?
[tup_sort] :: AlgTyConRhs -> TupleSort

-- | An unboxed sum type.
SumTyCon :: [DataCon] -> Int -> AlgTyConRhs

-- | The data type constructors; can be empty if the user declares the type
--   to have no constructors
--   
--   INVARIANT: Kept in order of increasing <a>DataCon</a> tag (see the tag
--   assignment in mkTyConTagMap)
[data_cons] :: AlgTyConRhs -> [DataCon]

-- | Cached value: length data_cons
[data_cons_size] :: AlgTyConRhs -> Int

-- | Information about those <a>TyCon</a>s derived from a <tt>newtype</tt>
--   declaration
NewTyCon :: DataCon -> Type -> ([TyVar], Type) -> CoAxiom Unbranched -> Bool -> AlgTyConRhs

-- | The unique constructor for the <tt>newtype</tt>. It has no
--   existentials
[data_con] :: AlgTyConRhs -> DataCon

-- | Cached value: the argument type of the constructor, which is just the
--   representation type of the <a>TyCon</a> (remember that
--   <tt>newtype</tt>s do not exist at runtime so need a different
--   representation type).
--   
--   The free <a>TyVar</a>s of this type are the <a>tyConTyVars</a> from
--   the corresponding <a>TyCon</a>
[nt_rhs] :: AlgTyConRhs -> Type

-- | Same as the <a>nt_rhs</a>, but this time eta-reduced. Hence the list
--   of <a>TyVar</a>s in this field may be shorter than the declared arity
--   of the <a>TyCon</a>.
[nt_etad_rhs] :: AlgTyConRhs -> ([TyVar], Type)
[nt_co] :: AlgTyConRhs -> CoAxiom Unbranched
[nt_lev_poly] :: AlgTyConRhs -> Bool

-- | Some promoted datacons signify extra info relevant to GHC. For
--   example, the <tt>IntRep</tt> constructor of <tt>RuntimeRep</tt>
--   corresponds to the <a>IntRep</a> constructor of <a>PrimRep</a>. This
--   data structure allows us to store this information right in the
--   <a>TyCon</a>. The other approach would be to look up things like
--   <tt>RuntimeRep</tt>'s <tt>PrimRep</tt> by known-key every time. See
--   also Note [Getting from RuntimeRep to PrimRep] in RepType
data RuntimeRepInfo

-- | an ordinary promoted data con
NoRRI :: RuntimeRepInfo

-- | A constructor of <tt>RuntimeRep</tt>. The argument to the function
--   should be the list of arguments to the promoted datacon.
RuntimeRep :: ([Type] -> [PrimRep]) -> RuntimeRepInfo

-- | A constructor of <tt>VecCount</tt>
VecCount :: Int -> RuntimeRepInfo

-- | A constructor of <tt>VecElem</tt>
VecElem :: PrimElemRep -> RuntimeRepInfo
data AlgTyConFlav

-- | An ordinary type constructor has no parent.
VanillaAlgTyCon :: TyConRepName -> AlgTyConFlav

-- | An unboxed type constructor. The TyConRepName is a Maybe since we
--   currently don't allow unboxed sums to be Typeable since there are too
--   many of them. See #13276.
UnboxedAlgTyCon :: Maybe TyConRepName -> AlgTyConFlav

-- | Type constructors representing a class dictionary. See Note [ATyCon
--   for classes] in TyCoRep
ClassTyCon :: Class -> TyConRepName -> AlgTyConFlav

-- | Type constructors representing an *instance* of a *data* family.
--   Parameters:
--   
--   1) The type family in question
--   
--   2) Instance types; free variables are the <a>tyConTyVars</a> of the
--   current <a>TyCon</a> (not the family one). INVARIANT: the number of
--   types matches the arity of the family <a>TyCon</a>
--   
--   3) A <tt>CoTyCon</tt> identifying the representation type with the
--   type instance family
DataFamInstTyCon :: CoAxiom Unbranched -> TyCon -> [Type] -> AlgTyConFlav
data Injectivity
NotInjective :: Injectivity
Injective :: [Bool] -> Injectivity

-- | Information pertaining to the expansion of a type synonym
--   (<tt>type</tt>)
data FamTyConFlav

-- | Represents an open type family without a fixed right hand side.
--   Additional instances can appear at any time.
--   
--   These are introduced by either a top level declaration:
--   
--   <pre>
--   data family T a :: *
--   </pre>
--   
--   Or an associated data type declaration, within a class declaration:
--   
--   <pre>
--   class C a b where
--     data T b :: *
--   </pre>
DataFamilyTyCon :: TyConRepName -> FamTyConFlav

-- | An open type synonym family e.g. <tt>type family F x y :: * -&gt;
--   *</tt>
OpenSynFamilyTyCon :: FamTyConFlav

-- | A closed type synonym family e.g. <tt>type family F x where { F Int =
--   Bool }</tt>
ClosedSynFamilyTyCon :: Maybe (CoAxiom Branched) -> FamTyConFlav

-- | A closed type synonym family declared in an hs-boot file with type
--   family F a where ..
AbstractClosedSynFamilyTyCon :: FamTyConFlav

-- | Built-in type family used by the TypeNats solver
BuiltInSynFamTyCon :: BuiltInSynFamily -> FamTyConFlav
type TyConRepName = Name
data PrimElemRep
Int8ElemRep :: PrimElemRep
Int16ElemRep :: PrimElemRep
Int32ElemRep :: PrimElemRep
Int64ElemRep :: PrimElemRep
Word8ElemRep :: PrimElemRep
Word16ElemRep :: PrimElemRep
Word32ElemRep :: PrimElemRep
Word64ElemRep :: PrimElemRep
FloatElemRep :: PrimElemRep
DoubleElemRep :: PrimElemRep

-- | Paints a picture of what a <a>TyCon</a> represents, in broad strokes.
--   This is used towards more informative error messages.
data TyConFlavour
ClassFlavour :: TyConFlavour
TupleFlavour :: Boxity -> TyConFlavour
SumFlavour :: TyConFlavour
DataTypeFlavour :: TyConFlavour
NewtypeFlavour :: TyConFlavour
AbstractTypeFlavour :: TyConFlavour
DataFamilyFlavour :: Maybe TyCon -> TyConFlavour
OpenTypeFamilyFlavour :: Maybe TyCon -> TyConFlavour
ClosedTypeFamilyFlavour :: TyConFlavour
TypeSynonymFlavour :: TyConFlavour

-- | e.g., the <tt>(-&gt;)</tt> <a>TyCon</a>.
BuiltInTypeFlavour :: TyConFlavour
PromotedDataConFlavour :: TyConFlavour
data RecTcChecker
pprFunDep :: Outputable a => FunDep a -> SDoc
pprFundeps :: Outputable a => [FunDep a] -> SDoc
pprDefMethInfo :: DefMethInfo -> SDoc
isAbstractClass :: Class -> Bool
classExtraBigSig :: Class -> ([TyVar], [FunDep TyVar], [PredType], [Id], [ClassATItem], [ClassOpItem])
classBigSig :: Class -> ([TyVar], [PredType], [Id], [ClassOpItem])
classHasFds :: Class -> Bool
classTvsFds :: Class -> ([TyVar], [FunDep TyVar])
classSCTheta :: Class -> [PredType]
classATItems :: Class -> [ClassATItem]
classATs :: Class -> [TyCon]
classOpItems :: Class -> [ClassOpItem]
classMethods :: Class -> [Id]
classSCSelId :: Class -> Int -> Id
classSCSelIds :: Class -> [Id]
classAllSelIds :: Class -> [Id]
classArity :: Class -> Arity
mkAbstractClass :: Name -> [TyVar] -> [FunDep TyVar] -> TyCon -> Class
mkClass :: Name -> [TyVar] -> [FunDep TyVar] -> [PredType] -> [Id] -> [ClassATItem] -> [ClassOpItem] -> ClassMinimalDef -> TyCon -> Class
classMinimalDef :: Class -> ClassMinimalDef
data Class
type FunDep a = ([a], [a])
type ClassOpItem = (Id, DefMethInfo)
type DefMethInfo = Maybe (Name, DefMethSpec Type)
data ClassATItem
ATI :: TyCon -> Maybe (Type, SrcSpan) -> ClassATItem
type ClassMinimalDef = BooleanFormula Name
data Role
Nominal :: Role
Representational :: Role
Phantom :: Role
pprLExpr :: forall (p :: Pass). OutputableBndrId p => LHsExpr (GhcPass p) -> SDoc
pprExpr :: forall (p :: Pass). OutputableBndrId p => HsExpr (GhcPass p) -> SDoc
pprSplice :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SDoc
pprSpliceDecl :: forall (p :: Pass). OutputableBndrId p => HsSplice (GhcPass p) -> SpliceExplicitFlag -> SDoc
pprPatBind :: forall (bndr :: Pass) (p :: Pass) body. (OutputableBndrId bndr, OutputableBndrId p, Outputable body) => LPat (GhcPass bndr) -> GRHSs (GhcPass p) body -> SDoc
pprFunBind :: forall (idR :: Pass) body. (OutputableBndrId idR, Outputable body) => MatchGroup (GhcPass idR) body -> SDoc

-- | A Haskell expression.
data HsExpr p

-- | Variable
HsVar :: XVar p -> Located (IdP 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. Turned into HsVar by type checker, to support deferred type
--   errors.
HsUnboundVar :: XUnboundVar p -> UnboundVar -> HsExpr p

-- | After typechecker only; must be different HsVar for pretty printing
HsConLikeOut :: XConLikeOut p -> ConLike -> HsExpr p

-- | Variable pointing to record selector Not in use after typechecking
HsRecFld :: XRecFld p -> AmbiguousFieldOcc p -> HsExpr p

-- | Overloaded label (Note [Overloaded labels] in GHC.OverloadedLabels)
--   <tt>Just id</tt> means <tt>RebindableSyntax</tt> is in use, and gives
--   the id of the in-scope <tt>fromLabel</tt>. NB: Not in use after
--   typechecking
HsOverLabel :: XOverLabel p -> Maybe (IdP 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
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnLam</a>, <a>AnnRarrow</a>,</li>
--   </ul>
HsLam :: XLam p -> MatchGroup p (LHsExpr p) -> HsExpr p

-- | Lambda-case
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnLam</a>,
--   <a>AnnCase</a>,<a>AnnOpen</a>, <a>AnnClose</a></li>
--   </ul>
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
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnAt</a>,</li>
--   </ul>
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
--   <a>negate</a>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnMinus</a></li>
--   </ul>
NegApp :: XNegApp p -> LHsExpr p -> SyntaxExpr p -> HsExpr p

-- | Parenthesised expr; see Note [Parens in HsSyn]
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
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>, <a>AnnClose</a></li>
--   </ul>
ExplicitTuple :: XExplicitTuple p -> [LHsTupArg p] -> Boxity -> HsExpr p

-- | Used for unboxed sum types
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'(#'</tt>,
--   <a>AnnVbar</a>, <a>AnnClose</a> <tt>'#)'</tt>,</li>
--   </ul>
--   
--   There will be multiple <a>AnnVbar</a>, (1 - alternative) before the
--   expression, (arity - alternative) after it
ExplicitSum :: XExplicitSum p -> ConTag -> Arity -> LHsExpr p -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnCase</a>, <a>AnnOf</a>,<a>AnnOpen</a>
--   <tt>'{'</tt>, <a>AnnClose</a> <tt>'}'</tt></li>
--   </ul>
HsCase :: XCase p -> LHsExpr p -> MatchGroup p (LHsExpr p) -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnIf</a>, <a>AnnSemi</a>,
--   <a>AnnThen</a>,<a>AnnSemi</a>, <a>AnnElse</a>,</li>
--   </ul>
HsIf :: XIf p -> Maybe (SyntaxExpr p) -> LHsExpr p -> LHsExpr p -> LHsExpr p -> HsExpr p

-- | Multi-way if
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnIf</a>
--   <a>AnnOpen</a>,<a>AnnClose</a>,</li>
--   </ul>
HsMultiIf :: XMultiIf p -> [LGRHS p (LHsExpr p)] -> HsExpr p

-- | let(rec)
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnLet</a>, <a>AnnOpen</a> <tt>'{'</tt>,
--   <a>AnnClose</a> <tt>'}'</tt>,<a>AnnIn</a></li>
--   </ul>
HsLet :: XLet p -> LHsLocalBinds p -> LHsExpr p -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnDo</a>, <a>AnnOpen</a>,
--   <a>AnnSemi</a>, <a>AnnVbar</a>, <a>AnnClose</a></li>
--   </ul>
HsDo :: XDo p -> HsStmtContext Name -> Located [ExprLStmt p] -> HsExpr p

-- | Syntactic list: [a,b,c,...]
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'['</tt>, <a>AnnClose</a>
--   <tt>']'</tt></li>
--   </ul>
ExplicitList :: XExplicitList p -> Maybe (SyntaxExpr p) -> [LHsExpr p] -> HsExpr p

-- | Record construction
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'{'</tt>,
--   <a>AnnDotdot</a>,<a>AnnClose</a> <tt>'}'</tt></li>
--   </ul>
RecordCon :: XRecordCon p -> Located (IdP p) -> HsRecordBinds p -> HsExpr p
[rcon_ext] :: HsExpr p -> XRecordCon p
[rcon_con_name] :: HsExpr p -> Located (IdP p)
[rcon_flds] :: HsExpr p -> HsRecordBinds p

-- | Record update
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'{'</tt>,
--   <a>AnnDotdot</a>,<a>AnnClose</a> <tt>'}'</tt></li>
--   </ul>
RecordUpd :: XRecordUpd p -> LHsExpr p -> [LHsRecUpdField p] -> HsExpr p
[rupd_ext] :: HsExpr p -> XRecordUpd p
[rupd_expr] :: HsExpr p -> LHsExpr p
[rupd_flds] :: HsExpr p -> [LHsRecUpdField p]

-- | Expression with an explicit type signature. <tt>e :: type</tt>
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnDcolon</a></li>
--   </ul>
ExprWithTySig :: XExprWithTySig p -> LHsExpr p -> LHsSigWcType (NoGhcTc p) -> HsExpr p

-- | Arithmetic sequence
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'['</tt>,
--   <a>AnnComma</a>,<a>AnnDotdot</a>, <a>AnnClose</a> <tt>']'</tt></li>
--   </ul>
ArithSeq :: XArithSeq p -> Maybe (SyntaxExpr p) -> ArithSeqInfo p -> HsExpr p
HsSCC :: XSCC p -> SourceText -> StringLiteral -> LHsExpr p -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'{-# CORE'</tt>,
--   <a>AnnVal</a>, <a>AnnClose</a> <tt>'#-}'</tt></li>
--   </ul>
HsCoreAnn :: XCoreAnn p -> SourceText -> StringLiteral -> LHsExpr p -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>,
--   <a>AnnOpenE</a>,<a>AnnOpenEQ</a>,
--   <a>AnnClose</a>,<a>AnnCloseQ</a></li>
--   </ul>
HsBracket :: XBracket p -> HsBracket p -> HsExpr p
HsRnBracketOut :: XRnBracketOut p -> HsBracket GhcRn -> [PendingRnSplice] -> HsExpr p
HsTcBracketOut :: XTcBracketOut p -> HsBracket GhcRn -> [PendingTcSplice] -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>, <a>AnnClose</a></li>
--   </ul>
HsSpliceE :: XSpliceE p -> HsSplice p -> HsExpr p

-- | <tt>proc</tt> notation for Arrows
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnProc</a>, <a>AnnRarrow</a></li>
--   </ul>
HsProc :: XProc p -> LPat p -> LHsCmdTop p -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnStatic</a>,</li>
--   </ul>
HsStatic :: XStatic p -> LHsExpr p -> HsExpr p
HsTick :: XTick p -> Tickish (IdP p) -> LHsExpr p -> HsExpr p
HsBinTick :: XBinTick p -> Int -> Int -> LHsExpr p -> HsExpr p

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a>, <a>AnnOpen</a> <tt>'{-#
--   GENERATED'</tt>, <a>AnnVal</a>,<a>AnnVal</a>,
--   <a>AnnColon</a>,<a>AnnVal</a>, <a>AnnMinus</a>,
--   <a>AnnVal</a>,<a>AnnColon</a>, <a>AnnVal</a>, <a>AnnClose</a>
--   <tt>'#-}'</tt></li>
--   </ul>
HsTickPragma :: XTickPragma p -> SourceText -> (StringLiteral, (Int, Int), (Int, Int)) -> ((SourceText, SourceText), (SourceText, SourceText)) -> LHsExpr p -> HsExpr p
HsWrap :: XWrap p -> HsWrapper -> HsExpr p -> HsExpr p
XExpr :: XXExpr p -> HsExpr p

-- | Haskell Command (e.g. a "statement" in an Arrow proc block)
data HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>Annlarrowtail</a>,
--   <a>Annrarrowtail</a>,<a>AnnLarrowtail</a>, <a>AnnRarrowtail</a></li>
--   </ul>
HsCmdArrApp :: XCmdArrApp id -> LHsExpr id -> LHsExpr id -> HsArrAppType -> Bool -> HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpenB</a> <tt>'(|'</tt>,
--   <a>AnnCloseB</a> <tt>'|)'</tt></li>
--   </ul>
HsCmdArrForm :: XCmdArrForm id -> LHsExpr id -> LexicalFixity -> Maybe Fixity -> [LHsCmdTop id] -> HsCmd id
HsCmdApp :: XCmdApp id -> LHsCmd id -> LHsExpr id -> HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnLam</a>, <a>AnnRarrow</a>,</li>
--   </ul>
HsCmdLam :: XCmdLam id -> MatchGroup id (LHsCmd id) -> HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'('</tt>, <a>AnnClose</a>
--   <tt>')'</tt></li>
--   </ul>
HsCmdPar :: XCmdPar id -> LHsCmd id -> HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnCase</a>, <a>AnnOf</a>,<a>AnnOpen</a>
--   <tt>'{'</tt>, <a>AnnClose</a> <tt>'}'</tt></li>
--   </ul>
HsCmdCase :: XCmdCase id -> LHsExpr id -> MatchGroup id (LHsCmd id) -> HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnIf</a>, <a>AnnSemi</a>,
--   <a>AnnThen</a>,<a>AnnSemi</a>, <a>AnnElse</a>,</li>
--   </ul>
HsCmdIf :: XCmdIf id -> Maybe (SyntaxExpr id) -> LHsExpr id -> LHsCmd id -> LHsCmd id -> HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnLet</a>, <a>AnnOpen</a> <tt>'{'</tt>,
--   <a>AnnClose</a> <tt>'}'</tt>,<a>AnnIn</a></li>
--   </ul>
HsCmdLet :: XCmdLet id -> LHsLocalBinds id -> LHsCmd id -> HsCmd id

-- | <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnDo</a>, <a>AnnOpen</a>,
--   <a>AnnSemi</a>, <a>AnnVbar</a>, <a>AnnClose</a></li>
--   </ul>
HsCmdDo :: XCmdDo id -> Located [CmdLStmt id] -> HsCmd id
HsCmdWrap :: XCmdWrap id -> HsWrapper -> HsCmd id -> HsCmd id
XCmd :: XXCmd id -> HsCmd id

-- | 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
HsSplicedT :: DelayedSplice -> HsSplice id
XSplice :: XXSplice id -> HsSplice id
data MatchGroup p body
MG :: XMG p body -> Located [LMatch p body] -> Origin -> MatchGroup p body
[mg_ext] :: MatchGroup p body -> XMG p body
[mg_alts] :: MatchGroup p body -> Located [LMatch p body]
[mg_origin] :: MatchGroup p body -> Origin
XMatchGroup :: XXMatchGroup p body -> MatchGroup p body

-- | Guarded Right-Hand Sides
--   
--   GRHSs are used both for pattern bindings and for Matches
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnVbar</a>,
--   <a>AnnEqual</a>,<a>AnnWhere</a>, <a>AnnOpen</a>,<a>AnnClose</a>
--   <a>AnnRarrow</a>,<a>AnnSemi</a></li>
--   </ul>
data GRHSs p body
GRHSs :: XCGRHSs p body -> [LGRHS p body] -> LHsLocalBinds 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 -> LHsLocalBinds p
XGRHSs :: XXGRHSs p body -> GRHSs p body

-- | Syntax Expression
--   
--   SyntaxExpr is like <a>PostTcExpr</a>, but it's filled in a little
--   earlier, by the renamer. It's used for rebindable syntax.
--   
--   E.g. <tt>(&gt;&gt;=)</tt> is filled in before the renamer by the
--   appropriate <a>Name</a> for <tt>(&gt;&gt;=)</tt>, and then
--   instantiated by the type checker with its type args etc
--   
--   This should desugar to
--   
--   <pre>
--   syn_res_wrap $ syn_expr (syn_arg_wraps[0] arg0)
--                           (syn_arg_wraps[1] arg1) ...
--   </pre>
--   
--   where the actual arguments come from elsewhere in the AST. This could
--   be defined using <tt>GhcPass p</tt> and such, but it's harder to get
--   it all to work out that way. (<a>noSyntaxExpr</a> is hard to write,
--   for example.)
data SyntaxExpr p
SyntaxExpr :: HsExpr p -> [HsWrapper] -> HsWrapper -> SyntaxExpr p
[syn_expr] :: SyntaxExpr p -> HsExpr p
[syn_arg_wraps] :: SyntaxExpr p -> [HsWrapper]
[syn_res_wrap] :: SyntaxExpr p -> HsWrapper

-- | Located Haskell Expression
type LHsExpr p = Located HsExpr p

-- | Pattern
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnBang</a></li>
--   </ul>
data Pat p

-- | Wildcard Pattern The sole reason for a type on a WildPat is to support
--   hsPatType :: Pat Id -&gt; Type
WildPat :: XWildPat p -> Pat p

-- | Variable Pattern
VarPat :: XVarPat p -> Located (IdP p) -> Pat p

-- | Lazy Pattern ^ - <a>AnnKeywordId</a> : <a>AnnTilde</a>
LazyPat :: XLazyPat p -> LPat p -> Pat p

-- | As pattern ^ - <a>AnnKeywordId</a> : <a>AnnAt</a>
AsPat :: XAsPat p -> Located (IdP p) -> LPat p -> Pat p

-- | Parenthesised pattern See Note [Parens in HsSyn] in GHC.Hs.Expr ^ -
--   <a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'('</tt>, <a>AnnClose</a>
--   <tt>')'</tt>
ParPat :: XParPat p -> LPat p -> Pat p

-- | Bang pattern ^ - <a>AnnKeywordId</a> : <a>AnnBang</a>
BangPat :: XBangPat p -> LPat p -> Pat p

-- | Syntactic List
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'['</tt>, <a>AnnClose</a>
--   <tt>']'</tt></li>
--   </ul>
ListPat :: XListPat p -> [LPat p] -> Pat p

-- | Tuple sub-patterns
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'('</tt> or
--   <tt>'(#'</tt>, <a>AnnClose</a> <tt>')'</tt> or <tt>'#)'</tt></li>
--   </ul>
TuplePat :: XTuplePat p -> [LPat p] -> Boxity -> Pat p

-- | Anonymous sum pattern
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'(#'</tt>,
--   <a>AnnClose</a> <tt>'#)'</tt></li>
--   </ul>
SumPat :: XSumPat p -> LPat p -> ConTag -> Arity -> Pat p

-- | Constructor Pattern In
ConPatIn :: Located (IdP p) -> HsConPatDetails p -> Pat p

-- | Constructor Pattern Out
ConPatOut :: Located ConLike -> [Type] -> [TyVar] -> [EvVar] -> TcEvBinds -> HsConPatDetails p -> HsWrapper -> Pat p
[pat_con] :: Pat p -> Located ConLike
[pat_arg_tys] :: Pat p -> [Type]
[pat_tvs] :: Pat p -> [TyVar]
[pat_dicts] :: Pat p -> [EvVar]
[pat_binds] :: Pat p -> TcEvBinds
[pat_args] :: Pat p -> HsConPatDetails p
[pat_wrap] :: Pat p -> HsWrapper

-- | View Pattern
ViewPat :: XViewPat p -> LHsExpr p -> LPat p -> Pat p

-- | Splice Pattern (Includes quasi-quotes)
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
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnVal</a> <tt><a>+</a></tt></li>
--   </ul>
NPat :: XNPat p -> Located (HsOverLit p) -> Maybe (SyntaxExpr p) -> SyntaxExpr p -> Pat p

-- | n+k pattern
NPlusKPat :: XNPlusKPat p -> Located (IdP p) -> Located (HsOverLit p) -> HsOverLit p -> SyntaxExpr p -> SyntaxExpr p -> Pat p

-- | Pattern with a type signature
SigPat :: XSigPat p -> LPat p -> LHsSigWcType (NoGhcTc p) -> Pat p

-- | Coercion Pattern
CoPat :: XCoPat p -> HsWrapper -> Pat p -> Type -> Pat p

-- | Trees that Grow extension point for new constructors
XPat :: XXPat p -> Pat p
type LPat p = XRec p Pat

-- | Eliminate a <a>NoExtCon</a>. Much like <a>absurd</a>.
noExtCon :: NoExtCon -> a

-- | Used when constructing a term with an unused extension point.
noExtField :: NoExtField

-- | A placeholder type for TTG extension points that are not currently
--   unused to represent any particular value.
--   
--   This should not be confused with <a>NoExtCon</a>, which are found in
--   unused extension <i>constructors</i> and therefore should never be
--   inhabited. In contrast, <a>NoExtField</a> is used in extension
--   <i>points</i> (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 <a>NoExtCon</a> 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 <a>noExtCon</a>.
--   
--   This should not be confused with <a>NoExtField</a>, which are found in
--   unused extension <i>points</i> (not <i>constructors</i>) and therefore
--   can be inhabited.
data NoExtCon

-- | Used as a data type index for the hsSyn AST
data GhcPass (c :: Pass)
data Pass
Parsed :: Pass
Renamed :: Pass
Typechecked :: Pass
type GhcPs = GhcPass 'Parsed
type GhcRn = GhcPass 'Renamed
type GhcTc = GhcPass 'Typechecked
type GhcTcId = GhcTc

-- | GHC's L prefixed variants wrap their vanilla variant in this type
--   family, to add <tt>SrcLoc</tt> info via <a>Located</a>. Other passes
--   than <a>GhcPass</a> not interested in location information can define
--   this instance as <tt>f p</tt>.
type family XRec p (f :: Type -> Type) = (r :: Type) | r -> p f

-- | Maps the "normal" id type for a given pass
type family IdP p
type LIdP p = Located IdP p

-- | Marks that a field uses the GhcRn variant even when the pass parameter
--   is GhcTc. Useful for storing HsTypes in GHC.Hs.Exprs, say, because
--   HsType GhcTc should never occur.
type family NoGhcTc p
type family NoGhcTcPass (p :: Pass) :: Pass
type family XHsValBinds x x'
type family XHsIPBinds x x'
type family XEmptyLocalBinds x x'
type family XXHsLocalBindsLR x x'
type ForallXHsLocalBindsLR (c :: Type -> Constraint) x x' = (c XHsValBinds x x', c XHsIPBinds x x', c XEmptyLocalBinds x x', c XXHsLocalBindsLR x x')
type family XValBinds x x'
type family XXValBindsLR x x'
type ForallXValBindsLR (c :: Type -> Constraint) x x' = (c XValBinds x x', c XXValBindsLR x x')
type family XFunBind x x'
type family XPatBind x x'
type family XVarBind x x'
type family XAbsBinds x x'
type family XPatSynBind x x'
type family XXHsBindsLR x x'
type ForallXHsBindsLR (c :: Type -> Constraint) x x' = (c XFunBind x x', c XPatBind x x', c XVarBind x x', c XAbsBinds x x', c XPatSynBind x x', c XXHsBindsLR x x')
type family XABE x
type family XXABExport x
type ForallXABExport (c :: Type -> Constraint) x = (c XABE x, c XXABExport x)
type family XPSB x x'
type family XXPatSynBind x x'
type ForallXPatSynBind (c :: Type -> Constraint) x x' = (c XPSB x x', c XXPatSynBind x x')
type family XIPBinds x
type family XXHsIPBinds x
type ForallXHsIPBinds (c :: Type -> Constraint) x = (c XIPBinds x, c XXHsIPBinds x)
type family XCIPBind x
type family XXIPBind x
type ForallXIPBind (c :: Type -> Constraint) x = (c XCIPBind x, c XXIPBind x)
type family XTypeSig x
type family XPatSynSig x
type family XClassOpSig x
type family XIdSig x
type family XFixSig x
type family XInlineSig x
type family XSpecSig x
type family XSpecInstSig x
type family XMinimalSig x
type family XSCCFunSig x
type family XCompleteMatchSig x
type family XXSig x
type ForallXSig (c :: Type -> Constraint) x = (c XTypeSig x, c XPatSynSig x, c XClassOpSig x, c XIdSig x, c XFixSig x, c XInlineSig x, c XSpecSig x, c XSpecInstSig x, c XMinimalSig x, c XSCCFunSig x, c XCompleteMatchSig x, c XXSig x)
type family XFixitySig x
type family XXFixitySig x
type ForallXFixitySig (c :: Type -> Constraint) x = (c XFixitySig x, c XXFixitySig x)
type family XStandaloneKindSig x
type family XXStandaloneKindSig x
type family XTyClD x
type family XInstD x
type family XDerivD x
type family XValD x
type family XSigD x
type family XKindSigD x
type family XDefD x
type family XForD x
type family XWarningD x
type family XAnnD x
type family XRuleD x
type family XSpliceD x
type family XDocD x
type family XRoleAnnotD x
type family XXHsDecl x
type ForallXHsDecl (c :: Type -> Constraint) x = (c XTyClD x, c XInstD x, c XDerivD x, c XValD x, c XSigD x, c XKindSigD x, c XDefD x, c XForD x, c XWarningD x, c XAnnD x, c XRuleD x, c XSpliceD x, c XDocD x, c XRoleAnnotD x, c XXHsDecl x)
type family XCHsGroup x
type family XXHsGroup x
type ForallXHsGroup (c :: Type -> Constraint) x = (c XCHsGroup x, c XXHsGroup x)
type family XSpliceDecl x
type family XXSpliceDecl x
type ForallXSpliceDecl (c :: Type -> Constraint) x = (c XSpliceDecl x, c XXSpliceDecl x)
type family XFamDecl x
type family XSynDecl x
type family XDataDecl x
type family XClassDecl x
type family XXTyClDecl x
type ForallXTyClDecl (c :: Type -> Constraint) x = (c XFamDecl x, c XSynDecl x, c XDataDecl x, c XClassDecl x, c XXTyClDecl x)
type family XCTyClGroup x
type family XXTyClGroup x
type ForallXTyClGroup (c :: Type -> Constraint) x = (c XCTyClGroup x, c XXTyClGroup x)
type family XNoSig x
type family XCKindSig x
type family XTyVarSig x
type family XXFamilyResultSig x
type ForallXFamilyResultSig (c :: Type -> Constraint) x = (c XNoSig x, c XCKindSig x, c XTyVarSig x, c XXFamilyResultSig x)
type family XCFamilyDecl x
type family XXFamilyDecl x
type ForallXFamilyDecl (c :: Type -> Constraint) x = (c XCFamilyDecl x, c XXFamilyDecl x)
type family XCHsDataDefn x
type family XXHsDataDefn x
type ForallXHsDataDefn (c :: Type -> Constraint) x = (c XCHsDataDefn x, c XXHsDataDefn x)
type family XCHsDerivingClause x
type family XXHsDerivingClause x
type ForallXHsDerivingClause (c :: Type -> Constraint) x = (c XCHsDerivingClause x, c XXHsDerivingClause x)
type family XConDeclGADT x
type family XConDeclH98 x
type family XXConDecl x
type ForallXConDecl (c :: Type -> Constraint) x = (c XConDeclGADT x, c XConDeclH98 x, c XXConDecl x)
type family XCFamEqn x r
type family XXFamEqn x r
type ForallXFamEqn (c :: Type -> Constraint) x r = (c XCFamEqn x r, c XXFamEqn x r)
type family XCClsInstDecl x
type family XXClsInstDecl x
type ForallXClsInstDecl (c :: Type -> Constraint) x = (c XCClsInstDecl x, c XXClsInstDecl x)
type family XClsInstD x
type family XDataFamInstD x
type family XTyFamInstD x
type family XXInstDecl x
type ForallXInstDecl (c :: Type -> Constraint) x = (c XClsInstD x, c XDataFamInstD x, c XTyFamInstD x, c XXInstDecl x)
type family XCDerivDecl x
type family XXDerivDecl x
type ForallXDerivDecl (c :: Type -> Constraint) x = (c XCDerivDecl x, c XXDerivDecl x)
type family XViaStrategy x
type family XCDefaultDecl x
type family XXDefaultDecl x
type ForallXDefaultDecl (c :: Type -> Constraint) x = (c XCDefaultDecl x, c XXDefaultDecl x)
type family XForeignImport x
type family XForeignExport x
type family XXForeignDecl x
type ForallXForeignDecl (c :: Type -> Constraint) x = (c XForeignImport x, c XForeignExport x, c XXForeignDecl x)
type family XCRuleDecls x
type family XXRuleDecls x
type ForallXRuleDecls (c :: Type -> Constraint) x = (c XCRuleDecls x, c XXRuleDecls x)
type family XHsRule x
type family XXRuleDecl x
type ForallXRuleDecl (c :: Type -> Constraint) x = (c XHsRule x, c XXRuleDecl x)
type family XCRuleBndr x
type family XRuleBndrSig x
type family XXRuleBndr x
type ForallXRuleBndr (c :: Type -> Constraint) x = (c XCRuleBndr x, c XRuleBndrSig x, c XXRuleBndr x)
type family XWarnings x
type family XXWarnDecls x
type ForallXWarnDecls (c :: Type -> Constraint) x = (c XWarnings x, c XXWarnDecls x)
type family XWarning x
type family XXWarnDecl x
type ForallXWarnDecl (c :: Type -> Constraint) x = (c XWarning x, c XXWarnDecl x)
type family XHsAnnotation x
type family XXAnnDecl x
type ForallXAnnDecl (c :: Type -> Constraint) x = (c XHsAnnotation x, c XXAnnDecl x)
type family XCRoleAnnotDecl x
type family XXRoleAnnotDecl x
type ForallXRoleAnnotDecl (c :: Type -> Constraint) x = (c XCRoleAnnotDecl x, c XXRoleAnnotDecl x)
type family XVar x
type family XUnboundVar x
type family XConLikeOut x
type family XRecFld x
type family XOverLabel x
type family XIPVar x
type family XOverLitE x
type family XLitE x
type family XLam x
type family XLamCase x
type family XApp x
type family XAppTypeE x
type family XOpApp x
type family XNegApp x
type family XPar x
type family XSectionL x
type family XSectionR x
type family XExplicitTuple x
type family XExplicitSum x
type family XCase x
type family XIf x
type family XMultiIf x
type family XLet x
type family XDo x
type family XExplicitList x
type family XRecordCon x
type family XRecordUpd x
type family XExprWithTySig x
type family XArithSeq x
type family XSCC x
type family XCoreAnn x
type family XBracket x
type family XRnBracketOut x
type family XTcBracketOut x
type family XSpliceE x
type family XProc x
type family XStatic x
type family XTick x
type family XBinTick x
type family XTickPragma x
type family XWrap x
type family XXExpr x
type ForallXExpr (c :: Type -> Constraint) x = (c XVar x, c XUnboundVar x, c XConLikeOut x, c XRecFld x, c XOverLabel x, c XIPVar x, c XOverLitE x, c XLitE x, c XLam x, c XLamCase x, c XApp x, c XAppTypeE x, c XOpApp x, c XNegApp x, c XPar x, c XSectionL x, c XSectionR x, c XExplicitTuple x, c XExplicitSum x, c XCase x, c XIf x, c XMultiIf x, c XLet x, c XDo x, c XExplicitList x, c XRecordCon x, c XRecordUpd x, c XExprWithTySig x, c XArithSeq x, c XSCC x, c XCoreAnn x, c XBracket x, c XRnBracketOut x, c XTcBracketOut x, c XSpliceE x, c XProc x, c XStatic x, c XTick x, c XBinTick x, c XTickPragma x, c XWrap x, c XXExpr x)
type family XUnambiguous x
type family XAmbiguous x
type family XXAmbiguousFieldOcc x
type ForallXAmbiguousFieldOcc (c :: Type -> Constraint) x = (c XUnambiguous x, c XAmbiguous x, c XXAmbiguousFieldOcc x)
type family XPresent x
type family XMissing x
type family XXTupArg x
type ForallXTupArg (c :: Type -> Constraint) x = (c XPresent x, c XMissing x, c XXTupArg x)
type family XTypedSplice x
type family XUntypedSplice x
type family XQuasiQuote x
type family XSpliced x
type family XXSplice x
type ForallXSplice (c :: Type -> Constraint) x = (c XTypedSplice x, c XUntypedSplice x, c XQuasiQuote x, c XSpliced x, c XXSplice x)
type family XExpBr x
type family XPatBr x
type family XDecBrL x
type family XDecBrG x
type family XTypBr x
type family XVarBr x
type family XTExpBr x
type family XXBracket x
type ForallXBracket (c :: Type -> Constraint) x = (c XExpBr x, c XPatBr x, c XDecBrL x, c XDecBrG x, c XTypBr x, c XVarBr x, c XTExpBr x, c XXBracket x)
type family XCmdTop x
type family XXCmdTop x
type ForallXCmdTop (c :: Type -> Constraint) x = (c XCmdTop x, c XXCmdTop x)
type family XMG x b
type family XXMatchGroup x b
type ForallXMatchGroup (c :: Type -> Constraint) x b = (c XMG x b, c XXMatchGroup x b)
type family XCMatch x b
type family XXMatch x b
type ForallXMatch (c :: Type -> Constraint) x b = (c XCMatch x b, c XXMatch x b)
type family XCGRHSs x b
type family XXGRHSs x b
type ForallXGRHSs (c :: Type -> Constraint) x b = (c XCGRHSs x b, c XXGRHSs x b)
type family XCGRHS x b
type family XXGRHS x b
type ForallXGRHS (c :: Type -> Constraint) x b = (c XCGRHS x b, c XXGRHS x b)
type family XLastStmt x x' b
type family XBindStmt x x' b
type family XApplicativeStmt x x' b
type family XBodyStmt x x' b
type family XLetStmt x x' b
type family XParStmt x x' b
type family XTransStmt x x' b
type family XRecStmt x x' b
type family XXStmtLR x x' b
type ForallXStmtLR (c :: Type -> Constraint) x x' b = (c XLastStmt x x' b, c XBindStmt x x' b, c XApplicativeStmt x x' b, c XBodyStmt x x' b, c XLetStmt x x' b, c XParStmt x x' b, c XTransStmt x x' b, c XRecStmt x x' b, c XXStmtLR x x' b)
type family XCmdArrApp x
type family XCmdArrForm x
type family XCmdApp x
type family XCmdLam x
type family XCmdPar x
type family XCmdCase x
type family XCmdIf x
type family XCmdLet x
type family XCmdDo x
type family XCmdWrap x
type family XXCmd x
type ForallXCmd (c :: Type -> Constraint) x = (c XCmdArrApp x, c XCmdArrForm x, c XCmdApp x, c XCmdLam x, c XCmdPar x, c XCmdCase x, c XCmdIf x, c XCmdLet x, c XCmdDo x, c XCmdWrap x, c XXCmd x)
type family XParStmtBlock x x'
type family XXParStmtBlock x x'
type ForallXParStmtBlock (c :: Type -> Constraint) x x' = (c XParStmtBlock x x', c XXParStmtBlock x x')
type family XApplicativeArgOne x
type family XApplicativeArgMany x
type family XXApplicativeArg x
type ForallXApplicativeArg (c :: Type -> Constraint) x = (c XApplicativeArgOne x, c XApplicativeArgMany x, c XXApplicativeArg x)
type family XHsChar x
type family XHsCharPrim x
type family XHsString x
type family XHsStringPrim x
type family XHsInt x
type family XHsIntPrim x
type family XHsWordPrim x
type family XHsInt64Prim x
type family XHsWord64Prim x
type family XHsInteger x
type family XHsRat x
type family XHsFloatPrim x
type family XHsDoublePrim x
type family XXLit x

-- | Helper to apply a constraint to all extension points. It has one entry
--   per extension point type family.
type ForallXHsLit (c :: Type -> Constraint) x = (c XHsChar x, c XHsCharPrim x, c XHsDoublePrim x, c XHsFloatPrim x, c XHsInt x, c XHsInt64Prim x, c XHsIntPrim x, c XHsInteger x, c XHsRat x, c XHsString x, c XHsStringPrim x, c XHsWord64Prim x, c XHsWordPrim x, c XXLit x)
type family XOverLit x
type family XXOverLit x
type ForallXOverLit (c :: Type -> Constraint) x = (c XOverLit x, c XXOverLit x)
type family XWildPat x
type family XVarPat x
type family XLazyPat x
type family XAsPat x
type family XParPat x
type family XBangPat x
type family XListPat x
type family XTuplePat x
type family XSumPat x
type family XConPat x
type family XViewPat x
type family XSplicePat x
type family XLitPat x
type family XNPat x
type family XNPlusKPat x
type family XSigPat x
type family XCoPat x
type family XXPat x
type ForallXPat (c :: Type -> Constraint) x = (c XWildPat x, c XVarPat x, c XLazyPat x, c XAsPat x, c XParPat x, c XBangPat x, c XListPat x, c XTuplePat x, c XSumPat x, c XViewPat x, c XSplicePat x, c XLitPat x, c XNPat x, c XNPlusKPat x, c XSigPat x, c XCoPat x, c XXPat x)
type family XHsQTvs x
type family XXLHsQTyVars x
type ForallXLHsQTyVars (c :: Type -> Constraint) x = (c XHsQTvs x, c XXLHsQTyVars x)
type family XHsIB x b
type family XXHsImplicitBndrs x b
type ForallXHsImplicitBndrs (c :: Type -> Constraint) x b = (c XHsIB x b, c XXHsImplicitBndrs x b)
type family XHsWC x b
type family XXHsWildCardBndrs x b
type ForallXHsWildCardBndrs (c :: Type -> Constraint) x b = (c XHsWC x b, c XXHsWildCardBndrs x b)
type family XForAllTy x
type family XQualTy x
type family XTyVar x
type family XAppTy x
type family XAppKindTy x
type family XFunTy x
type family XListTy x
type family XTupleTy x
type family XSumTy x
type family XOpTy x
type family XParTy x
type family XIParamTy x
type family XStarTy x
type family XKindSig x
type family XSpliceTy x
type family XDocTy x
type family XBangTy x
type family XRecTy x
type family XExplicitListTy x
type family XExplicitTupleTy x
type family XTyLit x
type family XWildCardTy x
type family XXType x

-- | Helper to apply a constraint to all extension points. It has one entry
--   per extension point type family.
type ForallXType (c :: Type -> Constraint) x = (c XForAllTy x, c XQualTy x, c XTyVar x, c XAppTy x, c XAppKindTy x, c XFunTy x, c XListTy x, c XTupleTy x, c XSumTy x, c XOpTy x, c XParTy x, c XIParamTy x, c XStarTy x, c XKindSig x, c XSpliceTy x, c XDocTy x, c XBangTy x, c XRecTy x, c XExplicitListTy x, c XExplicitTupleTy x, c XTyLit x, c XWildCardTy x, c XXType x)
type family XUserTyVar x
type family XKindedTyVar x
type family XXTyVarBndr x
type ForallXTyVarBndr (c :: Type -> Constraint) x = (c XUserTyVar x, c XKindedTyVar x, c XXTyVarBndr x)
type family XConDeclField x
type family XXConDeclField x
type ForallXConDeclField (c :: Type -> Constraint) x = (c XConDeclField x, c XXConDeclField x)
type family XCFieldOcc x
type family XXFieldOcc x
type ForallXFieldOcc (c :: Type -> Constraint) x = (c XCFieldOcc x, c XXFieldOcc x)
type family XCImportDecl x
type family XXImportDecl x
type ForallXImportDecl (c :: Type -> Constraint) x = (c XCImportDecl x, c XXImportDecl x)
type family XIEVar x
type family XIEThingAbs x
type family XIEThingAll x
type family XIEThingWith x
type family XIEModuleContents x
type family XIEGroup x
type family XIEDoc x
type family XIEDocNamed x
type family XXIE x
type ForallXIE (c :: Type -> Constraint) x = (c XIEVar x, c XIEThingAbs x, c XIEThingAll x, c XIEThingWith x, c XIEModuleContents x, c XIEGroup x, c XIEDoc x, c XIEDocNamed x, c XXIE x)

-- | Conversion of annotations from one type index to another. This is
--   required where the AST is converted from one pass to another, and the
--   extension values need to be brought along if possible. So for example
--   a <tt>SourceText</tt> is converted via <a>id</a>, but needs a type
--   signature to keep the type checker happy.
class Convertable a b | a -> b
convert :: Convertable a b => a -> b

-- | A constraint capturing all the extension points that can be converted
--   via <tt>instance Convertable a a</tt>
type ConvertIdX a b = (XHsDoublePrim a ~ XHsDoublePrim b, XHsFloatPrim a ~ XHsFloatPrim b, XHsRat a ~ XHsRat b, XHsInteger a ~ XHsInteger b, XHsWord64Prim a ~ XHsWord64Prim b, XHsInt64Prim a ~ XHsInt64Prim b, XHsWordPrim a ~ XHsWordPrim b, XHsIntPrim a ~ XHsIntPrim b, XHsInt a ~ XHsInt b, XHsStringPrim a ~ XHsStringPrim b, XHsString a ~ XHsString b, XHsCharPrim a ~ XHsCharPrim b, XHsChar a ~ XHsChar b, XXLit a ~ XXLit b)

-- | Provide a summary constraint that gives all am Outputable constraint
--   to extension points needing one
type OutputableX p = (Outputable XIPBinds p, Outputable XViaStrategy p, Outputable XViaStrategy GhcRn)

-- | Constraint type to bundle up the requirement for <a>OutputableBndr</a>
--   on both the <tt>p</tt> and the <a>NameOrRdrName</a> type for it
type OutputableBndrId (pass :: Pass) = (OutputableBndr NameOrRdrName IdP GhcPass pass, OutputableBndr IdP GhcPass pass, OutputableBndr NameOrRdrName IdP NoGhcTc GhcPass pass, OutputableBndr IdP NoGhcTc GhcPass pass, NoGhcTc GhcPass pass ~ NoGhcTc NoGhcTc GhcPass pass, OutputableX GhcPass pass, OutputableX NoGhcTc GhcPass pass)

-- | <tt>isExportedIdVar</tt> means "don't throw this away"
isExportedId :: Var -> Bool
isGlobalId :: Var -> Bool
isLocalId :: Var -> Bool

-- | Is this a value-level (i.e., computationally relevant)
--   <a>Id</a>entifier? Satisfies <tt>isId = not . isTyVar</tt>.
isId :: Var -> Bool

-- | Is this a type-level (i.e., computationally irrelevant, thus erasable)
--   variable? Satisfies <tt>isTyVar = not . isId</tt>.
isTyVar :: Var -> Bool

-- | If it's a local, make it global
globaliseId :: Id -> Id
idDetails :: Id -> IdDetails
idInfo :: HasDebugCallStack => Id -> IdInfo
tyVarKind :: TyVar -> Kind

-- | Make many named binders Input vars should be type variables
mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder]

-- | Make many named binders
mkTyCoVarBinders :: ArgFlag -> [TyCoVar] -> [TyCoVarBinder]

-- | Make a named binder
mkTyCoVarBinder :: ArgFlag -> TyCoVar -> TyCoVarBinder
binderType :: VarBndr TyCoVar argf -> Type
binderArgFlag :: VarBndr tv argf -> argf
binderVars :: [VarBndr tv argf] -> [tv]
binderVar :: VarBndr tv argf -> tv

-- | Do these denote the same level of visibility? <a>Required</a>
--   arguments are visible, others are not. So this function equates
--   <a>Specified</a> and <a>Inferred</a>. Used for printing.
sameVis :: ArgFlag -> ArgFlag -> Bool

-- | Does this <a>ArgFlag</a> classify an argument that is not written in
--   Haskell?
isInvisibleArgFlag :: ArgFlag -> Bool

-- | Does this <a>ArgFlag</a> classify an argument that is written in
--   Haskell?
isVisibleArgFlag :: ArgFlag -> Bool

-- | Identifier
type Id = Var

-- | Type or kind Variable
type TyVar = Var

-- | Type variable that might be a metavariable
type TcTyVar = Var

-- | Dictionary Function Identifier
type DFunId = Id
type JoinId = Id

-- | Type or Coercion Variable
type TyCoVar = Id
type InVar = Var
type InId = Id
type OutVar = Var
type OutId = Id

-- | Is a <tt>forall</tt> invisible (e.g., <tt>forall a b. {...}</tt>, with
--   a dot) or visible (e.g., <tt>forall a b -&gt; {...}</tt>, with an
--   arrow)?
data ForallVisFlag

-- | A visible <tt>forall</tt> (with an arrow)
ForallVis :: ForallVisFlag

-- | An invisible <tt>forall</tt> (with a dot)
ForallInvis :: ForallVisFlag

-- | Variable Binder
--   
--   A <a>TyCoVarBinder</a> is the binder of a ForAllTy It's convenient to
--   define this synonym here rather its natural home in TyCoRep, because
--   it's used in DataCon.hs-boot
--   
--   A <a>TyVarBinder</a> is a binder with only TyVar
type TyCoVarBinder = VarBndr TyCoVar ArgFlag
type TyVarBinder = VarBndr TyVar ArgFlag
nilDataConKey :: Unique
listTyConKey :: Unique
extendDNameEnv :: DNameEnv a -> Name -> a -> DNameEnv a
alterDNameEnv :: (Maybe a -> Maybe a) -> DNameEnv a -> Name -> DNameEnv a
adjustDNameEnv :: (a -> a) -> DNameEnv a -> Name -> DNameEnv a
mapDNameEnv :: (a -> b) -> DNameEnv a -> DNameEnv b
filterDNameEnv :: (a -> Bool) -> DNameEnv a -> DNameEnv a
delFromDNameEnv :: DNameEnv a -> Name -> DNameEnv a
lookupDNameEnv :: DNameEnv a -> Name -> Maybe a
emptyDNameEnv :: DNameEnv a
lookupNameEnv_NF :: NameEnv a -> Name -> a
disjointNameEnv :: NameEnv a -> NameEnv a -> Bool
anyNameEnv :: (elt -> Bool) -> NameEnv elt -> Bool
filterNameEnv :: (elt -> Bool) -> NameEnv elt -> NameEnv elt
delListFromNameEnv :: NameEnv a -> [Name] -> NameEnv a
delFromNameEnv :: NameEnv a -> Name -> NameEnv a
extendNameEnvList_C :: (a -> a -> a) -> NameEnv a -> [(Name, a)] -> NameEnv a
extendNameEnv_Acc :: (a -> b -> b) -> (a -> b) -> NameEnv b -> Name -> a -> NameEnv b
mapNameEnv :: (elt1 -> elt2) -> NameEnv elt1 -> NameEnv elt2
extendNameEnv_C :: (a -> a -> a) -> NameEnv a -> Name -> a -> NameEnv a
plusNameEnv_C :: (a -> a -> a) -> NameEnv a -> NameEnv a -> NameEnv a
plusNameEnv :: NameEnv a -> NameEnv a -> NameEnv a
elemNameEnv :: Name -> NameEnv a -> Bool
mkNameEnvWith :: (a -> Name) -> [a] -> NameEnv a
mkNameEnv :: [(Name, a)] -> NameEnv a
alterNameEnv :: (Maybe a -> Maybe a) -> NameEnv a -> Name -> NameEnv a
lookupNameEnv :: NameEnv a -> Name -> Maybe a
extendNameEnvList :: NameEnv a -> [(Name, a)] -> NameEnv a
extendNameEnv :: NameEnv a -> Name -> a -> NameEnv a
unitNameEnv :: Name -> a -> NameEnv a
isEmptyNameEnv :: NameEnv a -> Bool
emptyNameEnv :: NameEnv a
nameEnvElts :: NameEnv a -> [a]
depAnal :: (node -> [Name]) -> (node -> [Name]) -> [node] -> [SCC node]

-- | Name Environment
type NameEnv a = UniqFM a

-- | Deterministic Name Environment
--   
--   See Note [Deterministic UniqFM] in UniqDFM for explanation why we need
--   DNameEnv.
type DNameEnv a = UniqDFM a
listTyCon :: TyCon
typeSymbolKind :: Kind
typeNatKind :: Kind

-- | Build the type of a small tuple that holds the specified type of thing
--   Flattens 1-tuples. See Note [One-tuples].
mkBoxedTupleTy :: [Type] -> Type
heqTyCon :: TyCon
coercibleTyCon :: TyCon
unitTy :: Type
liftedTypeKind :: Kind
constraintKind :: Kind
vecElemTyCon :: TyCon
vecCountTyCon :: TyCon
runtimeRepTyCon :: TyCon
runtimeRepTy :: Type
tupleRepDataConTyCon :: TyCon
vecRepDataConTyCon :: TyCon
liftedRepDataConTyCon :: TyCon
doubleRepDataConTy :: Type
floatRepDataConTy :: Type
addrRepDataConTy :: Type
word64RepDataConTy :: Type
word32RepDataConTy :: Type
word16RepDataConTy :: Type
word8RepDataConTy :: Type
wordRepDataConTy :: Type
int64RepDataConTy :: Type
int32RepDataConTy :: Type
int16RepDataConTy :: Type
int8RepDataConTy :: Type
intRepDataConTy :: Type
unliftedRepDataConTy :: Type
liftedRepDataConTy :: Type
vec64DataConTy :: Type
vec32DataConTy :: Type
vec16DataConTy :: Type
vec8DataConTy :: Type
vec4DataConTy :: Type
vec2DataConTy :: Type
doubleElemRepDataConTy :: Type
floatElemRepDataConTy :: Type
word64ElemRepDataConTy :: Type
word32ElemRepDataConTy :: Type
word16ElemRepDataConTy :: Type
word8ElemRepDataConTy :: Type
int64ElemRepDataConTy :: Type
int32ElemRepDataConTy :: Type
int16ElemRepDataConTy :: Type
int8ElemRepDataConTy :: Type
anyTypeOfKind :: Kind -> Type

-- | Specialization of <a>unboxedTupleSumKind</a> for tuples
unboxedTupleKind :: [Type] -> Kind

-- | Make a *promoted* list.
mkPromotedListTy :: Kind -> [Type] -> Type
tupleTyConName :: TupleSort -> Arity -> Name
unitTyConKey :: Unique
pprPrefixName :: NamedThing a => a -> SDoc
pprInfixName :: (Outputable a, NamedThing a) => a -> SDoc
getOccFS :: NamedThing a => a -> FastString
getOccString :: NamedThing a => a -> String
getSrcSpan :: NamedThing a => a -> SrcSpan
getSrcLoc :: NamedThing a => a -> SrcLoc

-- | Get a string representation of a <a>Name</a> 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
pprNameDefnLoc :: Name -> SDoc
pprDefinedAt :: Name -> SDoc
pprModulePrefix :: PprStyle -> Module -> OccName -> SDoc

-- | Print the string of Name unqualifiedly directly.
pprNameUnqualified :: Name -> SDoc

-- | Compare Names lexicographically This only works for Names that
--   originate in the source code or have been tidied.
stableNameCmp :: Name -> Name -> Ordering

-- | Make the <a>Name</a> into an internal name, regardless of what it was
--   to begin with
localiseName :: Name -> Name
tidyNameOcc :: Name -> OccName -> Name
setNameLoc :: Name -> SrcSpan -> Name
setNameUnique :: Name -> Unique -> Name

-- | Make a name for a foreign call
mkFCallName :: Unique -> String -> Name
mkSysTvName :: Unique -> FastString -> Name
mkSystemVarName :: Unique -> FastString -> Name
mkSystemNameAt :: Unique -> OccName -> SrcSpan -> Name

-- | Create a name brought into being by the compiler
mkSystemName :: Unique -> OccName -> Name

-- | Create a name which is actually defined by the compiler itself
mkWiredInName :: Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> 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

-- | Create a name which is (for now at least) local to the current module
--   and hence does not need a <a>Module</a> to disambiguate it from other
--   <a>Name</a>s
mkInternalName :: Unique -> OccName -> SrcSpan -> Name
isSystemName :: Name -> Bool
isVarName :: Name -> Bool
isValName :: Name -> Bool
isDataConName :: Name -> Bool
isTyConName :: Name -> Bool
isTyVarName :: Name -> Bool

-- | Returns True if the Name comes from some other package: neither this
--   package nor the interactive package.
nameIsFromExternalPackage :: UnitId -> Name -> Bool
nameIsHomePackageImport :: Module -> Name -> Bool
nameIsHomePackage :: Module -> Name -> Bool

-- | Returns True if the name is (a) Internal (b) External but from the
--   specified module (c) External but from the <tt>interactive</tt>
--   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 <tt>interactive</tt> package; and all the
--   details are kept in the TcLclEnv, TcGblEnv, NOT in the HPT or EPT. See
--   Note [The interactive package] in HscTypes
nameIsLocalOrFrom :: Module -> Name -> Bool
nameModule_maybe :: Name -> Maybe Module
nameModule :: HasDebugCallStack => Name -> Module
isHoleName :: Name -> Bool
isInternalName :: Name -> Bool
isExternalName :: Name -> Bool
isBuiltInSyntax :: Name -> Bool
wiredInNameTyThing_maybe :: Name -> Maybe TyThing
isWiredInName :: Name -> Bool
nameSrcSpan :: Name -> SrcSpan
nameSrcLoc :: Name -> SrcLoc
nameNameSpace :: Name -> NameSpace
nameOccName :: Name -> OccName
nameUnique :: Name -> Unique

-- | BuiltInSyntax is for things like <tt>(:)</tt>, <tt>[]</tt> and tuples,
--   which have special syntactic forms. They aren't in scope as such.
data BuiltInSyntax
BuiltInSyntax :: BuiltInSyntax
UserSyntax :: BuiltInSyntax

-- | A class allowing convenient access to the <a>Name</a> of various
--   datatypes
class NamedThing a
getOccName :: NamedThing a => a -> OccName
getName :: NamedThing a => a -> Name
pprTcTyVarDetails :: TcTyVarDetails -> SDoc
vanillaSkolemTv :: TcTyVarDetails
tcSplitIOType_maybe :: Type -> Maybe (TyCon, Type)
data MetaDetails
Flexi :: MetaDetails
Indirect :: TcType -> MetaDetails
data TcTyVarDetails
SkolemTv :: TcLevel -> Bool -> TcTyVarDetails
RuntimeUnk :: TcTyVarDetails
MetaTv :: MetaInfo -> IORef MetaDetails -> TcLevel -> TcTyVarDetails
[mtv_info] :: TcTyVarDetails -> MetaInfo
[mtv_ref] :: TcTyVarDetails -> IORef MetaDetails
[mtv_tclvl] :: TcTyVarDetails -> TcLevel
pprType :: Type -> SDoc
pprKind :: Kind -> SDoc
isPredTy :: HasDebugCallStack => Type -> Bool
isCoercionTy :: Type -> Bool

-- | Applies a type to another, as in e.g. <tt>k a</tt>
mkAppTy :: Type -> Type -> Type

-- | Make a <a>CastTy</a>. The Coercion must be nominal. Checks the
--   Coercion for reflexivity, dropping it if it's reflexive. See Note
--   [Respecting definitional equality] in TyCoRep
mkCastTy :: Type -> Coercion -> Type
piResultTy :: HasDebugCallStack => Type -> Type -> Type

-- | Type equality on source types. Does not look through <tt>newtypes</tt>
--   or <a>PredType</a>s, 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
--   <tt>Type</tt>, there is no need to check the types of kinds.) See also
--   Note [Non-trivial definitional equality] in TyCoRep.
eqType :: Type -> Type -> Bool

-- | This function Strips off the <i>top layer only</i> of a type synonym
--   application (if any) its underlying representation type. Returns
--   Nothing if there is nothing to look through. This function considers
--   <tt>Constraint</tt> to be a synonym of <tt>TYPE LiftedRep</tt>.
--   
--   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

-- | Gives the typechecker view of a type. This unwraps synonyms but leaves
--   <tt>Constraint</tt> alone. c.f. coreView, which turns Constraint into
--   TYPE LiftedRep. Returns Nothing if no unwrapping happens. See also
--   Note [coreView vs tcView]
tcView :: Type -> Maybe Type

-- | Is this the type <a>RuntimeRep</a>?
isRuntimeRepTy :: 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

-- | 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])

-- | Given a <a>TyCon</a> and a list of argument types, partition the
--   arguments into:
--   
--   <ol>
--   <li><a>Inferred</a> or <a>Specified</a> (i.e., invisible) arguments
--   and</li>
--   <li><a>Required</a> (i.e., visible) arguments</li>
--   </ol>
partitionInvisibleTypes :: TyCon -> [Type] -> ([Type], [Type])
mkFunTy :: AnonArgFlag -> Type -> Type -> Type
infixr 3 `mkFunTy`

-- | Like <tt>mkTyCoForAllTy</tt>, but does not check the occurrence of the
--   binder See Note [Unused coercion variable in ForAllTy]
mkForAllTy :: TyCoVar -> ArgFlag -> Type -> Type
data Type

-- | Vanilla type or kind variable (*never* a coercion variable)
TyVarTy :: Var -> Type

-- | Type application to something other than a <a>TyCon</a>. Parameters:
--   
--   1) Function: must <i>not</i> be a <a>TyConApp</a> or <a>CastTy</a>,
--   must be another <a>AppTy</a>, or <a>TyVarTy</a> See Note <a>Respecting
--   definitional equality</a> about the no <a>CastTy</a> requirement
--   
--   2) Argument type
AppTy :: Type -> Type -> Type

-- | Application of a <a>TyCon</a>, including newtypes <i>and</i> synonyms.
--   Invariant: saturated applications of <tt>FunTyCon</tt> must use
--   <a>FunTy</a> and saturated synonyms must use their own constructors.
--   However, <i>unsaturated</i> <tt>FunTyCon</tt>s do appear as
--   <a>TyConApp</a>s. Parameters:
--   
--   1) Type constructor being applied to.
--   
--   2) Type arguments. Might not have enough type arguments here to
--   saturate the constructor. Even type synonyms are not necessarily
--   saturated; for example unsaturated type synonyms can appear as the
--   right hand side of a type synonym.
TyConApp :: TyCon -> [KindOrType] -> Type

-- | A Π type.
ForAllTy :: {-# UNPACK #-} !TyCoVarBinder -> Type -> Type

-- | t1 -&gt; t2 Very common, so an important special case See Note
--   [Function types]
FunTy :: AnonArgFlag -> Type -> Type -> Type
[ft_af] :: Type -> AnonArgFlag
[ft_arg] :: Type -> Type
[ft_res] :: Type -> Type

-- | Type literals are similar to type constructors.
LitTy :: TyLit -> Type

-- | A kind cast. The coercion is always nominal. INVARIANT: The cast is
--   never refl. INVARIANT: The Type is not a CastTy (use TransCo instead)
--   See Note <a>Respecting definitional equality</a> and (EQ3)
CastTy :: Type -> KindCoercion -> Type

-- | Injection of a Coercion into a type This should only ever be used in
--   the RHS of an AppTy, in the list of a TyConApp, when applying a
--   promoted GADT data constructor
CoercionTy :: Coercion -> Type

-- | A global typecheckable-thing, essentially anything that has a name.
--   Not to be confused with a <tt>TcTyThing</tt>, which is also a
--   typecheckable thing but in the *local* context. See <tt>TcEnv</tt> for
--   how to retrieve a <a>TyThing</a> given a <a>Name</a>.
data TyThing
AnId :: Id -> TyThing
AConLike :: ConLike -> TyThing
ATyCon :: TyCon -> TyThing
ACoAxiom :: CoAxiom Branched -> TyThing

-- | A <a>Coercion</a> is concrete evidence of the equality/convertibility
--   of two types.
data Coercion
Refl :: Type -> Coercion
GRefl :: Role -> Type -> MCoercionN -> Coercion
TyConAppCo :: Role -> TyCon -> [Coercion] -> Coercion
AppCo :: Coercion -> CoercionN -> Coercion
ForAllCo :: TyCoVar -> KindCoercion -> Coercion -> Coercion
FunCo :: Role -> Coercion -> Coercion -> Coercion
CoVarCo :: CoVar -> Coercion
AxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion
AxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion
UnivCo :: UnivCoProvenance -> Role -> Type -> Type -> Coercion
SymCo :: Coercion -> Coercion
TransCo :: Coercion -> Coercion -> Coercion
NthCo :: Role -> Int -> Coercion -> Coercion
LRCo :: LeftOrRight -> CoercionN -> Coercion
InstCo :: Coercion -> CoercionN -> Coercion
KindCo :: Coercion -> Coercion
SubCo :: CoercionN -> Coercion

-- | See Note [Coercion holes] Only present during typechecking
HoleCo :: CoercionHole -> Coercion

-- | For simplicity, we have just one UnivCo that represents a coercion
--   from some type to some other type, with (in general) no restrictions
--   on the type. The UnivCoProvenance specifies more exactly what the
--   coercion really is and why a program should (or shouldn't!) trust the
--   coercion. It is reasonable to consider each constructor of
--   <a>UnivCoProvenance</a> as a totally independent coercion form; their
--   only commonality is that they don't tell you what types they coercion
--   between. (That info is in the <a>UnivCo</a> constructor of
--   <a>Coercion</a>.
data UnivCoProvenance

-- | From <tt>unsafeCoerce#</tt>. These are unsound.
UnsafeCoerceProv :: UnivCoProvenance

-- | See Note [Phantom coercions]. Only in Phantom roled coercions
PhantomProv :: KindCoercion -> UnivCoProvenance

-- | From the fact that any two coercions are considered equivalent. See
--   Note [ProofIrrelProv]. Can be used in Nominal or Representational
--   coercions
ProofIrrelProv :: KindCoercion -> UnivCoProvenance

-- | From a plugin, which asserts that this coercion is sound. The string
--   is for the use of the plugin.
PluginProv :: String -> UnivCoProvenance
data TyLit
NumTyLit :: Integer -> TyLit
StrTyLit :: FastString -> TyLit

-- | A <a>TyCoBinder</a> represents an argument to a function. TyCoBinders
--   can be dependent (<a>Named</a>) or nondependent (<a>Anon</a>). They
--   may also be visible or not. See Note [TyCoBinders]
data TyCoBinder
Named :: TyCoVarBinder -> TyCoBinder
Anon :: AnonArgFlag -> Type -> TyCoBinder

-- | A semantically more meaningful type to represent what may or may not
--   be a useful <a>Coercion</a>.
data MCoercion
MRefl :: MCoercion
MCo :: Coercion -> MCoercion

-- | A type of the form <tt>p</tt> of constraint kind represents a value
--   whose type is the Haskell predicate <tt>p</tt>, where a predicate is
--   what occurs before the <tt>=&gt;</tt> in a Haskell type.
--   
--   We use <a>PredType</a> as documentation to mark those types that we
--   guarantee to have this kind.
--   
--   It can be expanded into its representation, but:
--   
--   <ul>
--   <li>The type checker must treat it as opaque</li>
--   <li>The rest of the compiler treats it as transparent</li>
--   </ul>
--   
--   Consider these examples:
--   
--   <pre>
--   f :: (Eq a) =&gt; a -&gt; Int
--   g :: (?x :: Int -&gt; Int) =&gt; a -&gt; Int
--   h :: (r\l) =&gt; {r} =&gt; {l::Int | r}
--   </pre>
--   
--   Here the <tt>Eq a</tt> and <tt>?x :: Int -&gt; Int</tt> and
--   <tt>rl</tt> are all called "predicates"
type PredType = Type

-- | The key type representing kinds in the compiler.
type Kind = Type

-- | A collection of <a>PredType</a>s
type ThetaType = [PredType]
type CoercionN = Coercion
type MCoercionN = MCoercion

-- | Argument Flag
--   
--   Is something required to appear in source Haskell (<a>Required</a>),
--   permitted by request (<a>Specified</a>) (visible type application), or
--   prohibited entirely from appearing in source Haskell
--   (<a>Inferred</a>)? See Note [VarBndrs, TyCoVarBinders, TyConBinders,
--   and visibility] in TyCoRep
data ArgFlag
Inferred :: ArgFlag
Specified :: ArgFlag
Required :: ArgFlag

-- | The non-dependent version of <a>ArgFlag</a>.
data AnonArgFlag

-- | Used for <tt>(-&gt;)</tt>: an ordinary non-dependent arrow. The
--   argument is visible in source code.
VisArg :: AnonArgFlag

-- | Used for <tt>(=&gt;)</tt>: a non-dependent predicate arrow. The
--   argument is invisible in source code.
InvisArg :: AnonArgFlag

-- | Variable
--   
--   Essentially a typed <a>Name</a>, that may also contain some additional
--   information about the <a>Var</a> and its use sites.
data Var

-- | Perform a computation with an altered environment
updEnv :: (env -> env') -> IOEnv env' a -> IOEnv env a

-- | Perform a computation with a different environment
setEnv :: env' -> IOEnv env' a -> IOEnv env a
getEnv :: IOEnv env env

-- | Strict variant of <a>atomicUpdMutVar</a>.
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 <a>atomicUpdMutVar'</a>.
atomicUpdMutVar :: IORef a -> (a -> (a, b)) -> IOEnv env b
updMutVar :: IORef a -> (a -> a) -> IOEnv env ()
readMutVar :: IORef a -> IOEnv env a
writeMutVar :: IORef a -> a -> IOEnv env ()
newMutVar :: a -> IOEnv env (IORef a)
uninterruptibleMaskM_ :: IOEnv env a -> IOEnv env a
unsafeInterleaveM :: IOEnv env a -> IOEnv env a
tryMostM :: IOEnv env r -> IOEnv env (Either SomeException r)
tryAllM :: IOEnv env r -> IOEnv env (Either SomeException r)
tryM :: IOEnv env r -> IOEnv env (Either IOEnvFailure r)
fixM :: (a -> IOEnv env a) -> IOEnv env a
runIOEnv :: env -> IOEnv env a -> IO a
failWithM :: String -> IOEnv env a
failM :: IOEnv env a
data IOEnv env a
data IOEnvFailure
IOEnvFailure :: IOEnvFailure
tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
initTidyOccEnv :: [OccName] -> TidyOccEnv
emptyTidyOccEnv :: TidyOccEnv
mkMethodOcc :: OccName -> OccName
mkDataCOcc :: OccName -> OccSet -> OccName
mkDataTOcc :: OccName -> OccSet -> OccName
mkDFunOcc :: String -> Bool -> OccSet -> OccName

-- | Derive a name for the representation type constructor of a
--   <tt>data</tt>/<tt>newtype</tt> instance.
mkInstTyTcOcc :: String -> OccSet -> OccName
mkLocalOcc :: Unique -> OccName -> OccName
mkSuperDictSelOcc :: Int -> OccName -> OccName
mkSuperDictAuxOcc :: Int -> OccName -> OccName
mkDataConWorkerOcc :: OccName -> OccName
mkRecFldSelOcc :: String -> OccName
mkGen1R :: OccName -> OccName
mkGenR :: OccName -> OccName
mkTyConRepOcc :: OccName -> OccName
mkMaxTagOcc :: OccName -> OccName
mkTag2ConOcc :: OccName -> OccName
mkCon2TagOcc :: OccName -> OccName
mkEqPredCoOcc :: OccName -> OccName
mkInstTyCoOcc :: OccName -> OccName
mkNewTyCoOcc :: OccName -> OccName
mkClassDataConOcc :: OccName -> OccName
mkRepEqOcc :: OccName -> OccName
mkForeignExportOcc :: OccName -> OccName
mkSpecOcc :: OccName -> OccName
mkIPOcc :: OccName -> OccName
mkDictOcc :: OccName -> OccName
mkClassOpAuxOcc :: OccName -> OccName
mkDefaultMethodOcc :: OccName -> OccName
mkBuilderOcc :: OccName -> OccName
mkMatcherOcc :: OccName -> OccName
mkWorkerOcc :: OccName -> OccName
mkDataConWrapperOcc :: OccName -> OccName

-- | Is an <a>OccName</a> one of a Typeable <tt>TyCon</tt> or
--   <tt>Module</tt> binding? This is needed as these bindings are renamed
--   differently. See Note [Grand plan for Typeable] in TcTypeable.
isTypeableBindOcc :: OccName -> Bool
isDefaultMethodOcc :: OccName -> Bool

-- | Test for definitions internally generated by GHC. This predicte is
--   used to suppress printing of internal definitions in some debug prints
isDerivedOccName :: OccName -> Bool

-- | Haskell 98 encourages compilers to suppress warnings about unsed names
--   in a pattern if they start with <tt>_</tt>: this implements that test
startsWithUnderscore :: OccName -> Bool

-- | Wrap parens around an operator
parenSymOcc :: OccName -> SDoc -> SDoc

-- | Test if the <a>OccName</a> is that for any operator (whether it is a
--   data constructor or variable or whatever)
isSymOcc :: OccName -> Bool

-- | Test if the <a>OccName</a> is a data constructor that starts with a
--   symbol (e.g. <tt>:</tt>, or <tt>[]</tt>)
isDataSymOcc :: OccName -> Bool
isDataOcc :: OccName -> Bool

-- | <i>Value</i> <tt>OccNames</tt>s are those that are either in the
--   variable or data constructor namespaces
isValOcc :: OccName -> Bool
isTcOcc :: OccName -> Bool
isTvOcc :: OccName -> Bool
isVarOcc :: OccName -> Bool
setOccNameSpace :: NameSpace -> OccName -> OccName
occNameString :: OccName -> String
filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
intersectsOccSet :: OccSet -> OccSet -> Bool
intersectOccSet :: OccSet -> OccSet -> OccSet
isEmptyOccSet :: OccSet -> Bool
elemOccSet :: OccName -> OccSet -> Bool
minusOccSet :: OccSet -> OccSet -> OccSet
unionManyOccSets :: [OccSet] -> OccSet
unionOccSets :: OccSet -> OccSet -> OccSet
extendOccSetList :: OccSet -> [OccName] -> OccSet
extendOccSet :: OccSet -> OccName -> OccSet
mkOccSet :: [OccName] -> OccSet
unitOccSet :: OccName -> OccSet
emptyOccSet :: OccSet
pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc
alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt
filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt
delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a
delFromOccEnv :: OccEnv a -> OccName -> OccEnv a
mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a
mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b
extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b
extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a
plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a
plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
occEnvElts :: OccEnv a -> [a]
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
elemOccEnv :: OccName -> OccEnv a -> Bool
mkOccEnv :: [(OccName, a)] -> OccEnv a
lookupOccEnv :: OccEnv a -> OccName -> Maybe a
extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a
extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a
unitOccEnv :: OccName -> a -> OccEnv a
emptyOccEnv :: OccEnv a
nameSpacesRelated :: NameSpace -> NameSpace -> Bool
demoteOccName :: OccName -> Maybe OccName
mkClsOccFS :: FastString -> OccName
mkClsOcc :: String -> OccName
mkTcOccFS :: FastString -> OccName
mkTcOcc :: String -> OccName
mkTyVarOccFS :: FastString -> OccName
mkTyVarOcc :: String -> OccName
mkDataOccFS :: FastString -> OccName
mkDataOcc :: String -> OccName
mkVarOccFS :: FastString -> OccName
mkVarOcc :: String -> OccName
mkOccNameFS :: NameSpace -> FastString -> OccName
mkOccName :: NameSpace -> String -> OccName
pprOccName :: OccName -> SDoc
pprNameSpaceBrief :: NameSpace -> SDoc
pprNonVarNameSpace :: NameSpace -> SDoc
pprNameSpace :: NameSpace -> SDoc
isValNameSpace :: NameSpace -> Bool
isVarNameSpace :: NameSpace -> Bool
isTvNameSpace :: NameSpace -> Bool
isTcClsNameSpace :: NameSpace -> Bool
isDataConNameSpace :: NameSpace -> Bool
varName :: NameSpace
tvName :: NameSpace
srcDataName :: NameSpace
dataName :: NameSpace
tcClsName :: NameSpace
clsName :: NameSpace
tcName :: NameSpace
data NameSpace

-- | 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
data OccEnv a
type OccSet = UniqSet OccName
type TidyOccEnv = UniqFM Int

-- | An empty FilesToClean
emptyFilesToClean :: FilesToClean

-- | Should we use `-XLinker -rpath` when linking or not? See Note
--   [-fno-use-rpaths]
useXLinkerRPath :: DynFlags -> OS -> Bool
isBmi2Enabled :: DynFlags -> Bool
isBmiEnabled :: DynFlags -> Bool
isAvx512pfEnabled :: DynFlags -> Bool
isAvx512fEnabled :: DynFlags -> Bool
isAvx512erEnabled :: DynFlags -> Bool
isAvx512cdEnabled :: DynFlags -> Bool
isAvx2Enabled :: DynFlags -> Bool
isAvxEnabled :: DynFlags -> Bool
isSse4_2Enabled :: DynFlags -> Bool
isSse2Enabled :: DynFlags -> Bool
isSseEnabled :: DynFlags -> Bool
setUnsafeGlobalDynFlags :: DynFlags -> IO ()

-- | Resolve any internal inconsistencies in a set of <a>DynFlags</a>.
--   Returns the consistent <a>DynFlags</a> as well as a list of warnings
--   to report to the user.
makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Located String])
tARGET_MAX_WORD :: DynFlags -> Integer
tARGET_MAX_INT :: DynFlags -> Integer
tARGET_MIN_INT :: DynFlags -> Integer
mAX_PTR_TAG :: DynFlags -> Int
tAG_MASK :: DynFlags -> Int
wordAlignment :: DynFlags -> Alignment
wORD_SIZE_IN_BITS :: DynFlags -> Int
bLOCK_SIZE_W :: DynFlags -> Int
iLDV_STATE_USE :: DynFlags -> Integer
iLDV_STATE_CREATE :: DynFlags -> Integer
iLDV_CREATE_MASK :: DynFlags -> Integer
lDV_SHIFT :: DynFlags -> Int
dYNAMIC_BY_DEFAULT :: DynFlags -> Bool
wORDS_BIGENDIAN :: DynFlags -> Bool
tAG_BITS :: DynFlags -> Int
bITMAP_BITS_SHIFT :: DynFlags -> Int
cLONG_LONG_SIZE :: DynFlags -> Int
cLONG_SIZE :: DynFlags -> Int
cINT_SIZE :: DynFlags -> Int
dOUBLE_SIZE :: DynFlags -> Int
wORD_SIZE :: DynFlags -> Int
aP_STACK_SPLIM :: DynFlags -> Int
rESERVED_STACK_WORDS :: DynFlags -> Int
rESERVED_C_STACK_BYTES :: DynFlags -> Int
mAX_Real_Long_REG :: DynFlags -> Int
mAX_Real_XMM_REG :: DynFlags -> Int
mAX_Real_Double_REG :: DynFlags -> Int
mAX_Real_Float_REG :: DynFlags -> Int
mAX_Real_Vanilla_REG :: DynFlags -> Int
mAX_XMM_REG :: DynFlags -> Int
mAX_Long_REG :: DynFlags -> Int
mAX_Double_REG :: DynFlags -> Int
mAX_Float_REG :: DynFlags -> Int
mAX_Vanilla_REG :: DynFlags -> Int
mUT_ARR_PTRS_CARD_BITS :: DynFlags -> Int
mAX_CHARLIKE :: DynFlags -> Int
mIN_CHARLIKE :: DynFlags -> Int
mAX_INTLIKE :: DynFlags -> Int
mIN_INTLIKE :: DynFlags -> Int
mIN_PAYLOAD_SIZE :: DynFlags -> Int
mAX_SPEC_AP_SIZE :: DynFlags -> Int
mAX_SPEC_SELECTEE_SIZE :: DynFlags -> Int
oFFSET_StgFunInfoExtraRev_arity :: DynFlags -> Int
sIZEOF_StgFunInfoExtraRev :: DynFlags -> Int
oFFSET_StgFunInfoExtraFwd_arity :: DynFlags -> Int
oFFSET_StgUpdateFrame_updatee :: DynFlags -> Int
oFFSET_StgStack_stack :: DynFlags -> Int
oFFSET_StgStack_sp :: DynFlags -> Int
oFFSET_StgTSO_stackobj :: DynFlags -> Int
oFFSET_StgTSO_cccs :: DynFlags -> Int
oFFSET_StgTSO_alloc_limit :: DynFlags -> Int
oFFSET_StgArrBytes_bytes :: DynFlags -> Int
sIZEOF_StgArrBytes_NoHdr :: DynFlags -> Int
oFFSET_StgSmallMutArrPtrs_ptrs :: DynFlags -> Int
sIZEOF_StgSmallMutArrPtrs_NoHdr :: DynFlags -> Int
oFFSET_StgMutArrPtrs_size :: DynFlags -> Int
oFFSET_StgMutArrPtrs_ptrs :: DynFlags -> Int
sIZEOF_StgMutArrPtrs_NoHdr :: DynFlags -> Int
sIZEOF_StgUpdateFrame_NoHdr :: DynFlags -> Int
oFFSET_StgEntCounter_entry_count :: DynFlags -> Int
oFFSET_StgEntCounter_link :: DynFlags -> Int
oFFSET_StgEntCounter_registeredp :: DynFlags -> Int
oFFSET_StgEntCounter_allocd :: DynFlags -> Int
oFFSET_StgEntCounter_allocs :: DynFlags -> Int
sIZEOF_StgSMPThunkHeader :: DynFlags -> Int
oFFSET_StgHeader_ldvw :: DynFlags -> Int
oFFSET_StgHeader_ccs :: DynFlags -> Int
oFFSET_CostCentreStack_scc_count :: DynFlags -> Int
oFFSET_CostCentreStack_mem_alloc :: DynFlags -> Int
sIZEOF_CostCentreStack :: DynFlags -> Int
oFFSET_bdescr_flags :: DynFlags -> Int
oFFSET_bdescr_blocks :: DynFlags -> Int
oFFSET_bdescr_free :: DynFlags -> Int
oFFSET_bdescr_start :: DynFlags -> Int
oFFSET_Capability_r :: DynFlags -> Int
oFFSET_stgGCFun :: DynFlags -> Int
oFFSET_stgGCEnter1 :: DynFlags -> Int
oFFSET_stgEagerBlackholeInfo :: DynFlags -> Int
oFFSET_StgRegTable_rHpAlloc :: DynFlags -> Int
oFFSET_StgRegTable_rCurrentNursery :: DynFlags -> Int
oFFSET_StgRegTable_rCurrentTSO :: DynFlags -> Int
oFFSET_StgRegTable_rCCCS :: DynFlags -> Int
oFFSET_StgRegTable_rHpLim :: DynFlags -> Int
oFFSET_StgRegTable_rHp :: DynFlags -> Int
oFFSET_StgRegTable_rSpLim :: DynFlags -> Int
oFFSET_StgRegTable_rSp :: DynFlags -> Int
oFFSET_StgRegTable_rL1 :: DynFlags -> Int
oFFSET_StgRegTable_rZMM6 :: DynFlags -> Int
oFFSET_StgRegTable_rZMM5 :: DynFlags -> Int
oFFSET_StgRegTable_rZMM4 :: DynFlags -> Int
oFFSET_StgRegTable_rZMM3 :: DynFlags -> Int
oFFSET_StgRegTable_rZMM2 :: DynFlags -> Int
oFFSET_StgRegTable_rZMM1 :: DynFlags -> Int
oFFSET_StgRegTable_rYMM6 :: DynFlags -> Int
oFFSET_StgRegTable_rYMM5 :: DynFlags -> Int
oFFSET_StgRegTable_rYMM4 :: DynFlags -> Int
oFFSET_StgRegTable_rYMM3 :: DynFlags -> Int
oFFSET_StgRegTable_rYMM2 :: DynFlags -> Int
oFFSET_StgRegTable_rYMM1 :: DynFlags -> Int
oFFSET_StgRegTable_rXMM6 :: DynFlags -> Int
oFFSET_StgRegTable_rXMM5 :: DynFlags -> Int
oFFSET_StgRegTable_rXMM4 :: DynFlags -> Int
oFFSET_StgRegTable_rXMM3 :: DynFlags -> Int
oFFSET_StgRegTable_rXMM2 :: DynFlags -> Int
oFFSET_StgRegTable_rXMM1 :: DynFlags -> Int
oFFSET_StgRegTable_rD6 :: DynFlags -> Int
oFFSET_StgRegTable_rD5 :: DynFlags -> Int
oFFSET_StgRegTable_rD4 :: DynFlags -> Int
oFFSET_StgRegTable_rD3 :: DynFlags -> Int
oFFSET_StgRegTable_rD2 :: DynFlags -> Int
oFFSET_StgRegTable_rD1 :: DynFlags -> Int
oFFSET_StgRegTable_rF6 :: DynFlags -> Int
oFFSET_StgRegTable_rF5 :: DynFlags -> Int
oFFSET_StgRegTable_rF4 :: DynFlags -> Int
oFFSET_StgRegTable_rF3 :: DynFlags -> Int
oFFSET_StgRegTable_rF2 :: DynFlags -> Int
oFFSET_StgRegTable_rF1 :: DynFlags -> Int
oFFSET_StgRegTable_rR10 :: DynFlags -> Int
oFFSET_StgRegTable_rR9 :: DynFlags -> Int
oFFSET_StgRegTable_rR8 :: DynFlags -> Int
oFFSET_StgRegTable_rR7 :: DynFlags -> Int
oFFSET_StgRegTable_rR6 :: DynFlags -> Int
oFFSET_StgRegTable_rR5 :: DynFlags -> Int
oFFSET_StgRegTable_rR4 :: DynFlags -> Int
oFFSET_StgRegTable_rR3 :: DynFlags -> Int
oFFSET_StgRegTable_rR2 :: DynFlags -> Int
oFFSET_StgRegTable_rR1 :: DynFlags -> Int
tICKY_BIN_COUNT :: DynFlags -> Int
bLOCKS_PER_MBLOCK :: DynFlags -> Int
bLOCK_SIZE :: DynFlags -> Int
pROF_HDR_SIZE :: DynFlags -> Int
sTD_HDR_SIZE :: DynFlags -> Int
cONTROL_GROUP_CONST_291 :: DynFlags -> Int
compilerInfo :: DynFlags -> [(String, String)]
picPOpts :: DynFlags -> [String]
picCCOpts :: DynFlags -> [String]
setTmpDir :: FilePath -> DynFlags -> DynFlags
setFlagsFromEnvFile :: FilePath -> String -> DynP ()
canonicalizeModuleIfHome :: DynFlags -> Module -> Module

-- | Given a <a>ModuleName</a> of a signature in the home library, find out
--   how it is instantiated. E.g., the canonical form of A in
--   <tt>p[A=q[]:A]</tt> is <tt>q[]:A</tt>.
canonicalizeHomeModule :: DynFlags -> ModuleName -> Module
setUnitId :: String -> DynFlags -> DynFlags
unSetGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
setGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags
addWay' :: Way -> DynFlags -> DynFlags
dynamicGhc :: Bool

-- | Was the runtime system built with profiling enabled?
rtsIsProfiled :: Bool
glasgowExtsFlags :: [Extension]

-- | 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 <a>warningGroups</a> 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 -X<a>blah</a> flags can all be reversed with -XNo<a>blah</a>
xFlags :: [FlagSpec Extension]
supportedLanguagesAndExtensions :: PlatformMini -> [String]

-- | These <tt>-f&lt;blah&gt;</tt> flags can all be reversed with
--   <tt>-fno-&lt;blah&gt;</tt>
fLangFlags :: [FlagSpec Extension]

-- | These <tt>-f&lt;blah&gt;</tt> flags can all be reversed with
--   <tt>-fno-&lt;blah&gt;</tt>
fFlags :: [FlagSpec GeneralFlag]

-- | These <tt>-W&lt;blah&gt;</tt> flags can all be reversed with
--   <tt>-Wno-&lt;blah&gt;</tt>
wWarningFlags :: [FlagSpec WarningFlag]

-- | Make a list of flags for shell completion. Filter all available flags
--   into two groups, for interactive GHC vs all other.
flagsForCompletion :: Bool -> [String]
flagsPackage :: [Flag (CmdLineP DynFlags)]
flagsDynamic :: [Flag (CmdLineP DynFlags)]
flagsAll :: [Flag (CmdLineP DynFlags)]

-- | All dynamic flags option strings without the deprecated ones. These
--   are the user facing strings for enabling and disabling options.
allNonDeprecatedFlags :: [String]
updateWays :: DynFlags -> DynFlags

-- | Write an error or warning to the <tt>LogOutput</tt>.
putLogMsg :: DynFlags -> WarnReason -> Severity -> SrcSpan -> PprStyle -> MsgDoc -> IO ()

-- | 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])

-- | Like <a>parseDynamicFlagsCmdLine</a> 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])

-- | Parse dynamic flags from a list of command line arguments. Returns the
--   parsed <a>DynFlags</a>, the left-over arguments, and a list of
--   warnings. Throws a <a>UsageError</a> if errors occurred during parsing
--   (such as unknown flags or missing arguments).
parseDynamicFlagsCmdLine :: MonadIO m => DynFlags -> [Located String] -> m (DynFlags, [Located String], [Warn])

-- | Sets the <a>DynFlags</a> to be appropriate to the optimisation level
updOptLevel :: Int -> DynFlags -> DynFlags
addPluginModuleName :: String -> DynFlags -> DynFlags
thisPackage :: DynFlags -> UnitId
thisUnitIdInsts :: DynFlags -> [(ModuleName, Module)]
thisComponentId :: DynFlags -> ComponentId

-- | Gets the verbosity flag for the current verbosity level. This is fed
--   to other tools, so GHC-specific verbosity flags like
--   <tt>-ddump-most</tt> are not included
getVerbFlags :: DynFlags -> [String]

-- | Retrieve the options corresponding to a particular <tt>opt_*</tt>
--   field in the correct order
getOpts :: DynFlags -> (DynFlags -> [a]) -> [a]

-- | 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)]

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

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

-- | Test if Safe Imports are on in some form
safeImportsOn :: DynFlags -> Bool

-- | Is the Safe Haskell safe inference mode active
safeInferOn :: DynFlags -> Bool

-- | Is the Safe Haskell safe language in use
safeLanguageOn :: DynFlags -> Bool
safeHaskellModeEnabled :: DynFlags -> Bool

-- | Is Safe Haskell on in some way (including inference mode)
safeHaskellOn :: DynFlags -> Bool

-- | Is the -fpackage-trust mode on
packageTrustOn :: DynFlags -> Bool

-- | Some modules have dependencies on others through the DynFlags rather
--   than textual imports
dynFlagDependencies :: DynFlags -> [ModuleName]
lang_set :: DynFlags -> Maybe Language -> DynFlags

-- | Set or unset a <a>Extension</a>, unless it has been explicitly set or
--   unset before.
xopt_set_unlessExplSpec :: Extension -> (DynFlags -> Extension -> DynFlags) -> DynFlags -> DynFlags

-- | Unset a <a>Extension</a>
xopt_unset :: DynFlags -> Extension -> DynFlags

-- | Set a <a>Extension</a>
xopt_set :: DynFlags -> Extension -> DynFlags

-- | Test whether a <a>Extension</a> is set
xopt :: Extension -> DynFlags -> Bool

-- | Mark a <a>WarningFlag</a> as not fatal
wopt_unset_fatal :: DynFlags -> WarningFlag -> DynFlags

-- | Mark a <a>WarningFlag</a> as fatal (do not set the flag)
wopt_set_fatal :: DynFlags -> WarningFlag -> DynFlags

-- | Test whether a <a>WarningFlag</a> is set as fatal
wopt_fatal :: WarningFlag -> DynFlags -> Bool

-- | Unset a <a>WarningFlag</a>
wopt_unset :: DynFlags -> WarningFlag -> DynFlags

-- | Set a <a>WarningFlag</a>
wopt_set :: DynFlags -> WarningFlag -> DynFlags

-- | Test whether a <a>WarningFlag</a> is set
wopt :: WarningFlag -> DynFlags -> Bool

-- | Unset a <a>GeneralFlag</a>
gopt_unset :: DynFlags -> GeneralFlag -> DynFlags

-- | Set a <a>GeneralFlag</a>
gopt_set :: DynFlags -> GeneralFlag -> DynFlags

-- | Test whether a <a>GeneralFlag</a> is set
gopt :: GeneralFlag -> DynFlags -> Bool

-- | Unset a <a>DumpFlag</a>
dopt_unset :: DynFlags -> DumpFlag -> DynFlags

-- | Set a <a>DumpFlag</a>
dopt_set :: DynFlags -> DumpFlag -> DynFlags

-- | Test whether a <a>DumpFlag</a> is set
dopt :: DumpFlag -> DynFlags -> Bool
hasNoOptCoercion :: DynFlags -> Bool
hasNoStateHack :: DynFlags -> Bool

-- | The language extensions implied by the various language variants. When
--   updating this be sure to update the flag documentation in
--   <tt>docs<i>users-guide</i>glasgow_exts.rst</tt>.
languageExtensions :: Maybe Language -> [Extension]
defaultFlushErr :: FlushErr
defaultFlushOut :: FlushOut
defaultLogActionHPutStrDoc :: DynFlags -> Handle -> SDoc -> PprStyle -> IO ()

-- | Like <a>defaultLogActionHPutStrDoc</a> but appends an extra newline.
defaultLogActionHPrintDoc :: DynFlags -> Handle -> SDoc -> PprStyle -> IO ()
defaultLogAction :: LogAction
defaultFatalMessager :: FatalMessager
interpreterDynamic :: DynFlags -> Bool
interpreterProfiled :: DynFlags -> Bool
interpWays :: [Way]
defaultWays :: Settings -> [Way]

-- | The normal <a>DynFlags</a>. Note that they are not suitable for use in
--   this form and must be fully initialized by <a>runGhc</a> first.
defaultDynFlags :: Settings -> LlvmConfig -> DynFlags

-- | Used by <a>runGhc</a> to partially initialize a new <a>DynFlags</a>
--   value
initDynFlags :: DynFlags -> IO DynFlags

-- | Compute the path of the dynamic object corresponding to an object
--   file.
dynamicOutputFile :: DynFlags -> FilePath -> FilePath
dynamicTooMkDynamicDynFlags :: DynFlags -> DynFlags
whenCannotGenerateDynamicToo :: MonadIO m => DynFlags -> m () -> m ()
ifGeneratingDynamicToo :: MonadIO m => DynFlags -> m a -> m a -> m a
whenGeneratingDynamicToo :: MonadIO m => DynFlags -> m () -> m ()
wayUnsetGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayRTSOnly :: Way -> Bool
mkBuildTag :: [Way] -> String

-- | Are we building with <tt>-fPIE</tt> or <tt>-fPIC</tt> enabled?
positionIndependent :: DynFlags -> Bool
defaultObjectTarget :: DynFlags -> HscTarget
packageFlagsChanged :: DynFlags -> DynFlags -> Bool
isNoLink :: GhcLink -> Bool
isOneShot :: GhcMode -> Bool

-- | Does this target retain *all* top-level bindings for a module, rather
--   than just the exported bindings, in the TypeEnv and compiled code (if
--   any)? In interpreted mode we do this, so that GHCi can call functions
--   inside a module. In HscNothing mode we also do it, so that Haddock can
--   get access to the GlobalRdrEnv for a module after typechecking it.
targetRetainsAllBindings :: HscTarget -> Bool

-- | Will this target result in an object file on the disk?
isObjectTarget :: HscTarget -> Bool
versionedFilePath :: DynFlags -> FilePath

-- | The directory for this version of ghc in the user's app directory
--   (typically something like <tt>~<i>.ghc</i>x86_64-linux-7.6.3</tt>)
versionedAppDir :: DynFlags -> MaybeT IO FilePath
tablesNextToCode :: DynFlags -> Bool
opt_i :: DynFlags -> [String]
opt_lc :: DynFlags -> [String]
opt_lo :: DynFlags -> [String]
opt_lcc :: DynFlags -> [String]
opt_windres :: DynFlags -> [String]
opt_lm :: DynFlags -> [String]
opt_l :: DynFlags -> [String]
opt_a :: DynFlags -> [String]
opt_cxx :: DynFlags -> [String]
opt_c :: DynFlags -> [String]
opt_F :: DynFlags -> [String]
opt_P_signature :: DynFlags -> ([String], Fingerprint)
opt_P :: DynFlags -> [String]
opt_L :: DynFlags -> [String]
pgm_i :: DynFlags -> String
pgm_lc :: DynFlags -> (String, [Option])
pgm_lo :: DynFlags -> (String, [Option])
pgm_ranlib :: DynFlags -> String
pgm_install_name_tool :: DynFlags -> String
pgm_otool :: DynFlags -> String
pgm_ar :: DynFlags -> String
pgm_lcc :: DynFlags -> (String, [Option])
pgm_libtool :: DynFlags -> String
pgm_windres :: DynFlags -> String
pgm_T :: DynFlags -> String
pgm_dll :: DynFlags -> (String, [Option])
pgm_lm :: DynFlags -> (String, [Option])
pgm_l :: DynFlags -> (String, [Option])
pgm_a :: DynFlags -> (String, [Option])
pgm_c :: DynFlags -> String
pgm_F :: DynFlags -> String
pgm_P :: DynFlags -> (String, [Option])
pgm_L :: DynFlags -> String
systemPackageConfig :: DynFlags -> FilePath
extraGccViaCFlags :: DynFlags -> [String]
tmpDir :: DynFlags -> String
topDir :: DynFlags -> FilePath
ghciUsagePath :: DynFlags -> FilePath
ghcUsagePath :: DynFlags -> FilePath
projectVersion :: DynFlags -> String
programName :: DynFlags -> String

-- | "unbuild" a <a>Settings</a> from a <a>DynFlags</a>. This shouldn't be
--   needed in the vast majority of code. But GHCi questionably uses this
--   to produce a default <a>DynFlags</a> from which to compute a flags
--   diff for printing.
settings :: DynFlags -> Settings
backendMaintainsCfg :: DynFlags -> Bool

-- | Concatenate and flatten the list of global and quoted includes
--   returning just a flat list of paths.
flattenIncludes :: IncludeSpecs -> [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

-- | 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
optimisationFlags :: EnumSet GeneralFlag

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

-- | 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] -> IncludeSpecs
[includePathsQuote] :: IncludeSpecs -> [String]
[includePathsGlobal] :: IncludeSpecs -> [String]
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_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
data Language
Haskell98 :: Language
Haskell2010 :: Language

-- | The various Safe Haskell modes
data SafeHaskellMode

-- | inferred unsafe
Sf_None :: SafeHaskellMode

-- | declared and checked
Sf_Unsafe :: SafeHaskellMode

-- | declared and checked
Sf_Trustworthy :: SafeHaskellMode

-- | declared and checked
Sf_Safe :: SafeHaskellMode

-- | inferred as safe
Sf_SafeInferred :: SafeHaskellMode

-- | <tt>-fno-safe-haskell</tt> state
Sf_Ignore :: SafeHaskellMode

-- | Edge weights to use when generating a CFG from CMM
data CfgWeights
CFGWeights :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> CfgWeights
[uncondWeight] :: CfgWeights -> Int
[condBranchWeight] :: CfgWeights -> Int
[switchWeight] :: CfgWeights -> Int
[callWeight] :: CfgWeights -> Int
[likelyCondWeight] :: CfgWeights -> Int
[unlikelyCondWeight] :: CfgWeights -> Int
[infoTablePenalty] :: CfgWeights -> Int
[backEdgeBonus] :: CfgWeights -> Int
class HasDynFlags (m :: Type -> Type)
getDynFlags :: HasDynFlags m => m DynFlags
class ContainsDynFlags t
extractDynFlags :: ContainsDynFlags t => t -> DynFlags
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 LlvmTarget
LlvmTarget :: String -> String -> [String] -> LlvmTarget
[lDataLayout] :: LlvmTarget -> String
[lCPU] :: LlvmTarget -> String
[lAttributes] :: LlvmTarget -> [String]

-- | See Note [LLVM Configuration] in SysTools.
data LlvmConfig
LlvmConfig :: [(String, LlvmTarget)] -> [(Int, String)] -> LlvmConfig
[llvmTargets] :: LlvmConfig -> [(String, LlvmTarget)]
[llvmPasses] :: LlvmConfig -> [(Int, String)]

-- | The target code type of the compilation (if any).
--   
--   Whenever you change the target, also make sure to set <a>ghcLink</a>
--   to something sensible.
--   
--   <a>HscNothing</a> can be used to avoid generating any output, however,
--   note that:
--   
--   <ul>
--   <li>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. See
--   Note [-fno-code mode].</li>
--   </ul>
data HscTarget

-- | Generate C code.
HscC :: HscTarget

-- | Generate assembly using the native code generator.
HscAsm :: HscTarget

-- | Generate assembly using the llvm code generator.
HscLlvm :: HscTarget

-- | Generate bytecode. (Requires <a>LinkInMemory</a>)
HscInterpreted :: HscTarget

-- | Don't generate any code. See notes above.
HscNothing :: HscTarget

-- | The <a>GhcMode</a> tells us whether we're doing multi-module
--   compilation (controlled via the <a>GHC</a> API) or one-shot
--   (single-module) compilation. This makes a difference primarily to the
--   <a>Finder</a>: 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

-- | <tt>--make</tt>, GHCi, etc.
CompManager :: GhcMode

-- | <pre>
--   ghc -c Foo.hs
--   </pre>
OneShot :: GhcMode

-- | <tt>ghc -M</tt>, see <a>Finder</a> 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

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

-- | <tt>-package</tt>, by <a>PackageName</a>
PackageArg :: String -> PackageArg

-- | <tt>-package-id</tt>, by <a>UnitId</a>
UnitIdArg :: UnitId -> PackageArg

-- | Represents the renaming that may be associated with an exposed
--   package, e.g. the <tt>rns</tt> part of <tt>-package "foo (rns)"</tt>.
--   
--   Here are some example parsings of the package flags (where a string
--   literal is punned to be a <a>ModuleName</a>:
--   
--   <ul>
--   <li><tt>-package foo</tt> is <tt>ModRenaming True []</tt></li>
--   <li><tt>-package foo ()</tt> is <tt>ModRenaming False []</tt></li>
--   <li><tt>-package foo (A)</tt> is <tt>ModRenaming False [(<a>A</a>,
--   <a>A</a>)]</tt></li>
--   <li><tt>-package foo (A as B)</tt> is <tt>ModRenaming False
--   [(<a>A</a>, <a>B</a>)]</tt></li>
--   <li><tt>-package foo with (A as B)</tt> is <tt>ModRenaming True
--   [(<a>A</a>, <a>B</a>)]</tt></li>
--   </ul>
data ModRenaming
ModRenaming :: Bool -> [(ModuleName, ModuleName)] -> ModRenaming

-- | Bring all exposed modules into scope?
[modRenamingWithImplicit] :: ModRenaming -> Bool

-- | Bring module <tt>m</tt> into scope under name <tt>n</tt>.
[modRenamings] :: ModRenaming -> [(ModuleName, ModuleName)]

-- | Flags for manipulating the set of non-broken packages.
newtype IgnorePackageFlag

-- | <pre>
--   -ignore-package
--   </pre>
IgnorePackage :: String -> IgnorePackageFlag

-- | Flags for manipulating package trust.
data TrustFlag

-- | <pre>
--   -trust
--   </pre>
TrustPackage :: String -> TrustFlag

-- | <pre>
--   -distrust
--   </pre>
DistrustPackage :: String -> TrustFlag

-- | Flags for manipulating packages visibility.
data PackageFlag

-- | <tt>-package</tt>, <tt>-package-id</tt>
ExposePackage :: String -> PackageArg -> ModRenaming -> PackageFlag

-- | <pre>
--   -hide-package
--   </pre>
HidePackage :: String -> PackageFlag
data PackageDBFlag
PackageDB :: PkgConfRef -> PackageDBFlag
NoUserPackageDB :: PackageDBFlag
NoGlobalPackageDB :: PackageDBFlag
ClearPackageDBs :: PackageDBFlag
data DynLibLoader
Deployable :: DynLibLoader
SystemDependent :: DynLibLoader
data RtsOptsEnabled
RtsOptsNone :: RtsOptsEnabled
RtsOptsIgnore :: RtsOptsEnabled
RtsOptsIgnoreAll :: RtsOptsEnabled
RtsOptsSafeOnly :: RtsOptsEnabled
RtsOptsAll :: RtsOptsEnabled
data Way
WayCustom :: String -> Way
WayThreaded :: Way
WayDebug :: Way
WayProf :: Way
WayEventLog :: Way
WayDyn :: Way
type FatalMessager = String -> IO ()
type LogAction = DynFlags -> WarnReason -> Severity -> SrcSpan -> PprStyle -> MsgDoc -> IO ()
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
data PkgConfRef
GlobalPkgConf :: PkgConfRef
UserPkgConf :: PkgConfRef
PkgConfFile :: FilePath -> PkgConfRef
data LinkerInfo
GnuLD :: [Option] -> LinkerInfo
GnuGold :: [Option] -> LinkerInfo
LlvmLLD :: [Option] -> LinkerInfo
DarwinLD :: [Option] -> LinkerInfo
SolarisLD :: [Option] -> LinkerInfo
AixLD :: [Option] -> LinkerInfo
UnknownLD :: LinkerInfo
data CompilerInfo
GCC :: CompilerInfo
Clang :: CompilerInfo
AppleClang :: CompilerInfo
AppleClang51 :: CompilerInfo
UnknownCC :: CompilerInfo

-- | A collection of files that must be deleted before ghc exits. The
--   current collection is stored in an IORef in DynFlags,
--   <a>filesToClean</a>.
data FilesToClean
FilesToClean :: !Set FilePath -> !Set FilePath -> FilesToClean

-- | Files that will be deleted at the end of runGhc(T)
[ftcGhcSession] :: FilesToClean -> !Set FilePath

-- | Files that will be deleted the next time
--   <a>cleanCurrentModuleTempFiles</a> is called, or otherwise at the end
--   of the session.
[ftcCurrentModule] :: FilesToClean -> !Set FilePath
bagToList :: Bag a -> [a]
listToBag :: [a] -> Bag a
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)
mapAndUnzipBagM :: Monad m => (a -> m (b, c)) -> Bag a -> m (Bag b, Bag c)
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)
mapBagM_ :: Monad m => (a -> m b) -> Bag a -> m ()
mapBagM :: Monad m => (a -> m b) -> Bag a -> m (Bag b)
mapMaybeBag :: (a -> Maybe b) -> Bag a -> Bag b
concatMapBagPair :: (a -> (Bag b, Bag c)) -> Bag a -> (Bag b, Bag c)
concatMapBag :: (a -> Bag b) -> Bag a -> Bag b
mapBag :: (a -> b) -> Bag a -> Bag b
foldBag :: (r -> r -> r) -> (a -> r) -> r -> Bag a -> r
partitionBagWith :: (a -> Either b c) -> Bag a -> (Bag b, Bag c)
partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
catBagMaybes :: Bag (Maybe a) -> Bag a
concatBag :: Bag (Bag a) -> Bag a
anyBagM :: Monad m => (a -> m Bool) -> Bag a -> m Bool
anyBag :: (a -> Bool) -> Bag a -> Bool
allBag :: (a -> Bool) -> Bag a -> Bool
filterBagM :: Monad m => (a -> m Bool) -> Bag a -> m (Bag a)
filterBag :: (a -> Bool) -> Bag a -> Bag a
isSingletonBag :: Bag a -> Bool
isEmptyBag :: Bag a -> Bool
snocBag :: Bag a -> a -> Bag a
infixl 3 `snocBag`
consBag :: a -> Bag a -> Bag a
infixr 3 `consBag`
unionBags :: Bag a -> Bag a -> Bag a
unionManyBags :: [Bag a] -> Bag a
elemBag :: Eq a => a -> Bag a -> Bool
lengthBag :: Bag a -> Int
unitBag :: a -> Bag a
emptyBag :: Bag a
data Bag a
isHsigFile :: HscSource -> Bool
isHsBootOrSig :: HscSource -> Bool
hscSourceString :: HscSource -> String
data HscSource
HsSrcFile :: HscSource
HsBootFile :: HscSource
HsigFile :: HscSource
unitModuleSet :: Module -> ModuleSet
unionModuleSet :: ModuleSet -> ModuleSet -> ModuleSet
delModuleSet :: ModuleSet -> Module -> ModuleSet
minusModuleSet :: ModuleSet -> ModuleSet -> ModuleSet
intersectModuleSet :: ModuleSet -> ModuleSet -> ModuleSet
elemModuleSet :: Module -> ModuleSet -> Bool
moduleSetElts :: ModuleSet -> [Module]
emptyModuleSet :: ModuleSet
extendModuleSetList :: ModuleSet -> [Module] -> ModuleSet
extendModuleSet :: ModuleSet -> Module -> ModuleSet
mkModuleSet :: [Module] -> ModuleSet
isEmptyModuleEnv :: ModuleEnv a -> Bool
unitModuleEnv :: Module -> a -> ModuleEnv a
moduleEnvToList :: ModuleEnv a -> [(Module, a)]
moduleEnvElts :: ModuleEnv a -> [a]
moduleEnvKeys :: ModuleEnv a -> [Module]
emptyModuleEnv :: ModuleEnv a
mkModuleEnv :: [(Module, a)] -> ModuleEnv a
mapModuleEnv :: (a -> b) -> ModuleEnv a -> ModuleEnv b
lookupWithDefaultModuleEnv :: ModuleEnv a -> a -> Module -> a
lookupModuleEnv :: ModuleEnv a -> Module -> Maybe a
plusModuleEnv :: ModuleEnv a -> ModuleEnv a -> ModuleEnv a
delModuleEnv :: ModuleEnv a -> Module -> ModuleEnv a
delModuleEnvList :: ModuleEnv a -> [Module] -> ModuleEnv a
plusModuleEnv_C :: (a -> a -> a) -> ModuleEnv a -> ModuleEnv a -> ModuleEnv a
extendModuleEnvList_C :: (a -> a -> a) -> ModuleEnv a -> [(Module, a)] -> ModuleEnv a
extendModuleEnvList :: ModuleEnv a -> [(Module, a)] -> ModuleEnv a
extendModuleEnvWith :: (a -> a -> a) -> ModuleEnv a -> Module -> a -> ModuleEnv a
extendModuleEnv :: ModuleEnv a -> Module -> a -> ModuleEnv a
elemModuleEnv :: Module -> ModuleEnv a -> Bool
filterModuleEnv :: (Module -> a -> Bool) -> ModuleEnv a -> ModuleEnv a
wiredInUnitIds :: [UnitId]
isHoleModule :: Module -> Bool
isInteractiveModule :: Module -> Bool

-- | 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
interactiveUnitId :: UnitId
thisGhcUnitId :: UnitId
thUnitId :: UnitId
rtsUnitId :: UnitId
baseUnitId :: UnitId
integerUnitId :: UnitId
primUnitId :: UnitId
parseModSubst :: ReadP [(ModuleName, Module)]
parseModuleId :: ReadP Module
parseComponentId :: ReadP ComponentId
parseUnitId :: ReadP UnitId
parseModuleName :: ReadP ModuleName
generalizeIndefModule :: IndefModule -> IndefModule
generalizeIndefUnitId :: IndefUnitId -> IndefUnitId

-- | See <a>splitModuleInsts</a>.
splitUnitIdInsts :: UnitId -> (InstalledUnitId, Maybe IndefUnitId)

-- | Given a possibly on-the-fly instantiated module, split it into a
--   <a>Module</a> that we definitely can find on-disk, as well as an
--   instantiation if we need to instantiate it on the fly. If the
--   instantiation is <tt>Nothing</tt> no on-the-fly renaming is needed.
splitModuleInsts :: Module -> (InstalledModule, Maybe IndefModule)

-- | Like 'renameHoleUnitId, but requires only <a>PackageConfigMap</a> so
--   it can be used by <a>Packages</a>.
renameHoleUnitId' :: PackageConfigMap -> ShHoleSubst -> UnitId -> UnitId

-- | Like <a>renameHoleModule</a>, but requires only
--   <a>PackageConfigMap</a> so it can be used by <a>Packages</a>.
renameHoleModule' :: PackageConfigMap -> ShHoleSubst -> Module -> Module

-- | Substitutes holes in a <a>UnitId</a>, suitable for renaming when an
--   include occurs; see Note [Representation of module/name variable].
--   
--   <tt>p[A=<a>A</a>]</tt> maps to <tt>p[A=<a>B</a>]</tt> with
--   <tt>A=<a>B</a></tt>.
renameHoleUnitId :: DynFlags -> ShHoleSubst -> UnitId -> UnitId

-- | Substitutes holes in a <a>Module</a>. NOT suitable for being called
--   directly on a <tt>nameModule</tt>, see Note [Representation of
--   module/name variable]. <tt>p[A=<a>A</a>]:B</tt> maps to
--   <tt>p[A=q():A]:B</tt> with <tt>A=q():A</tt>; similarly,
--   <tt><a>A</a></tt> maps to <tt>q():A</tt>.
renameHoleModule :: DynFlags -> ShHoleSubst -> Module -> Module
stringToUnitId :: String -> UnitId

-- | Create a new simple unit identifier from a <a>FastString</a>.
--   Internally, this is primarily used to specify wired-in unit
--   identifiers.
fsToUnitId :: FastString -> UnitId

-- | Create a new simple unit identifier (no holes) from a
--   <a>ComponentId</a>.
newSimpleUnitId :: ComponentId -> UnitId

-- | Compares package ids lexically, rather than by their <a>Unique</a>s
stableUnitIdCmp :: UnitId -> UnitId -> Ordering

-- | Create a new, un-hashed unit identifier.
newUnitId :: ComponentId -> [(ModuleName, Module)] -> UnitId

-- | Generate a uniquely identifying <a>FastString</a> for a unit
--   identifier. This is a one-way function. You can rely on one special
--   property: if a unit identifier is in most general form, its
--   <a>FastString</a> coincides with its <a>ComponentId</a>. This hash is
--   completely internal to GHC and is not used for symbol names or file
--   paths.
hashUnitId :: ComponentId -> [(ModuleName, Module)] -> FastString

-- | A <a>UnitId</a> is definite if it has no free holes.
unitIdIsDefinite :: UnitId -> Bool

-- | Retrieve the set of free holes of a <a>UnitId</a>.
unitIdFreeHoles :: UnitId -> UniqDSet ModuleName
delInstalledModuleEnv :: InstalledModuleEnv a -> InstalledModule -> InstalledModuleEnv a
filterInstalledModuleEnv :: (InstalledModule -> a -> Bool) -> InstalledModuleEnv a -> InstalledModuleEnv a
extendInstalledModuleEnv :: InstalledModuleEnv a -> InstalledModule -> a -> InstalledModuleEnv a
lookupInstalledModuleEnv :: InstalledModuleEnv a -> InstalledModule -> Maybe a
emptyInstalledModuleEnv :: InstalledModuleEnv a

-- | Test if a <a>UnitId</a> corresponds to a given <a>InstalledUnitId</a>,
--   modulo instantiation.
installedUnitIdEq :: InstalledUnitId -> UnitId -> Bool

-- | Test if a <a>Module</a> corresponds to a given <a>InstalledModule</a>,
--   modulo instantiation.
installedModuleEq :: InstalledModule -> Module -> Bool
stringToInstalledUnitId :: String -> InstalledUnitId
componentIdToInstalledUnitId :: ComponentId -> InstalledUnitId
fsToInstalledUnitId :: FastString -> InstalledUnitId
installedUnitIdString :: InstalledUnitId -> String

-- | Lossy conversion to the on-disk <a>InstalledUnitId</a> for a
--   component.
toInstalledUnitId :: UnitId -> InstalledUnitId

-- | Injects an <a>IndefModule</a> to <a>Module</a> (see also
--   <a>indefUnitIdToUnitId</a>.
indefModuleToModule :: DynFlags -> IndefModule -> Module

-- | Injects an <a>IndefUnitId</a> (indefinite library which was on-the-fly
--   instantiated) to a <a>UnitId</a> (either an indefinite or definite
--   library).
indefUnitIdToUnitId :: DynFlags -> IndefUnitId -> UnitId

-- | Create a new <a>IndefUnitId</a> given an explicit module substitution.
newIndefUnitId :: ComponentId -> [(ModuleName, Module)] -> IndefUnitId
unitIdKey :: UnitId -> Unique
unitIdFS :: UnitId -> FastString
pprModule :: Module -> SDoc
mkModule :: UnitId -> ModuleName -> Module

-- | This gives a stable ordering, as opposed to the Ord instance which
--   gives an ordering based on the <a>Unique</a>s of the components, which
--   may not be stable from run to run of the compiler.
stableModuleCmp :: Module -> Module -> Ordering

-- | Create a module variable at some <a>ModuleName</a>. See Note
--   [Representation of module/name variables]
mkHoleModule :: ModuleName -> Module

-- | A <a>Module</a> is definite if it has no free holes.
moduleIsDefinite :: Module -> Bool

-- | Calculate the free holes of a <a>Module</a>. 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 :: Module -> UniqDSet ModuleName

-- | Returns the string version of the module name, with dots replaced by
--   colons.
moduleNameColons :: ModuleName -> String

-- | Returns the string version of the module name, with dots replaced by
--   slashes.
moduleNameSlashes :: ModuleName -> String
mkModuleNameFS :: FastString -> ModuleName
mkModuleName :: String -> ModuleName

-- | Get a string representation of a <a>Module</a> that's unique and
--   stable across recompilations. eg.
--   "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal"
moduleStableString :: Module -> String
moduleNameString :: ModuleName -> String
moduleNameFS :: ModuleName -> FastString
pprModuleName :: ModuleName -> SDoc

-- | Compares module names lexically, rather than by their <a>Unique</a>s
stableModuleNameCmp :: ModuleName -> ModuleName -> Ordering

-- | Add the <tt>-boot</tt> suffix to all output file paths associated with
--   the module, not including the input file itself
addBootSuffixLocnOut :: ModLocation -> ModLocation

-- | Add the <tt>-boot</tt> suffix to all file paths associated with the
--   module
addBootSuffixLocn :: ModLocation -> ModLocation

-- | Add the <tt>-boot</tt> suffix if the <tt>Bool</tt> argument is
--   <tt>True</tt>
addBootSuffix_maybe :: Bool -> FilePath -> FilePath

-- | Remove the <tt>-boot</tt> suffix to .hs, .hi and .o files
removeBootSuffix :: FilePath -> FilePath

-- | Add the <tt>-boot</tt> suffix to .hs, .hi and .o files
addBootSuffix :: FilePath -> FilePath

-- | Module Location
--   
--   Where a module lives on the file system: the actual locations of the
--   .hs, .hi and .o files, if we have them
data ModLocation
ModLocation :: Maybe FilePath -> FilePath -> FilePath -> FilePath -> ModLocation
[ml_hs_file] :: ModLocation -> Maybe FilePath
[ml_hi_file] :: ModLocation -> FilePath
[ml_obj_file] :: ModLocation -> FilePath
[ml_hie_file] :: ModLocation -> FilePath
class ContainsModule t
extractModule :: ContainsModule t => t -> Module
class HasModule (m :: Type -> Type)
getModule :: HasModule m => m Module

-- | A unit identifier which identifies an indefinite library (with holes)
--   that has been *on-the-fly* instantiated with a substitution
--   <a>indefUnitIdInsts</a>. In fact, an indefinite unit identifier could
--   have no holes, but we haven't gotten around to compiling the actual
--   library yet.
--   
--   An indefinite unit identifier pretty-prints to something like
--   <tt>p[H=<a>H</a>,A=aimpl:A&gt;]</tt> (<tt>p</tt> is the
--   <a>ComponentId</a>, and the brackets enclose the module substitution).
data IndefUnitId
IndefUnitId :: FastString -> Unique -> !ComponentId -> ![(ModuleName, Module)] -> UniqDSet ModuleName -> IndefUnitId

-- | A private, uniquely identifying representation of a UnitId. This
--   string is completely private to GHC and is just used to get a unique;
--   in particular, we don't use it for symbols (indefinite libraries are
--   not compiled).
[indefUnitIdFS] :: IndefUnitId -> FastString

-- | Cached unique of <a>unitIdFS</a>.
[indefUnitIdKey] :: IndefUnitId -> Unique

-- | The component identity of the indefinite library that is being
--   instantiated.
[indefUnitIdComponentId] :: IndefUnitId -> !ComponentId

-- | The sorted (by <a>ModuleName</a>) instantiations of this library.
[indefUnitIdInsts] :: IndefUnitId -> ![(ModuleName, Module)]

-- | A cache of the free module variables of <tt>unitIdInsts</tt>. This
--   lets us efficiently tell if a <a>UnitId</a> has been fully
--   instantiated (free module variables are empty) and whether or not a
--   substitution can have any effect.
[indefUnitIdFreeHoles] :: IndefUnitId -> UniqDSet ModuleName
data IndefModule
IndefModule :: IndefUnitId -> ModuleName -> IndefModule
[indefModuleUnitId] :: IndefModule -> IndefUnitId
[indefModuleName] :: IndefModule -> ModuleName

-- | A <a>InstalledModule</a> is a <a>Module</a> which contains a
--   <a>InstalledUnitId</a>.
data InstalledModule
InstalledModule :: !InstalledUnitId -> !ModuleName -> InstalledModule
[installedModuleUnitId] :: InstalledModule -> !InstalledUnitId
[installedModuleName] :: InstalledModule -> !ModuleName

-- | A <a>DefUnitId</a> is an <a>InstalledUnitId</a> with the invariant
--   that it only refers to a definite library; i.e., one we have generated
--   code for.
newtype DefUnitId
DefUnitId :: InstalledUnitId -> DefUnitId
[unDefUnitId] :: DefUnitId -> InstalledUnitId

-- | A map keyed off of <a>InstalledModule</a>
data InstalledModuleEnv elt

-- | Substitution on module variables, mapping module names to module
--   identifiers.
type ShHoleSubst = ModuleNameEnv Module

-- | A map keyed off of <a>Module</a>s
data ModuleEnv elt

-- | A set of <a>Module</a>s
type ModuleSet = Set NDModule

-- | A map keyed off of <a>ModuleName</a>s (actually, their <a>Unique</a>s)
type ModuleNameEnv elt = UniqFM elt

-- | A map keyed off of <a>ModuleName</a>s (actually, their <a>Unique</a>s)
--   Has deterministic folds and can be deterministically converted to a
--   list
type DModuleNameEnv elt = UniqDFM elt

-- | Does this <a>TyCon</a> represent a tuple?
--   
--   NB: when compiling <tt>Data.Tuple</tt>, the tycons won't reply
--   <tt>True</tt> to <a>isTupleTyCon</a>, because they are built as
--   <tt>AlgTyCons</tt>. However they get spat into the interface file as
--   tuple tycons, so I don't think it matters.
isTupleTyCon :: TyCon -> Bool

-- | Is this the <a>TyCon</a> for an unboxed tuple?
isUnboxedTupleTyCon :: TyCon -> Bool
isFunTyCon :: TyCon -> Bool

-- | TyCons represent type constructors. Type constructors are introduced
--   by things such as:
--   
--   1) Data declarations: <tt>data Foo = ...</tt> creates the <tt>Foo</tt>
--   type constructor of kind <tt>*</tt>
--   
--   2) Type synonyms: <tt>type Foo = ...</tt> creates the <tt>Foo</tt>
--   type constructor
--   
--   3) Newtypes: <tt>newtype Foo a = MkFoo ...</tt> creates the
--   <tt>Foo</tt> type constructor of kind <tt>* -&gt; *</tt>
--   
--   4) Class declarations: <tt>class Foo where</tt> creates the
--   <tt>Foo</tt> type constructor of kind <tt>*</tt>
--   
--   This data type also encodes a number of primitive, built in type
--   constructors such as those for function and tuple types.
data TyCon

-- | A <a>PrimRep</a> is an abstraction of a type. It contains information
--   that the code generator needs in order to pass arguments, return
--   results, and store values of this type. See also Note [RuntimeRep and
--   PrimRep] in RepType and Note [VoidRep] in RepType.
data PrimRep
VoidRep :: PrimRep
LiftedRep :: PrimRep

-- | Unlifted pointer
UnliftedRep :: PrimRep

-- | Signed, 8-bit value
Int8Rep :: PrimRep

-- | Signed, 16-bit value
Int16Rep :: PrimRep

-- | Signed, 32-bit value
Int32Rep :: PrimRep

-- | Signed, 64 bit value (with 32-bit words only)
Int64Rep :: PrimRep

-- | Signed, word-sized value
IntRep :: PrimRep

-- | Unsigned, 8 bit value
Word8Rep :: PrimRep

-- | Unsigned, 16 bit value
Word16Rep :: PrimRep

-- | Unsigned, 32 bit value
Word32Rep :: PrimRep

-- | Unsigned, 64 bit value (with 32-bit words only)
Word64Rep :: PrimRep

-- | Unsigned, word-sized value
WordRep :: PrimRep

-- | A pointer, but <i>not</i> to a Haskell value (use '(Un)liftedRep')
AddrRep :: PrimRep
FloatRep :: PrimRep
DoubleRep :: PrimRep

-- | A vector
VecRep :: Int -> PrimElemRep -> PrimRep
mkFsEnv :: [(FastString, a)] -> FastStringEnv a
lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
emptyFsEnv :: FastStringEnv a

-- | A non-deterministic set of FastStrings. See Note [Deterministic
--   UniqFM] in UniqDFM 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 a
pprUniqSet :: (a -> SDoc) -> UniqSet a -> SDoc

-- | <a>unsafeUFMToUniqSet</a> converts a <tt><a>UniqFM</a> a</tt> into a
--   <tt><a>UniqSet</a> a</tt> assuming, without checking, that it maps
--   each <a>Unique</a> to a value that has that <a>Unique</a>. See Note
--   [UniqSet invariant].
unsafeUFMToUniqSet :: UniqFM a -> UniqSet a
getUniqSet :: UniqSet a -> UniqFM a
mapUniqSet :: Uniquable b => (a -> b) -> UniqSet a -> UniqSet b
nonDetFoldUniqSet_Directly :: (Unique -> elt -> a -> a) -> a -> UniqSet elt -> a
nonDetFoldUniqSet :: (elt -> a -> a) -> a -> UniqSet elt -> a
nonDetKeysUniqSet :: UniqSet elt -> [Unique]
nonDetEltsUniqSet :: UniqSet elt -> [elt]
lookupUniqSet_Directly :: UniqSet a -> Unique -> Maybe a
lookupUniqSet :: Uniquable a => UniqSet b -> a -> Maybe b
isEmptyUniqSet :: UniqSet a -> Bool
sizeUniqSet :: UniqSet a -> Int
uniqSetAll :: (a -> Bool) -> UniqSet a -> Bool
uniqSetAny :: (a -> Bool) -> UniqSet a -> Bool
partitionUniqSet :: (a -> Bool) -> UniqSet a -> (UniqSet a, UniqSet a)
filterUniqSet_Directly :: (Unique -> elt -> Bool) -> UniqSet elt -> UniqSet elt
filterUniqSet :: (a -> Bool) -> UniqSet a -> UniqSet a
elemUniqSet_Directly :: Unique -> UniqSet a -> Bool
elementOfUniqSet :: Uniquable a => a -> UniqSet a -> Bool
uniqSetMinusUFM :: UniqSet a -> UniqFM b -> UniqSet a
restrictUniqSetToUFM :: UniqSet a -> UniqFM b -> UniqSet a
intersectUniqSets :: UniqSet a -> UniqSet a -> UniqSet a
minusUniqSet :: UniqSet a -> UniqSet a -> UniqSet a
unionManyUniqSets :: [UniqSet a] -> UniqSet a
unionUniqSets :: UniqSet a -> UniqSet a -> UniqSet a
delListFromUniqSet_Directly :: UniqSet a -> [Unique] -> UniqSet a
delListFromUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a
delOneFromUniqSet_Directly :: UniqSet a -> Unique -> UniqSet a
delOneFromUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a
addListToUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a
addOneToUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a
mkUniqSet :: Uniquable a => [a] -> UniqSet a
unitUniqSet :: Uniquable a => a -> UniqSet a
emptyUniqSet :: UniqSet a
data UniqSet a
isKindLevel :: TypeOrKind -> Bool
isTypeLevel :: TypeOrKind -> Bool

-- | Inject any integer into an <a>IntWithInf</a>
mkIntWithInf :: Int -> IntWithInf

-- | Turn a positive number into an <a>IntWithInf</a>, where 0 represents
--   infinity
treatZeroAsInf :: Int -> IntWithInf
intGtLimit :: Int -> IntWithInf -> Bool

-- | A representation of infinity
infinity :: IntWithInf
integralFractionalLit :: Bool -> Integer -> FractionalLit
negateFractionalLit :: FractionalLit -> FractionalLit
mkFractionalLit :: Real a => a -> FractionalLit
negateIntegralLit :: IntegralLit -> IntegralLit
mkIntegralLit :: Integral a => a -> IntegralLit
isEarlyActive :: Activation -> Bool
isAlwaysActive :: Activation -> Bool
isNeverActive :: Activation -> Bool
competesWith :: Activation -> Activation -> Bool
isActiveIn :: PhaseNum -> Activation -> Bool
isActive :: CompilerPhase -> Activation -> Bool
pprInlineDebug :: InlinePragma -> SDoc
pprInline :: InlinePragma -> SDoc
setInlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo -> InlinePragma
setInlinePragmaActivation :: InlinePragma -> Activation -> InlinePragma
inlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo
inlinePragmaActivation :: InlinePragma -> Activation
inlinePragmaSat :: InlinePragma -> Maybe Arity
isAnyInlinePragma :: InlinePragma -> Bool
isInlinablePragma :: InlinePragma -> Bool
isInlinePragma :: InlinePragma -> Bool
isDefaultInlinePragma :: InlinePragma -> Bool
dfunInlinePragma :: InlinePragma
inlinePragmaSpec :: InlinePragma -> InlineSpec
neverInlinePragma :: InlinePragma
alwaysInlinePragma :: InlinePragma
defaultInlinePragma :: InlinePragma
noUserInlineSpec :: InlineSpec -> Bool
isFunLike :: RuleMatchInfo -> Bool
isConLike :: RuleMatchInfo -> Bool
activeDuringFinal :: Activation
activeAfterInitial :: Activation

-- | Special combinator for showing string literals.
pprWithSourceText :: SourceText -> SDoc -> SDoc
failed :: SuccessFlag -> Bool
succeeded :: SuccessFlag -> Bool
successIf :: Bool -> SuccessFlag
zapFragileOcc :: OccInfo -> OccInfo
isOneOcc :: OccInfo -> Bool
isDeadOcc :: OccInfo -> Bool
isStrongLoopBreaker :: OccInfo -> Bool
isWeakLoopBreaker :: OccInfo -> Bool
weakLoopBreaker :: OccInfo
strongLoopBreaker :: OccInfo
isAlwaysTailCalled :: OccInfo -> Bool
zapOccTailCallInfo :: OccInfo -> OccInfo
tailCallInfo :: OccInfo -> TailCallInfo
notInsideLam :: InsideLam
insideLam :: InsideLam
seqOccInfo :: OccInfo -> ()
isManyOccs :: OccInfo -> Bool
noOccInfo :: OccInfo
oneBranch :: BranchCount

-- | Pretty print an alternative in an unboxed sum e.g. "| a | |".
pprAlternative :: (a -> SDoc) -> a -> ConTag -> Arity -> SDoc
sumParens :: SDoc -> SDoc
tupleParens :: TupleSort -> SDoc -> SDoc
boxityTupleSort :: Boxity -> TupleSort
tupleSortBoxity :: TupleSort -> Boxity
maybeParen :: PprPrec -> PprPrec -> SDoc -> SDoc
appPrec :: PprPrec
opPrec :: PprPrec
funPrec :: PprPrec
sigPrec :: PprPrec
topPrec :: PprPrec
hasOverlappingFlag :: OverlapMode -> Bool
hasOverlappableFlag :: OverlapMode -> Bool
hasIncoherentFlag :: OverlapMode -> Bool
setOverlapModeMaybe :: OverlapFlag -> Maybe OverlapMode -> OverlapFlag
isGenerated :: Origin -> Bool
boolToRecFlag :: Bool -> RecFlag
isNonRec :: RecFlag -> Bool
isRec :: RecFlag -> Bool
isBoxed :: Boxity -> Bool
isTopLevel :: TopLevelFlag -> Bool
isNotTopLevel :: TopLevelFlag -> Bool
compareFixity :: Fixity -> Fixity -> (Bool, Bool)
funTyFixity :: Fixity
negateFixity :: Fixity
defaultFixity :: Fixity
minPrecedence :: Int
maxPrecedence :: Int
pprRuleName :: RuleName -> SDoc
pprWarningTxtForMsg :: WarningTxt -> SDoc
initialVersion :: Version
bumpVersion :: Version -> Version
isPromoted :: PromotionFlag -> Bool
unSwap :: SwapFlag -> (a -> a -> b) -> a -> a -> b
isSwapped :: SwapFlag -> Bool
flipSwap :: SwapFlag -> SwapFlag
bestOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
worstOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
hasNoOneShotInfo :: OneShotInfo -> Bool
isOneShotInfo :: OneShotInfo -> Bool

-- | It is always safe to assume that an <tt>Id</tt> has no lambda-bound
--   variable information
noOneShotInfo :: OneShotInfo
alignmentOf :: Int -> Alignment
mkAlignment :: Int -> Alignment

-- | Tags are allocated from here for real constructors or for superclass
--   selectors
fIRST_TAG :: ConTag
pickLR :: LeftOrRight -> (a, a) -> a
data LeftOrRight
CLeft :: LeftOrRight
CRight :: LeftOrRight

-- | The number of value arguments that can be applied to a value before it
--   does "real work". So: fib 100 has arity 0 x -&gt; fib x has arity 1
--   See also Note [Definition of arity] in CoreArity
type Arity = Int

-- | 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
--   -&gt; fib x has representation arity 1 (# x, y #) -&gt; fib (x + y)
--   has representation arity 2
type RepArity = Int

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

-- | Constructor Tag
--   
--   Type of the tags associated with each constructor possibility or
--   superclass selector
type ConTag = Int

-- | A *zero-indexed* constructor tag
type ConTagZ = Int

-- | A power-of-two alignment
data Alignment

-- | If the <tt>Id</tt> 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.
data OneShotInfo

-- | No information
NoOneShotInfo :: OneShotInfo

-- | The lambda is applied at most once.
OneShotLam :: OneShotInfo
data SwapFlag
NotSwapped :: SwapFlag
IsSwapped :: SwapFlag

-- | Is a TyCon a promoted data constructor or just a normal type
--   constructor?
data PromotionFlag
NotPromoted :: PromotionFlag
IsPromoted :: PromotionFlag
data FunctionOrData
IsFunction :: FunctionOrData
IsData :: FunctionOrData
type Version = Int

-- | A String Literal in the source, including its original raw format for
--   use by source to source manipulation tools.
data StringLiteral
StringLiteral :: SourceText -> FastString -> StringLiteral
[sl_st] :: StringLiteral -> SourceText
[sl_fs] :: StringLiteral -> FastString

-- | Warning Text
--   
--   reason/explanation from a WARNING or DEPRECATED pragma
data WarningTxt
WarningTxt :: Located SourceText -> [Located StringLiteral] -> WarningTxt
DeprecatedTxt :: Located SourceText -> [Located StringLiteral] -> WarningTxt
type RuleName = FastString
data Fixity
Fixity :: SourceText -> Int -> FixityDirection -> Fixity
data FixityDirection
InfixL :: FixityDirection
InfixR :: FixityDirection
InfixN :: FixityDirection

-- | 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 TopLevelFlag
TopLevel :: TopLevelFlag
NotTopLevel :: TopLevelFlag
data Boxity
Boxed :: Boxity
Unboxed :: Boxity

-- | Recursivity Flag
data RecFlag
Recursive :: RecFlag
NonRecursive :: RecFlag
data Origin
FromSource :: Origin
Generated :: Origin

-- | The semantics allowed for overlapping instances for a particular
--   instance. See Note [Safe Haskell isSafeOverlap] (in <a>hs</a>) for a
--   explanation of the <a>isSafeOverlap</a> field.
--   
--   <ul>
--   <li><a>AnnKeywordId</a> : <a>AnnOpen</a> <tt>'{-# OVERLAPPABLE'</tt>
--   or <tt>'{-# OVERLAPPING'</tt> or <tt>'{-# OVERLAPS'</tt> or <tt>'{-#
--   INCOHERENT'</tt>, <a>AnnClose</a> <tt>`#-}`</tt>,</li>
--   </ul>
data OverlapFlag
OverlapFlag :: OverlapMode -> Bool -> OverlapFlag
[overlapMode] :: OverlapFlag -> OverlapMode
[isSafeOverlap] :: OverlapFlag -> Bool
data OverlapMode

-- | This instance must not overlap another <a>NoOverlap</a> instance.
--   However, it may be overlapped by <a>Overlapping</a> instances, and it
--   may overlap <a>Overlappable</a> 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 <a>Overlapping</a> and <a>Overlappable</a>
--   flags.
Overlaps :: SourceText -> OverlapMode

-- | Behave like Overlappable and Overlapping, and in addition pick an 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 <tt>b</tt> would change which instance was chosen. See
--   also note [Incoherent instances] in InstEnv
Incoherent :: SourceText -> OverlapMode

-- | A general-purpose pretty-printing precedence type.
newtype PprPrec
PprPrec :: Int -> PprPrec
data TupleSort
BoxedTuple :: TupleSort
UnboxedTuple :: TupleSort
ConstraintTuple :: TupleSort

-- | Embedding Projection pair
data EP a
EP :: a -> a -> EP a
[fromEP] :: EP a -> a
[toEP] :: EP a -> a

-- | 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
type BranchCount = Int

-- | Interesting Context
type InterestingCxt = Bool

-- | Inside Lambda
type InsideLam = Bool
data TailCallInfo
AlwaysTailCalled :: JoinArity -> TailCallInfo
NoTailCallInfo :: TailCallInfo

-- | Default Method Specification
data DefMethSpec ty
VanillaDM :: DefMethSpec ty
GenericDM :: ty -> DefMethSpec ty
data SuccessFlag
Succeeded :: SuccessFlag
Failed :: SuccessFlag
data SourceText
SourceText :: String -> SourceText

-- | For when code is generated, e.g. TH, deriving. The pretty printer will
--   then make its own representation of the item.
NoSourceText :: SourceText

-- | Phase Number
type PhaseNum = Int
data CompilerPhase
Phase :: PhaseNum -> CompilerPhase
InitialPhase :: CompilerPhase
data Activation
NeverActive :: Activation
AlwaysActive :: Activation
ActiveBefore :: SourceText -> PhaseNum -> Activation
ActiveAfter :: SourceText -> PhaseNum -> Activation

-- | Rule Match Information
data RuleMatchInfo
ConLike :: RuleMatchInfo
FunLike :: RuleMatchInfo
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

-- | Inline Specification
data InlineSpec
Inline :: InlineSpec
Inlinable :: InlineSpec
NoInline :: InlineSpec
NoUserInline :: InlineSpec

-- | Integral Literal
--   
--   Used (instead of Integer) to represent negative zegative zero which is
--   required for NegativeLiterals extension to correctly parse
--   `-0::Double` as negative zero. See also #13211.
data IntegralLit
IL :: SourceText -> Bool -> Integer -> IntegralLit
[il_text] :: IntegralLit -> SourceText
[il_neg] :: IntegralLit -> Bool
[il_value] :: IntegralLit -> Integer

-- | Fractional Literal
--   
--   Used (instead of Rational) to represent exactly the floating point
--   literal that we encountered in the user's source program. This allows
--   us to pretty-print exactly what the user wrote, which is important
--   e.g. for floating point numbers that can't represented as Doubles (we
--   used to via Double for pretty-printing). See also #2245.
data FractionalLit
FL :: SourceText -> Bool -> Rational -> FractionalLit
[fl_text] :: FractionalLit -> SourceText
[fl_neg] :: FractionalLit -> Bool
[fl_value] :: FractionalLit -> Rational

-- | An integer or infinity
data IntWithInf
data SpliceExplicitFlag

-- | <a>=</a> $(f x y)
ExplicitSplice :: SpliceExplicitFlag

-- | <a>=</a> f x y, i.e. a naked top level expression
ImplicitSplice :: SpliceExplicitFlag

-- | Flag to see whether we're type-checking terms or kind-checking types
data TypeOrKind
TypeLevel :: TypeOrKind
KindLevel :: TypeOrKind
unRealSrcSpan :: RealLocated a -> a
getRealSrcSpan :: RealLocated a -> RealSrcSpan
liftL :: (HasSrcSpan a, HasSrcSpan b, Monad m) => (SrcSpanLess a -> m (SrcSpanLess b)) -> a -> m b

-- | Lifts a function of undecorated entities to one of decorated ones
onHasSrcSpan :: (HasSrcSpan a, HasSrcSpan b) => (SrcSpanLess a -> SrcSpanLess b) -> a -> b

-- | An abbreviated form of composeSrcSpan, mainly to replace the hardcoded
--   <a>L</a>
cL :: HasSrcSpan a => SrcSpan -> SrcSpanLess a -> a

-- | An abbreviated form of decomposeSrcSpan, mainly to be used in
--   ViewPatterns
dL :: HasSrcSpan a => a -> Located (SrcSpanLess a)

-- | Determines whether a span is enclosed by another one
isSubspanOf :: SrcSpan -> SrcSpan -> Bool

-- | Determines whether a span encloses a given line and column index
spans :: SrcSpan -> (Int, Int) -> Bool

-- | Alternative strategies for ordering <a>SrcSpan</a>s
leftmost_largest :: SrcSpan -> SrcSpan -> Ordering

-- | Alternative strategies for ordering <a>SrcSpan</a>s
leftmost_smallest :: SrcSpan -> SrcSpan -> Ordering

-- | Alternative strategies for ordering <a>SrcSpan</a>s
rightmost :: SrcSpan -> SrcSpan -> Ordering

-- | Tests the ordering of the two located things
cmpLocated :: (HasSrcSpan a, Ord (SrcSpanLess a)) => a -> a -> Ordering

-- | Tests whether the two located things are equal
eqLocated :: (HasSrcSpan a, Eq (SrcSpanLess a)) => a -> a -> Bool

-- | Combine locations from two <a>Located</a> things and add them to a
--   third thing
addCLoc :: (HasSrcSpan a, HasSrcSpan b, HasSrcSpan c) => a -> b -> SrcSpanLess c -> c
combineLocs :: (HasSrcSpan a, HasSrcSpan b) => a -> b -> SrcSpan
mkGeneralLocated :: HasSrcSpan e => String -> SrcSpanLess e -> e
noLoc :: HasSrcSpan a => SrcSpanLess a -> a
getLoc :: HasSrcSpan a => a -> SrcSpan
unLoc :: HasSrcSpan a => a -> SrcSpanLess a
mapLoc :: (a -> b) -> GenLocated l a -> GenLocated l b
pprUserRealSpan :: Bool -> RealSrcSpan -> SDoc

-- | Obtains the filename for a <a>SrcSpan</a> if it is "good"
srcSpanFileName_maybe :: SrcSpan -> Maybe FastString
realSrcSpanEnd :: RealSrcSpan -> RealSrcLoc
realSrcSpanStart :: RealSrcSpan -> RealSrcLoc

-- | Returns the location at the end of the <a>SrcSpan</a> or a "bad"
--   <a>SrcSpan</a> if that is unavailable
srcSpanEnd :: SrcSpan -> SrcLoc

-- | Returns the location at the start of the <a>SrcSpan</a> or a "bad"
--   <a>SrcSpan</a> if that is unavailable
srcSpanStart :: SrcSpan -> SrcLoc
srcSpanEndCol :: RealSrcSpan -> Int
srcSpanStartCol :: RealSrcSpan -> Int
srcSpanEndLine :: RealSrcSpan -> Int
srcSpanStartLine :: RealSrcSpan -> Int

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

-- | True if the span is known to straddle only one line. For "bad"
--   <a>SrcSpan</a>, it returns False
isOneLineSpan :: SrcSpan -> Bool

-- | Test if a <a>SrcSpan</a> is "good", i.e. has precise location
--   information
isGoodSrcSpan :: SrcSpan -> Bool

-- | Convert a SrcSpan into one that represents only its first character
srcSpanFirstCharacter :: SrcSpan -> SrcSpan

-- | Combines two <a>SrcSpan</a> into one that spans at least all the
--   characters within both spans. Returns UnhelpfulSpan if the files
--   differ.
combineSrcSpans :: SrcSpan -> SrcSpan -> SrcSpan

-- | Create a <a>SrcSpan</a> between two points in a file
mkSrcSpan :: SrcLoc -> SrcLoc -> SrcSpan

-- | Create a <a>SrcSpan</a> between two points in a file
mkRealSrcSpan :: RealSrcLoc -> RealSrcLoc -> RealSrcSpan
realSrcLocSpan :: RealSrcLoc -> RealSrcSpan

-- | Create a <a>SrcSpan</a> corresponding to a single point
srcLocSpan :: SrcLoc -> SrcSpan

-- | Create a "bad" <a>SrcSpan</a> that has not location information
mkGeneralSrcSpan :: FastString -> SrcSpan

-- | Built-in "bad" <a>SrcSpan</a>s for common sources of location
--   uncertainty
interactiveSrcSpan :: SrcSpan

-- | Built-in "bad" <a>SrcSpan</a>s for common sources of location
--   uncertainty
wiredInSrcSpan :: SrcSpan

-- | Built-in "bad" <a>SrcSpan</a>s for common sources of location
--   uncertainty
noSrcSpan :: SrcSpan
sortLocated :: HasSrcSpan a => [a] -> [a]

-- | Move the <a>SrcLoc</a> 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

-- | Raises an error when used on a "bad" <a>SrcLoc</a>
srcLocCol :: RealSrcLoc -> Int

-- | Raises an error when used on a "bad" <a>SrcLoc</a>
srcLocLine :: RealSrcLoc -> Int

-- | Gives the filename of the <a>RealSrcLoc</a>
srcLocFile :: RealSrcLoc -> FastString

-- | Creates a "bad" <a>SrcLoc</a> that has no detailed information about
--   its location
mkGeneralSrcLoc :: FastString -> SrcLoc

-- | Built-in "bad" <a>SrcLoc</a> values for particular locations
interactiveSrcLoc :: SrcLoc

-- | Built-in "bad" <a>SrcLoc</a> values for particular locations
generatedSrcLoc :: SrcLoc

-- | Built-in "bad" <a>SrcLoc</a> values for particular locations
noSrcLoc :: SrcLoc
mkRealSrcLoc :: FastString -> Int -> Int -> RealSrcLoc
mkSrcLoc :: FastString -> Int -> Int -> SrcLoc

-- | A Pattern Synonym to Set/Get SrcSpans
pattern LL :: HasSrcSpan a => SrcSpan -> SrcSpanLess a -> a

-- | Real Source Location
--   
--   Represents a single point within a file
data RealSrcLoc

-- | Source Location
data SrcLoc
RealSrcLoc :: {-# UNPACK #-} !RealSrcLoc -> SrcLoc
UnhelpfulLoc :: FastString -> SrcLoc

-- | A <a>RealSrcSpan</a> 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 <i>after</i> 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

-- | Source Span
--   
--   A <a>SrcSpan</a> identifies either a specific portion of a text file
--   or a human-readable description of a location.
data SrcSpan
RealSrcSpan :: !RealSrcSpan -> SrcSpan
UnhelpfulSpan :: !FastString -> SrcSpan

-- | 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
type Located = GenLocated SrcSpan
type RealLocated = GenLocated RealSrcSpan

-- | Determines the type of undecorated syntactic entities For most
--   syntactic entities <tt>E</tt>, where source location spans are
--   introduced by a wrapper construtor of the same syntactic entity, we
--   have `SrcSpanLess E = E`. However, some syntactic entities have a
--   different type compared to a syntactic entity `e :: E` may have the
--   type `Located E` when decorated by wrapping it with `L sp e` for a
--   source span <tt>sp</tt>.
type family SrcSpanLess a

-- | A typeclass to set/get SrcSpans
class HasSrcSpan a

-- | Composes a <a>SrcSpan</a> decoration with an undecorated syntactic
--   entity to form its decorated variant
composeSrcSpan :: HasSrcSpan a => Located (SrcSpanLess a) -> a

-- | Decomposes a decorated syntactic entity into its <a>SrcSpan</a>
--   decoration and its undecorated variant
decomposeSrcSpan :: HasSrcSpan a => a -> Located (SrcSpanLess a)
pprDebugAndThen :: DynFlags -> (String -> a) -> SDoc -> SDoc -> a

-- | Panic with an assertation failure, recording the given file and line
--   number. Should typically be accessed with the ASSERT family of macros
assertPprPanic :: HasCallStack => String -> Int -> SDoc -> a

-- | If debug output is on, show some <a>SDoc</a> on the screen along with
--   a call stack when available.
pprSTrace :: HasCallStack => SDoc -> a -> a

-- | <tt>pprTraceException desc x action</tt> runs action, printing a
--   message if it throws an exception.
pprTraceException :: ExceptionMonad m => String -> SDoc -> m a -> m a

-- | <tt>pprTraceIt desc x</tt> is equivalent to <tt>pprTrace desc (ppr x)
--   x</tt>
pprTraceIt :: Outputable a => String -> a -> a

-- | <tt>pprTraceWith desc f x</tt> is equivalent to <tt>pprTrace desc (f
--   x) x</tt>. This allows you to print details from the returned value as
--   well as from ambient variables.
pprTraceWith :: String -> (a -> SDoc) -> a -> a
pprTraceM :: Applicative f => String -> SDoc -> f ()

-- | If debug output is on, show some <a>SDoc</a> on the screen
pprTrace :: String -> SDoc -> a -> a
pprTraceDebug :: String -> SDoc -> a -> a

-- | Throw an exception saying "bug in pgm being compiled" (used for
--   unusual program errors)
pprPgmError :: String -> SDoc -> a

-- | Throw an exception saying "this isn't finished yet"
pprSorry :: String -> SDoc -> a

-- | Throw an exception saying "bug in GHC"
pprPanic :: HasCallStack => String -> SDoc -> a
callStackDoc :: HasCallStack => SDoc

-- | Determines the form of to do appropriate for the length of a list:
--   
--   <pre>
--   doOrDoes [] = text "do"
--   doOrDoes ["Hello"] = text "does"
--   doOrDoes ["Hello", "World"] = text "do"
--   </pre>
doOrDoes :: [a] -> SDoc

-- | Determines the form of to be appropriate for the length of a list:
--   
--   <pre>
--   isOrAre [] = text "are"
--   isOrAre ["Hello"] = text "is"
--   isOrAre ["Hello", "World"] = text "are"
--   </pre>
isOrAre :: [a] -> SDoc

-- | Determines the pluralisation suffix appropriate for the length of a
--   list:
--   
--   <pre>
--   plural [] = char 's'
--   plural ["Hello"] = empty
--   plural ["Hello", "World"] = char 's'
--   </pre>
plural :: [a] -> SDoc

-- | Converts an integer and object description to a statement about the
--   multiplicity of those objects:
--   
--   <pre>
--   speakNOf 0 (text "melon") = text "no melons"
--   speakNOf 1 (text "melon") = text "one melon"
--   speakNOf 3 (text "melon") = text "three melons"
--   </pre>
speakNOf :: Int -> SDoc -> SDoc

-- | Converts an integer to a verbal multiplicity:
--   
--   <pre>
--   speakN 0 = text "none"
--   speakN 5 = text "five"
--   speakN 10 = text "10"
--   </pre>
speakN :: Int -> SDoc

-- | Converts an integer to a verbal index:
--   
--   <pre>
--   speakNth 1 = text "first"
--   speakNth 5 = text "fifth"
--   speakNth 21 = text "21st"
--   </pre>
speakNth :: Int -> SDoc
intWithCommas :: Integral a => a -> SDoc
quotedListWithNor :: [SDoc] -> SDoc
quotedListWithOr :: [SDoc] -> SDoc

-- | Returns the comma-separated concatenation of the quoted pretty printed
--   things.
--   
--   <pre>
--   [x,y,z]  ==&gt;  `x', `y', `z'
--   </pre>
pprQuotedList :: Outputable a => [a] -> SDoc

-- | Returns the comma-separated concatenation of the pretty printed
--   things.
interpp'SP :: Outputable a => [a] -> SDoc

-- | Returns the separated concatenation of the pretty printed things.
interppSP :: Outputable a => [a] -> SDoc
pprWithBars :: (a -> SDoc) -> [a] -> SDoc
pprWithCommas :: (a -> SDoc) -> [a] -> SDoc

-- | Normalise, escape and render a string representing a path
--   
--   e.g. "c:\whatever"
pprFilePathString :: FilePath -> SDoc
pprFastFilePath :: FastString -> SDoc
pprInfixVar :: Bool -> SDoc -> SDoc
pprPrefixVar :: Bool -> SDoc -> SDoc
pprPrimWord64 :: Integer -> SDoc
pprPrimInt64 :: Integer -> SDoc
pprPrimWord :: Integer -> SDoc
pprPrimInt :: Integer -> SDoc

-- | Special combinator for showing unboxed literals.
pprPrimChar :: Char -> SDoc
primWord64Suffix :: SDoc
primInt64Suffix :: SDoc
primWordSuffix :: SDoc
primDoubleSuffix :: SDoc
primIntSuffix :: SDoc
primFloatSuffix :: SDoc
primCharSuffix :: SDoc

-- | Special combinator for showing bytestring literals.
pprHsBytes :: ByteString -> SDoc

-- | Special combinator for showing string literals.
pprHsString :: FastString -> SDoc

-- | Special combinator for showing character literals.
pprHsChar :: Char -> SDoc
keyword :: SDoc -> SDoc

-- | Apply the given colour/style for the argument.
--   
--   Only takes effect if colours are enabled.
coloured :: PprColour -> SDoc -> SDoc
ppUnless :: Bool -> SDoc -> SDoc
ppWhen :: Bool -> SDoc -> SDoc
punctuate :: SDoc -> [SDoc] -> [SDoc]

-- | This behaves like <a>hang</a>, but does not indent the second document
--   when the header is empty.
hangNotEmpty :: SDoc -> Int -> SDoc -> SDoc
hang :: SDoc -> Int -> SDoc -> SDoc

-- | This behaves like <a>fsep</a>, but it uses <a>&lt;&gt;</a> for
--   horizontal conposition rather than <a>&lt;+&gt;</a>
fcat :: [SDoc] -> 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

-- | Catenate: is either like <a>hcat</a> or like <a>vcat</a>, depending on
--   what fits
cat :: [SDoc] -> SDoc

-- | Separate: is either like <a>hsep</a> or like <a>vcat</a>, depending on
--   what fits
sep :: [SDoc] -> SDoc

-- | Concatenate <a>SDoc</a> vertically with dovetailing
vcat :: [SDoc] -> SDoc

-- | Concatenate <a>SDoc</a> horizontally with a space between each one
hsep :: [SDoc] -> SDoc

-- | Concatenate <a>SDoc</a> horizontally
hcat :: [SDoc] -> SDoc

-- | Join two <a>SDoc</a> together vertically
($+$) :: SDoc -> SDoc -> SDoc

-- | Join two <a>SDoc</a> together vertically; if there is no vertical
--   overlap it "dovetails" the two onto one line
($$) :: SDoc -> SDoc -> SDoc

-- | Join two <a>SDoc</a> together horizontally with a gap between them
(<+>) :: SDoc -> SDoc -> SDoc

-- | Join two <a>SDoc</a> together horizontally without a gap
(<>) :: SDoc -> SDoc -> SDoc

-- | Indent <a>SDoc</a> some specified amount
nest :: Int -> SDoc -> SDoc
unicodeSyntax :: SDoc -> SDoc -> SDoc
bullet :: SDoc
kindType :: SDoc
forAllLit :: SDoc
rbrace :: SDoc
lbrace :: SDoc
rbrack :: SDoc
lbrack :: SDoc
rparen :: SDoc
lparen :: SDoc
vbar :: SDoc
dot :: SDoc
underscore :: SDoc
space :: SDoc
equals :: SDoc
colon :: SDoc
comma :: SDoc
semi :: SDoc
larrowtt :: SDoc
arrowtt :: SDoc
larrowt :: SDoc
arrowt :: SDoc
darrow :: SDoc
larrow :: SDoc
arrow :: SDoc
dcolon :: SDoc
blankLine :: SDoc
quotes :: SDoc -> SDoc
cparen :: Bool -> SDoc -> SDoc
angleBrackets :: SDoc -> SDoc
doubleQuotes :: SDoc -> SDoc
quote :: SDoc -> SDoc
brackets :: SDoc -> SDoc
braces :: SDoc -> SDoc
parens :: SDoc -> SDoc

-- | <tt>doublePrec p n</tt> shows a floating point number <tt>n</tt> with
--   <tt>p</tt> digits of precision after the decimal point.
doublePrec :: Int -> Double -> SDoc
word :: Integer -> SDoc
rational :: Rational -> SDoc
double :: Double -> SDoc
float :: Float -> SDoc
integer :: Integer -> SDoc
int :: Int -> SDoc
ztext :: FastZString -> SDoc
ptext :: PtrString -> SDoc
ftext :: FastString -> SDoc
char :: Char -> SDoc
empty :: SDoc
docToSDoc :: Doc -> SDoc
isEmpty :: DynFlags -> SDoc -> Bool
showSDocDumpOneLine :: DynFlags -> SDoc -> String
showSDocOneLine :: DynFlags -> SDoc -> String
renderWithStyle :: DynFlags -> SDoc -> PprStyle -> String
showSDocDebug :: DynFlags -> SDoc -> String
showSDocDump :: DynFlags -> SDoc -> String
showSDocForUser :: DynFlags -> PrintUnqualified -> SDoc -> String
showSDocUnqual :: DynFlags -> SDoc -> String
showPpr :: Outputable a => DynFlags -> a -> String
showSDoc :: DynFlags -> SDoc -> String
mkCodeStyle :: CodeStyle -> PprStyle
pprCode :: CodeStyle -> SDoc -> SDoc

-- | An efficient variant of <a>printSDoc</a> specialized for
--   <a>LeftMode</a> that outputs to a <a>BufHandle</a>.
bufLeftRenderSDoc :: DynFlags -> BufHandle -> PprStyle -> SDoc -> IO ()

-- | Like <a>printSDocLn</a> but specialized with <a>LeftMode</a> and
--   <tt><a>PprCode</a> <a>CStyle</a></tt>. This is typically used to
--   output C-- code.
printForC :: DynFlags -> Handle -> SDoc -> IO ()
printForUserPartWay :: DynFlags -> Handle -> Int -> PrintUnqualified -> SDoc -> IO ()
printForUser :: DynFlags -> Handle -> PrintUnqualified -> SDoc -> IO ()

-- | Like <a>printSDoc</a> but appends an extra newline.
printSDocLn :: Mode -> DynFlags -> Handle -> PprStyle -> SDoc -> IO ()

-- | The analog of <a>printDoc_</a> for <a>SDoc</a>, 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 :: Mode -> DynFlags -> Handle -> PprStyle -> SDoc -> IO ()

-- | Says what to do with -dppr-debug; without, return empty
whenPprDebug :: SDoc -> SDoc

-- | Says what to do with and without -dppr-debug
ifPprDebug :: SDoc -> SDoc -> SDoc
getPprDebug :: (Bool -> SDoc) -> SDoc
userStyle :: PprStyle -> Bool
debugStyle :: PprStyle -> Bool
dumpStyle :: PprStyle -> Bool
asmStyle :: PprStyle -> Bool
codeStyle :: PprStyle -> Bool
queryQual :: PprStyle -> PrintUnqualified
qualPackage :: PprStyle -> QueryQualifyPackage
qualModule :: PprStyle -> QueryQualifyModule
qualName :: PprStyle -> QueryQualifyName
updSDocDynFlags :: (DynFlags -> DynFlags) -> SDoc -> SDoc
sdocWithPlatform :: (Platform -> SDoc) -> SDoc
sdocWithDynFlags :: (DynFlags -> SDoc) -> SDoc
getPprStyle :: (PprStyle -> SDoc) -> SDoc
pprSetDepth :: Depth -> SDoc -> SDoc

-- | Truncate a list that is longer than the current depth.
pprDeeperList :: ([SDoc] -> SDoc) -> [SDoc] -> SDoc
pprDeeper :: SDoc -> SDoc

-- | This is not a recommended way to render <a>SDoc</a>, since it breaks
--   the abstraction layer of <a>SDoc</a>. Prefer to use <a>printSDoc</a>,
--   <a>printSDocLn</a>, <a>bufLeftRenderSDoc</a>, or
--   <a>renderWithStyle</a> instead.
withPprStyleDoc :: DynFlags -> PprStyle -> SDoc -> Doc
withPprStyle :: PprStyle -> SDoc -> SDoc
initSDocContext :: DynFlags -> PprStyle -> SDocContext
setStyleColoured :: Bool -> PprStyle -> PprStyle
mkUserStyle :: DynFlags -> PrintUnqualified -> Depth -> PprStyle
cmdlineParserStyle :: DynFlags -> PprStyle

-- | Style for printing error messages
mkErrStyle :: DynFlags -> PrintUnqualified -> PprStyle
defaultErrStyle :: DynFlags -> PprStyle
mkDumpStyle :: DynFlags -> PrintUnqualified -> PprStyle
defaultDumpStyle :: DynFlags -> PprStyle
defaultUserStyle :: DynFlags -> PprStyle
neverQualify :: PrintUnqualified
alwaysQualify :: PrintUnqualified
reallyAlwaysQualify :: PrintUnqualified
neverQualifyPackages :: QueryQualifyPackage
alwaysQualifyPackages :: QueryQualifyPackage
neverQualifyModules :: QueryQualifyModule
alwaysQualifyModules :: QueryQualifyModule
neverQualifyNames :: QueryQualifyName

-- | NB: This won't ever show package IDs
alwaysQualifyNames :: QueryQualifyName
reallyAlwaysQualifyNames :: QueryQualifyName
data PprStyle
data CodeStyle
CStyle :: CodeStyle
AsmStyle :: CodeStyle
data Depth
AllTheWay :: Depth
PartWay :: Int -> Depth

-- | 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 <a>SDoc</a>.
data PrintUnqualified
QueryQualify :: QueryQualifyName -> QueryQualifyModule -> QueryQualifyPackage -> PrintUnqualified
[queryQualifyName] :: PrintUnqualified -> QueryQualifyName
[queryQualifyModule] :: PrintUnqualified -> QueryQualifyModule
[queryQualifyPackage] :: PrintUnqualified -> QueryQualifyPackage

-- | Given a <tt>Name</tt>'s <a>Module</a> and <a>OccName</a>, 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

-- | For a given package, we need to know whether to print it with the
--   component id to disambiguate it.
type QueryQualifyPackage = UnitId -> Bool
data QualifyName
NameUnqual :: QualifyName
NameQual :: ModuleName -> QualifyName
NameNotInScope1 :: QualifyName
NameNotInScope2 :: QualifyName

-- | Class designating that some type has an <a>SDoc</a> representation
class Outputable a
ppr :: Outputable a => a -> SDoc
pprPrec :: Outputable a => Rational -> a -> SDoc

-- | <a>BindingSite</a> 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 PprCore
data BindingSite

-- | The x in (x. e)
LambdaBind :: BindingSite

-- | The x in case scrut of x { (y,z) -&gt; ... }
CaseBind :: BindingSite

-- | The y,z in case scrut of x { (y,z) -&gt; ... }
CasePatBind :: BindingSite

-- | The x in (let x = rhs in e)
LetBind :: BindingSite

-- | When we print a binder, we often want to print its type too. The
--   <tt>OutputableBndr</tt> 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
unitIdString :: UnitId -> String

-- | A Module is a pair of a <a>UnitId</a> and a <a>ModuleName</a>.
--   
--   Module variables (i.e. <tt><a>H</a></tt>) which can be instantiated to
--   a specific module at some later point in time are represented with
--   <a>moduleUnitId</a> set to <a>holeUnitId</a> (this allows us to avoid
--   having to make <a>moduleUnitId</a> a partial operation.)
data Module
Module :: !UnitId -> !ModuleName -> Module
[moduleUnitId] :: Module -> !UnitId
[moduleName] :: Module -> !ModuleName

-- | A ModuleName is essentially a simple string, e.g. <tt>Data.List</tt>.
data ModuleName

-- | A unit identifier identifies a (possibly partially) instantiated
--   library. It is primarily used as part of <a>Module</a>, which in turn
--   is used in <tt>Name</tt>, which is used to give names to entities when
--   typechecking.
--   
--   There are two possible forms for a <a>UnitId</a>. It can be a
--   <a>DefiniteUnitId</a>, in which case we just have a string that
--   uniquely identifies some fully compiled, installed library we have on
--   disk. However, 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
--   <a>IndefiniteUnitId</a>, which explicitly records the instantiation,
--   so that we can substitute over it.
data UnitId
IndefiniteUnitId :: {-# UNPACK #-} !IndefUnitId -> UnitId
DefiniteUnitId :: {-# UNPACK #-} !DefUnitId -> UnitId

-- | An installed unit identifier identifies a library which has been
--   installed to the package database. These strings are provided to us
--   via the <tt>-this-unit-id</tt> 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.) Put
--   another way, an installed unit id is either fully instantiated, or not
--   instantiated at all.
--   
--   Installed unit identifiers look something like
--   <tt>p+af23SAj2dZ219</tt>, or maybe just <tt>p</tt> if they don't use
--   Backpack.
newtype InstalledUnitId
InstalledUnitId :: FastString -> InstalledUnitId

-- | The full hashed unit identifier, including the component id and the
--   hash.
[installedUnitIdFS] :: InstalledUnitId -> FastString

-- | A <a>ComponentId</a> consists of the package name, package version,
--   component ID, the transitive dependencies of the component, and other
--   information to uniquely identify the source code and build
--   configuration of a component.
--   
--   This used to be known as an <tt>InstalledPackageId</tt>, but a package
--   can contain multiple components and a <a>ComponentId</a> uniquely
--   identifies a component within a package. When a package only has one
--   component, the <a>ComponentId</a> coincides with the
--   <tt>InstalledPackageId</tt>
newtype ComponentId
ComponentId :: FastString -> ComponentId
fsLit :: String -> FastString
sLit :: String -> PtrString

-- | Return the length of a <a>PtrString</a>
lengthPS :: PtrString -> Int

-- | Decode a <a>PtrString</a> back into a <a>String</a> using Latin-1
--   encoding. This does not free the memory associated with
--   <a>PtrString</a>.
unpackPtrString :: PtrString -> String

-- | Encode a <a>String</a> into a newly allocated <a>PtrString</a> using
--   Latin-1 encoding. The original string must not contain non-Latin-1
--   characters (above codepoint <tt>0xff</tt>).
mkPtrString :: String -> PtrString

-- | Wrap an unboxed address into a <a>PtrString</a>.
mkPtrString# :: Addr# -> PtrString

-- | Outputs a <a>FastString</a> with <i>no decoding at all</i>, that is,
--   you get the actual bytes in the <a>FastString</a> written to the
--   <a>Handle</a>.
hPutFS :: Handle -> FastString -> IO ()
getFastStringZEncCounter :: IO Int
getFastStringTable :: IO [[[FastString]]]
isUnderscoreFS :: FastString -> Bool
nilFS :: FastString
uniqueOfFS :: FastString -> Int
consFS :: Char -> FastString -> FastString
tailFS :: FastString -> FastString
headFS :: FastString -> Char
concatFS :: [FastString] -> FastString
appendFS :: FastString -> FastString -> FastString

-- | Returns a Z-encoded version of a <a>FastString</a>. This might be the
--   original, if it was already Z-encoded. The first time this function is
--   applied to a particular <a>FastString</a>, the results are memoized.
zEncodeFS :: FastString -> FastZString

-- | Unpacks and decodes the FastString
unpackFS :: FastString -> String

-- | Returns <tt>True</tt> if the <a>FastString</a> is empty
nullFS :: FastString -> Bool

-- | Returns the length of the <a>FastString</a> in characters
lengthFS :: FastString -> Int

-- | Creates a <a>FastString</a> from a UTF-8 encoded <tt>[Word8]</tt>
mkFastStringByteList :: [Word8] -> FastString

-- | Creates a UTF-8 encoded <a>FastString</a> from a <a>String</a>
mkFastString :: String -> FastString

-- | Create a <a>FastString</a> from an existing <a>ForeignPtr</a>; the
--   difference between this and <a>mkFastStringBytes</a> is that we don't
--   have to copy the bytes if the string is new to the table.
mkFastStringByteString :: ByteString -> FastString

-- | Create a <a>FastString</a> from an existing <a>ForeignPtr</a>; the
--   difference between this and <a>mkFastStringBytes</a> is that we don't
--   have to copy the bytes if the string is new to the table.
mkFastStringForeignPtr :: Ptr Word8 -> ForeignPtr Word8 -> Int -> IO FastString
mkFastStringBytes :: Ptr Word8 -> Int -> FastString
mkFastString# :: Addr# -> FastString
lengthFZS :: FastZString -> Int
zString :: FastZString -> String
hPutFZS :: Handle -> FastZString -> IO ()
unsafeMkByteString :: String -> ByteString
fastZStringToByteString :: FastZString -> ByteString
fastStringToByteString :: FastString -> ByteString

-- | Gives the UTF-8 encoded bytes corresponding to a <a>FastString</a>
bytesFS :: FastString -> ByteString
data FastZString

-- | A <a>FastString</a> is a UTF-8 encoded string together with a unique
--   ID. All <a>FastString</a>s 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 #-} !ByteString -> FastZString -> FastString
[uniq] :: FastString -> {-# UNPACK #-} !Int
[n_chars] :: FastString -> {-# UNPACK #-} !Int
[fs_bs] :: FastString -> {-# UNPACK #-} !ByteString

-- | Lazily computed z-encoding of this string.
--   
--   Since <a>FastString</a>s are globally memoized this is computed at
--   most once for any given string.
[fs_zenc] :: FastString -> FastZString

-- | A <a>PtrString</a> is a pointer to some array of Latin-1 encoded
--   chars.
data PtrString
PtrString :: !Ptr Word8 -> !Int -> PtrString
sGhcRtsWithLibdw :: Settings -> Bool
sGhcDebugged :: Settings -> Bool
sGhcThreaded :: Settings -> Bool
sLibFFI :: Settings -> Bool
sLeadingUnderscore :: Settings -> Bool
sTablesNextToCode :: Settings -> Bool
sGhcRTSWays :: Settings -> String
sGhcWithSMP :: Settings -> Bool
sGhcWithNativeCodeGen :: Settings -> Bool
sGhcWithInterpreter :: Settings -> Bool
sIntegerLibraryType :: Settings -> IntegerLibrary
sIntegerLibrary :: Settings -> String
sTargetPlatformString :: Settings -> String
sExtraGccViaCFlags :: Settings -> [String]
sOpt_i :: Settings -> [String]
sOpt_lcc :: Settings -> [String]
sOpt_lc :: Settings -> [String]
sOpt_lo :: Settings -> [String]
sOpt_windres :: Settings -> [String]
sOpt_lm :: Settings -> [String]
sOpt_l :: Settings -> [String]
sOpt_a :: Settings -> [String]
sOpt_cxx :: Settings -> [String]
sOpt_c :: Settings -> [String]
sOpt_F :: Settings -> [String]
sOpt_P_fingerprint :: Settings -> Fingerprint
sOpt_P :: Settings -> [String]
sOpt_L :: Settings -> [String]
sPgm_i :: Settings -> String
sPgm_lcc :: Settings -> (String, [Option])
sPgm_lc :: Settings -> (String, [Option])
sPgm_lo :: Settings -> (String, [Option])
sPgm_ranlib :: Settings -> String
sPgm_ar :: Settings -> String
sPgm_libtool :: Settings -> String
sPgm_windres :: Settings -> String
sPgm_T :: Settings -> String
sPgm_dll :: Settings -> (String, [Option])
sPgm_lm :: Settings -> (String, [Option])
sPgm_l :: Settings -> (String, [Option])
sPgm_a :: Settings -> (String, [Option])
sPgm_c :: Settings -> String
sPgm_F :: Settings -> String
sPgm_P :: Settings -> (String, [Option])
sPgm_L :: Settings -> String
sGccSupportsNoPie :: Settings -> Bool
sLdIsGnuLd :: Settings -> Bool
sLdSupportsFilelist :: Settings -> Bool
sLdSupportsBuildId :: Settings -> Bool
sLdSupportsCompactUnwind :: Settings -> Bool
sSystemPackageConfig :: Settings -> FilePath
sTmpDir :: Settings -> String
sTopDir :: Settings -> FilePath
sToolDir :: Settings -> Maybe FilePath
sGhciUsagePath :: Settings -> FilePath
sGhcUsagePath :: Settings -> FilePath
sProjectVersion :: Settings -> String
sProgramName :: Settings -> String
data Settings
Settings :: {-# UNPACK #-} !GhcNameVersion -> {-# UNPACK #-} !FileSettings -> Platform -> {-# UNPACK #-} !ToolSettings -> {-# UNPACK #-} !PlatformMisc -> PlatformConstants -> [(String, String)] -> Settings
[sGhcNameVersion] :: Settings -> {-# UNPACK #-} !GhcNameVersion
[sFileSettings] :: Settings -> {-# UNPACK #-} !FileSettings
[sTargetPlatform] :: Settings -> Platform
[sToolSettings] :: Settings -> {-# UNPACK #-} !ToolSettings
[sPlatformMisc] :: Settings -> {-# UNPACK #-} !PlatformMisc
[sPlatformConstants] :: Settings -> PlatformConstants
[sRawSettings] :: Settings -> [(String, String)]

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

-- | 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
data PlatformConstants
PlatformConstants :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Bool -> Bool -> Int -> Integer -> Integer -> Integer -> PlatformConstants
[pc_CONTROL_GROUP_CONST_291] :: PlatformConstants -> Int
[pc_STD_HDR_SIZE] :: PlatformConstants -> Int
[pc_PROF_HDR_SIZE] :: PlatformConstants -> Int
[pc_BLOCK_SIZE] :: PlatformConstants -> Int
[pc_BLOCKS_PER_MBLOCK] :: PlatformConstants -> Int
[pc_TICKY_BIN_COUNT] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR1] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR2] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR3] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR4] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR5] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR6] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR7] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR8] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR9] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rR10] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rF1] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rF2] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rF3] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rF4] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rF5] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rF6] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rD1] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rD2] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rD3] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rD4] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rD5] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rD6] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rXMM1] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rXMM2] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rXMM3] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rXMM4] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rXMM5] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rXMM6] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rYMM1] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rYMM2] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rYMM3] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rYMM4] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rYMM5] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rYMM6] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rZMM1] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rZMM2] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rZMM3] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rZMM4] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rZMM5] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rZMM6] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rL1] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rSp] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rSpLim] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rHp] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rHpLim] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rCCCS] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rCurrentTSO] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rCurrentNursery] :: PlatformConstants -> Int
[pc_OFFSET_StgRegTable_rHpAlloc] :: PlatformConstants -> Int
[pc_OFFSET_stgEagerBlackholeInfo] :: PlatformConstants -> Int
[pc_OFFSET_stgGCEnter1] :: PlatformConstants -> Int
[pc_OFFSET_stgGCFun] :: PlatformConstants -> Int
[pc_OFFSET_Capability_r] :: PlatformConstants -> Int
[pc_OFFSET_bdescr_start] :: PlatformConstants -> Int
[pc_OFFSET_bdescr_free] :: PlatformConstants -> Int
[pc_OFFSET_bdescr_blocks] :: PlatformConstants -> Int
[pc_OFFSET_bdescr_flags] :: PlatformConstants -> Int
[pc_SIZEOF_CostCentreStack] :: PlatformConstants -> Int
[pc_OFFSET_CostCentreStack_mem_alloc] :: PlatformConstants -> Int
[pc_REP_CostCentreStack_mem_alloc] :: PlatformConstants -> Int
[pc_OFFSET_CostCentreStack_scc_count] :: PlatformConstants -> Int
[pc_REP_CostCentreStack_scc_count] :: PlatformConstants -> Int
[pc_OFFSET_StgHeader_ccs] :: PlatformConstants -> Int
[pc_OFFSET_StgHeader_ldvw] :: PlatformConstants -> Int
[pc_SIZEOF_StgSMPThunkHeader] :: PlatformConstants -> Int
[pc_OFFSET_StgEntCounter_allocs] :: PlatformConstants -> Int
[pc_REP_StgEntCounter_allocs] :: PlatformConstants -> Int
[pc_OFFSET_StgEntCounter_allocd] :: PlatformConstants -> Int
[pc_REP_StgEntCounter_allocd] :: PlatformConstants -> Int
[pc_OFFSET_StgEntCounter_registeredp] :: PlatformConstants -> Int
[pc_OFFSET_StgEntCounter_link] :: PlatformConstants -> Int
[pc_OFFSET_StgEntCounter_entry_count] :: PlatformConstants -> Int
[pc_SIZEOF_StgUpdateFrame_NoHdr] :: PlatformConstants -> Int
[pc_SIZEOF_StgMutArrPtrs_NoHdr] :: PlatformConstants -> Int
[pc_OFFSET_StgMutArrPtrs_ptrs] :: PlatformConstants -> Int
[pc_OFFSET_StgMutArrPtrs_size] :: PlatformConstants -> Int
[pc_SIZEOF_StgSmallMutArrPtrs_NoHdr] :: PlatformConstants -> Int
[pc_OFFSET_StgSmallMutArrPtrs_ptrs] :: PlatformConstants -> Int
[pc_SIZEOF_StgArrBytes_NoHdr] :: PlatformConstants -> Int
[pc_OFFSET_StgArrBytes_bytes] :: PlatformConstants -> Int
[pc_OFFSET_StgTSO_alloc_limit] :: PlatformConstants -> Int
[pc_OFFSET_StgTSO_cccs] :: PlatformConstants -> Int
[pc_OFFSET_StgTSO_stackobj] :: PlatformConstants -> Int
[pc_OFFSET_StgStack_sp] :: PlatformConstants -> Int
[pc_OFFSET_StgStack_stack] :: PlatformConstants -> Int
[pc_OFFSET_StgUpdateFrame_updatee] :: PlatformConstants -> Int
[pc_OFFSET_StgFunInfoExtraFwd_arity] :: PlatformConstants -> Int
[pc_REP_StgFunInfoExtraFwd_arity] :: PlatformConstants -> Int
[pc_SIZEOF_StgFunInfoExtraRev] :: PlatformConstants -> Int
[pc_OFFSET_StgFunInfoExtraRev_arity] :: PlatformConstants -> Int
[pc_REP_StgFunInfoExtraRev_arity] :: PlatformConstants -> Int
[pc_MAX_SPEC_SELECTEE_SIZE] :: PlatformConstants -> Int
[pc_MAX_SPEC_AP_SIZE] :: PlatformConstants -> Int
[pc_MIN_PAYLOAD_SIZE] :: PlatformConstants -> Int
[pc_MIN_INTLIKE] :: PlatformConstants -> Int
[pc_MAX_INTLIKE] :: PlatformConstants -> Int
[pc_MIN_CHARLIKE] :: PlatformConstants -> Int
[pc_MAX_CHARLIKE] :: PlatformConstants -> Int
[pc_MUT_ARR_PTRS_CARD_BITS] :: PlatformConstants -> Int
[pc_MAX_Vanilla_REG] :: PlatformConstants -> Int
[pc_MAX_Float_REG] :: PlatformConstants -> Int
[pc_MAX_Double_REG] :: PlatformConstants -> Int
[pc_MAX_Long_REG] :: PlatformConstants -> Int
[pc_MAX_XMM_REG] :: PlatformConstants -> Int
[pc_MAX_Real_Vanilla_REG] :: PlatformConstants -> Int
[pc_MAX_Real_Float_REG] :: PlatformConstants -> Int
[pc_MAX_Real_Double_REG] :: PlatformConstants -> Int
[pc_MAX_Real_XMM_REG] :: PlatformConstants -> Int
[pc_MAX_Real_Long_REG] :: PlatformConstants -> Int
[pc_RESERVED_C_STACK_BYTES] :: PlatformConstants -> Int
[pc_RESERVED_STACK_WORDS] :: PlatformConstants -> Int
[pc_AP_STACK_SPLIM] :: PlatformConstants -> Int
[pc_WORD_SIZE] :: PlatformConstants -> Int
[pc_DOUBLE_SIZE] :: PlatformConstants -> Int
[pc_CINT_SIZE] :: PlatformConstants -> Int
[pc_CLONG_SIZE] :: PlatformConstants -> Int
[pc_CLONG_LONG_SIZE] :: PlatformConstants -> Int
[pc_BITMAP_BITS_SHIFT] :: PlatformConstants -> Int
[pc_TAG_BITS] :: PlatformConstants -> Int
[pc_WORDS_BIGENDIAN] :: PlatformConstants -> Bool
[pc_DYNAMIC_BY_DEFAULT] :: PlatformConstants -> Bool
[pc_LDV_SHIFT] :: PlatformConstants -> Int
[pc_ILDV_CREATE_MASK] :: PlatformConstants -> Integer
[pc_ILDV_STATE_CREATE] :: PlatformConstants -> Integer
[pc_ILDV_STATE_USE] :: PlatformConstants -> Integer

-- | Throw a failed assertion exception for a given filename and line
--   number.
assertPanic :: String -> Int -> a

-- | Panics and asserts.
pgmError :: String -> a

-- | Panics and asserts.
sorry :: String -> a

-- | Panics and asserts.
panic :: String -> a
showSDocUnsafe :: SDoc -> String

-- | Just warn about an assertion failure, recording the given file and
--   line number. Should typically be accessed with the WARN macros
warnPprTrace :: HasCallStack => Bool -> String -> Int -> SDoc -> a -> a
text :: String -> SDoc

-- | Represents a pretty-printable document.
--   
--   To display an <a>SDoc</a>, use <a>printSDoc</a>, <a>printSDocLn</a>,
--   <a>bufLeftRenderSDoc</a>, or <a>renderWithStyle</a>. Avoid calling
--   <a>runSDoc</a> directly as it breaks the abstraction layer.
data 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

-- | A unique, unambiguous name for something, containing information about
--   where that thing originated.
data Name

-- | Like <a>filterM</a>, only it reverses the sense of the test.
filterOutM :: Applicative m => (a -> m Bool) -> [a] -> m [a]

-- | Monadic version of <tt>unless</tt>, taking the condition in the monad
unlessM :: Monad m => m Bool -> m () -> m ()

-- | Monadic version of <tt>when</tt>, taking the condition in the monad
whenM :: Monad m => m Bool -> m () -> m ()

-- | Monadic version of fmap specialised for Maybe
maybeMapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)

-- | Monadic version of foldl that discards its result
foldlM_ :: (Monad m, Foldable t) => (a -> b -> m a) -> a -> t b -> m ()

-- | Monadic version of or
orM :: Monad m => m Bool -> m Bool -> m Bool

-- | Monad version of <a>all</a>, aborts the computation at the first
--   <tt>False</tt> value
allM :: Monad m => (a -> m Bool) -> [a] -> m Bool

-- | Monadic version of <a>any</a>, aborts the computation at the first
--   <tt>True</tt> value
anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool

-- | Monadic version of fmap
fmapEitherM :: Monad m => (a -> m b) -> (c -> m d) -> Either a c -> m (Either b d)

-- | Monadic version of fmap
fmapMaybeM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)

-- | Applicative version of mapMaybe
mapMaybeM :: Applicative m => (a -> m (Maybe b)) -> [a] -> m [b]

-- | Monadic version of concatMap
concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]

-- | Monadic version of mapSnd
mapSndM :: Monad m => (b -> m c) -> [(a, b)] -> m [(a, c)]

-- | Monadic version of mapAccumL
mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])
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])
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]
showOpt :: Option -> String

-- | 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
unsafeGlobalDynFlags :: DynFlags

-- | An internal helper to check whether to use unicode syntax for output.
--   
--   Note: You should very likely be using <a>unicodeSyntax</a> instead of
--   this function.
useUnicodeSyntax :: DynFlags -> Bool
useStarIsType :: DynFlags -> Bool
shouldUseColor :: DynFlags -> Bool
shouldUseHexWordLiterals :: DynFlags -> Bool
hasPprDebug :: DynFlags -> Bool
hasNoDebugOutput :: DynFlags -> Bool

-- | Contains not only a collection of <a>GeneralFlag</a>s but also a
--   plethora of information relating to the compilation of a single file
--   or GHC session
data DynFlags
DynFlags :: GhcMode -> GhcLink -> HscTarget -> {-# UNPACK #-} !GhcNameVersion -> {-# UNPACK #-} !FileSettings -> Platform -> {-# UNPACK #-} !ToolSettings -> {-# UNPACK #-} !PlatformMisc -> PlatformConstants -> [(String, String)] -> IntegerLibrary -> 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] -> Module -> Maybe String -> IntWithInf -> IntWithInf -> InstalledUnitId -> Maybe ComponentId -> Maybe [(ModuleName, Module)] -> [Way] -> String -> 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 -> DynLibLoader -> Maybe FilePath -> Maybe FilePath -> [Option] -> IncludeSpecs -> [String] -> [String] -> [String] -> Maybe String -> RtsOptsEnabled -> Bool -> String -> [ModuleName] -> [(ModuleName, String)] -> [String] -> [LoadedPlugin] -> [StaticPlugin] -> Hooks -> FilePath -> Bool -> Bool -> [ModuleName] -> [String] -> [PackageDBFlag] -> [IgnorePackageFlag] -> [PackageFlag] -> [PackageFlag] -> [TrustFlag] -> Maybe FilePath -> Maybe [(FilePath, [PackageConfig])] -> PackageState -> IORef FilesToClean -> IORef (Map FilePath FilePath) -> IORef Int -> IORef (Set FilePath) -> EnumSet DumpFlag -> EnumSet GeneralFlag -> EnumSet WarningFlag -> EnumSet WarningFlag -> Maybe Language -> SafeHaskellMode -> Bool -> Bool -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> SrcSpan -> [OnOff Extension] -> EnumSet Extension -> Int -> Int -> Int -> Int -> Float -> Int -> Bool -> Int -> Int -> LogAction -> FlushOut -> FlushErr -> Maybe FilePath -> Maybe String -> [String] -> Int -> Int -> Bool -> OverridingBool -> Bool -> Scheme -> ProfAuto -> 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 -> Int -> Int -> CfgWeights -> DynFlags
[ghcMode] :: DynFlags -> GhcMode
[ghcLink] :: DynFlags -> GhcLink
[hscTarget] :: DynFlags -> HscTarget
[ghcNameVersion] :: DynFlags -> {-# UNPACK #-} !GhcNameVersion
[fileSettings] :: DynFlags -> {-# UNPACK #-} !FileSettings
[targetPlatform] :: DynFlags -> Platform
[toolSettings] :: DynFlags -> {-# UNPACK #-} !ToolSettings
[platformMisc] :: DynFlags -> {-# UNPACK #-} !PlatformMisc
[platformConstants] :: DynFlags -> PlatformConstants
[rawSettings] :: DynFlags -> [(String, String)]

-- | IntegerGMP or IntegerSimple. Set at configure time, but may be
--   overriden by GHC-API users. See Note [The integer library] in
--   PrelNames
[integerLibrary] :: DynFlags -> IntegerLibrary

-- | N.B. It's important that this field is lazy since we load the LLVM
--   configuration lazily. See Note [LLVM Configuration] in 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 ==&gt; 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 CoreMonad.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]
[mainModIs] :: DynFlags -> Module
[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
[thisInstalledUnitId] :: DynFlags -> InstalledUnitId
[thisComponentId_] :: DynFlags -> Maybe ComponentId
[thisUnitIdInsts_] :: DynFlags -> Maybe [(ModuleName, Module)]

-- | Way flags from the command line
[ways] :: DynFlags -> [Way]

-- | The global "way" (e.g. "p" for prof)
[buildTag] :: DynFlags -> String
[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
[canGenerateDynamicToo] :: DynFlags -> IORef Bool
[dynObjectSuf] :: DynFlags -> String
[dynHiSuf] :: DynFlags -> String
[outputFile] :: DynFlags -> Maybe String
[dynOutputFile] :: DynFlags -> Maybe String
[outputHi] :: DynFlags -> Maybe String
[dynLibLoader] :: DynFlags -> DynLibLoader

-- | This is set by <a>runPipeline</a> based on where its output is going.
[dumpPrefix] :: DynFlags -> Maybe FilePath

-- | Override the <a>dumpPrefix</a> set by <a>runPipeline</a>. Set by
--   <tt>-ddump-file-prefix</tt>
[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 <tt>-ffrontend-opt</tt> flags given on the command line, in
--   *reverse* order that they're specified on the command line.
[frontendPluginOpts] :: DynFlags -> [String]

-- | plugins dynamically loaded after processing arguments. What will be
--   loaded here is directed by pluginModNames. Arguments are loaded from
--   pluginModNameOpts. The purpose of this field is to cache the plugins
--   so they don't have to be loaded each time they are needed. See
--   <a>initializePlugins</a>.
[cachedPlugins] :: DynFlags -> [LoadedPlugin]

-- | staic plugins which do not need dynamic loading. These plugins are
--   intended to be added by GHC API users directly to this list.
--   
--   To add dynamically loaded plugins through the GHC API see
--   <a>addPluginModuleName</a> instead.
[staticPlugins] :: DynFlags -> [StaticPlugin]
[hooks] :: DynFlags -> Hooks
[depMakefile] :: DynFlags -> FilePath
[depIncludePkgDeps] :: DynFlags -> Bool
[depIncludeCppDeps] :: DynFlags -> Bool
[depExcludeMods] :: DynFlags -> [ModuleName]
[depSuffixes] :: DynFlags -> [String]

-- | The <tt>-package-db</tt> 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
--   <tt>GHC_PACKAGE_PATH</tt>; see <tt>getPackageConfRefs</tt>.
[packageDBFlags] :: DynFlags -> [PackageDBFlag]

-- | The <tt>-ignore-package</tt> flags from the command line. In *reverse*
--   order that they're specified on the command line.
[ignorePackageFlags] :: DynFlags -> [IgnorePackageFlag]

-- | The <tt>-package</tt> and <tt>-hide-package</tt> flags from the
--   command-line. In *reverse* order that they're specified on the command
--   line.
[packageFlags] :: DynFlags -> [PackageFlag]

-- | The <tt>-plugin-package-id</tt> flags from command line. In *reverse*
--   order that they're specified on the command line.
[pluginPackageFlags] :: DynFlags -> [PackageFlag]

-- | The <tt>-trust</tt> and <tt>-distrust</tt> 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
[pkgDatabase] :: DynFlags -> Maybe [(FilePath, [PackageConfig])]
[pkgState] :: DynFlags -> PackageState
[filesToClean] :: DynFlags -> IORef FilesToClean
[dirsToClean] :: DynFlags -> IORef (Map FilePath FilePath)
[nextTempSuffix] :: DynFlags -> IORef Int
[generatedDumps] :: DynFlags -> IORef (Set 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
[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
[ufCreationThreshold] :: DynFlags -> Int
[ufUseThreshold] :: DynFlags -> Int
[ufFunAppDiscount] :: DynFlags -> Int
[ufDictDiscount] :: DynFlags -> Int
[ufKeenessFactor] :: DynFlags -> Float
[ufDearOp] :: DynFlags -> Int
[ufVeryAggressive] :: DynFlags -> Bool
[maxWorkerArgs] :: DynFlags -> Int
[ghciHistSize] :: DynFlags -> Int

-- | MsgDoc output action: use <a>ErrUtils</a> instead of this if you can
[log_action] :: DynFlags -> LogAction
[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
[interactivePrint] :: DynFlags -> Maybe String
[nextWrapperNum] :: DynFlags -> IORef (ModuleEnv Int)

-- | Machine dependent flags (-m<a>blah</a> 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 -> Int
[uniqueIncrement] :: DynFlags -> Int

-- | Temporary: CFG Edge weights for fast iterations
[cfgWeightInfo] :: DynFlags -> CfgWeights
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_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
Opt_D_dump_stg :: DumpFlag
Opt_D_dump_stg_unarised :: DumpFlag
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_tc :: DumpFlag
Opt_D_dump_tc_ast :: 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

-- | 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_DoStgLinting :: GeneralFlag
Opt_DoCmmLinting :: GeneralFlag
Opt_DoAsmLinting :: GeneralFlag
Opt_DoAnnotationLinting :: GeneralFlag
Opt_NoLlvmMangler :: GeneralFlag
Opt_FastLlvm :: GeneralFlag
Opt_NoTypeableBinds :: 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_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_CmmElimCommonBlocks :: GeneralFlag
Opt_AsmShortcutting :: GeneralFlag
Opt_OmitYields :: GeneralFlag
Opt_FunToThunk :: GeneralFlag
Opt_DictsStrict :: GeneralFlag
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

-- | <pre>
--   -fPIC
--   </pre>
Opt_PIC :: GeneralFlag

-- | <pre>
--   -fPIE
--   </pre>
Opt_PIE :: GeneralFlag

-- | <pre>
--   -pie
--   </pre>
Opt_PICExecutable :: GeneralFlag
Opt_ExternalDynamicRefs :: GeneralFlag
Opt_SccProfilingOn :: GeneralFlag
Opt_Ticky :: GeneralFlag
Opt_Ticky_Allocd :: GeneralFlag
Opt_Ticky_LNE :: GeneralFlag
Opt_Ticky_Dyn_Thunk :: GeneralFlag
Opt_RPath :: GeneralFlag
Opt_RelativeDynlibPaths :: GeneralFlag
Opt_Hpc :: GeneralFlag
Opt_FlatCache :: GeneralFlag
Opt_ExternalInterpreter :: GeneralFlag
Opt_OptimalApplicativeDo :: GeneralFlag
Opt_VersionMacros :: GeneralFlag
Opt_WholeArchiveHsLibs :: GeneralFlag
Opt_SingleLibFolder :: GeneralFlag
Opt_KeepCAFs :: GeneralFlag
Opt_KeepGoing :: GeneralFlag
Opt_ByteCodeIfUnboxed :: 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

-- | 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_systemPackageConfig] :: FileSettings -> FilePath

-- | Settings for what GHC this is.
data GhcNameVersion
GhcNameVersion :: String -> String -> GhcNameVersion
[ghcNameVersion_programName] :: GhcNameVersion -> String
[ghcNameVersion_projectVersion] :: GhcNameVersion -> String
data IntegerLibrary
IntegerGMP :: IntegerLibrary
IntegerSimple :: IntegerLibrary

-- | 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
--   <a>Platform</a> above).
data PlatformMisc
PlatformMisc :: String -> String -> IntegerLibrary -> Bool -> Bool -> Bool -> String -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> String -> PlatformMisc
[platformMisc_targetPlatformString] :: PlatformMisc -> String
[platformMisc_integerLibrary] :: PlatformMisc -> String
[platformMisc_integerLibraryType] :: PlatformMisc -> IntegerLibrary
[platformMisc_ghcWithInterpreter] :: PlatformMisc -> Bool
[platformMisc_ghcWithNativeCodeGen] :: PlatformMisc -> Bool
[platformMisc_ghcWithSMP] :: PlatformMisc -> Bool
[platformMisc_ghcRTSWays] :: PlatformMisc -> String

-- | Determines whether we will be compiling info tables that reside just
--   before the entry code, or with an indirection to the entry code. See
--   TABLES_NEXT_TO_CODE in includes<i>rts</i>storage/InfoTables.h.
[platformMisc_tablesNextToCode] :: PlatformMisc -> Bool
[platformMisc_leadingUnderscore] :: PlatformMisc -> Bool
[platformMisc_libFFI] :: PlatformMisc -> Bool
[platformMisc_ghcThreaded] :: PlatformMisc -> Bool
[platformMisc_ghcDebugged] :: PlatformMisc -> Bool
[platformMisc_ghcRtsWithLibdw] :: PlatformMisc -> Bool
[platformMisc_llvmTarget] :: PlatformMisc -> String

-- | 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
liftedRepName :: Name
type LexicalFastString' = FastString
mkLexicalFastString :: FastString -> LexicalFastString'
fromLexicalFastString :: LexicalFastString' -> FastString
collectHsBindBinders' :: HsBindLR GhcRn idR -> [Name]
collectPatBinders' :: LPat GhcRn -> [Name]
noLocA' :: a -> Located a
locA' :: SrcSpan -> SrcSpan
mkWildValBinder' :: Type -> Id
pprTypeForUser' :: Type -> SDoc
showSDocOneLine' :: SDoc -> String
findImportedModule' :: ModuleName -> TcPluginM FindResult
findPluginModule' :: ModuleName -> TcM FindResult
pattern HsLet' :: XLet GhcRn -> LetToken -> Located (HsLocalBinds GhcRn) -> InToken -> LHsExpr GhcRn -> HsExpr GhcRn
pattern LetStmt' :: XLetStmt GhcRn GhcRn body -> Located (HsLocalBinds GhcRn) -> StmtLR GhcRn GhcRn body
pattern ExplicitList' :: XExplicitList p -> [LHsExpr p] -> HsExpr p
pattern BindStmt' :: XBindStmt GhcRn GhcRn body -> LPat GhcRn -> body -> SyntaxExpr GhcRn -> SyntaxExpr GhcRn -> Stmt GhcRn body
pattern OverLit' :: OverLitVal -> HsOverLit GhcRn

module Debug.Breakpoint.TimerManager
suspendTimeouts :: IO a -> IO a

module Debug.Breakpoint
plugin :: Plugin

-- | Sets a breakpoint in pure code
breakpoint :: a -> a

-- | Sets a breakpoint in an arbitrary <a>Applicative</a>. Uses
--   <a>unsafePerformIO</a> which means that laziness and common
--   sub-expression elimination can result in the breakpoint not being hit
--   as expected. For this reason, you should prefer <a>breakpointIO</a> if
--   a <a>MonadIO</a> instance is available.
breakpointM :: Applicative m => m ()

-- | Sets a breakpoint in an <a>IO</a> based <a>Monad</a>. You should favor
--   this over <a>breakpointM</a> if the monad can perform IO.
breakpointIO :: MonadIO m => m ()

-- | When evaluated, displays the names of variables visible from the
--   callsite and starts a prompt where entering a variable will display
--   its value. You may want to use this instead of <a>breakpoint</a> if
--   there are value which should stay unevaluated or you are only
--   interested in certain values. Only the current thread is blocked while
--   the prompt is active. To resume execution, press enter with a blank
--   prompt.
queryVars :: a -> a

-- | Similar to <a>queryVars</a> but for use in an arbitrary
--   <a>Applicative</a> context. This uses <a>unsafePerformIO</a> which
--   means that laziness and common sub-expression elimination can result
--   in unexpected behavior. For this reason you should prefer
--   <a>queryVarsIO</a> if a <a>MonadIO</a> instance is available.
queryVarsM :: Applicative m => m ()

-- | Similar to <a>queryVars</a> but specialized to an <a>IO</a> context.
--   You should favor this over <a>queryVarsM</a> if a <a>MonadIO</a>
--   instance is available.
queryVarsIO :: MonadIO m => m ()

-- | Excludes the given variable names from appearing in the output of any
--   breakpoints occurring in the given expression.
excludeVars :: [String] -> a -> a

-- | Constructs a lazy <tt>Map</tt> from the names of all visible variables
--   at the call site to a string representation of their value. Does not
--   include any variables whose definitions contain it. Be careful not to
--   assign multiple variables to <a>captureVars</a> in the same scope as
--   this will result in an infinite recursion.
captureVars :: Map String String
showLev :: ShowLev rep a => a -> String
fromAscList :: Ord k => [(k, v)] -> Map k v
printAndWait :: String -> Map String String -> a -> a
printAndWaitM :: Applicative m => String -> Map String String -> m ()
printAndWaitIO :: MonadIO m => String -> Map String String -> m ()
runPrompt :: String -> Map String String -> a -> a
runPromptM :: Applicative m => String -> Map String String -> m ()
runPromptIO :: forall m. MonadIO m => String -> Map String String -> m ()

-- | Pretty prints the source code location of its call site
getSrcLoc :: String
instance GHC.Show.Show a => Debug.Breakpoint.Succeed a
instance Debug.Breakpoint.ShowLev 'GHC.Types.LiftedRep a => GHC.Show.Show (Debug.Breakpoint.ShowWrapper a)
instance Debug.Breakpoint.ShowLev 'GHC.Types.IntRep GHC.Prim.Int#
instance Debug.Breakpoint.ShowLev 'GHC.Types.WordRep GHC.Prim.Word#
instance Debug.Breakpoint.ShowLev 'GHC.Types.FloatRep GHC.Prim.Float#
instance Debug.Breakpoint.ShowLev 'GHC.Types.DoubleRep GHC.Prim.Double#
