ghc-tcplugin-api-0.7.1.0: An API for type-checker plugins.
Safe HaskellNone
LanguageHaskell2010

GHC.TcPlugin.API

Description

This module provides a unified interface for writing type-checking plugins for GHC.

It attempts to re-export all the functionality from GHC that is relevant to plugin authors, as well as providing utility functions to streamline certain common operations such as creating evidence (to solve constraints), rewriting type family applications, throwing custom type errors.

Consider making use of the table of contents to help navigate this documentation; don't hesitate to jump between sections to get an overview of the relevant aspects.

For an illustration of the functionality, check the examples in the associated GitHub repository.

The internal module GHC.TcPlugin.API.Internal can be used to directly lift and unlift computations in GHC's TcM monad, but it is hoped that the interface provided in this module is sufficient.

Synopsis

Basic TcPlugin functionality

The TcPlugin type

data TcPlugin Source #

A record containing all the stages necessary for the operation of a type-checking plugin, as defined in this API.

Note: this is not the same record as GHC's built-in TcPlugin record. Use mkTcPlugin for the conversion.

To create a type-checking plugin, define something of this type and then call mkTcPlugin on the result. This will return something that can be passed to Plugin:

plugin :: GHC.Plugins.Plugin
plugin =
  GHC.Plugins.defaultPlugin
    { GHC.Plugins.tcPlugin =
        \ args -> Just $
           GHC.TcPlugin.API.mkTcPlugin ( myTcPlugin args )
    }

myTcPlugin :: [String] -> GHC.TcPlugin.API.TcPlugin
myTcPlugin args = ...

Constructors

forall s. TcPlugin 

Fields

  • tcPluginInit :: TcPluginM Init s

    Initialise plugin, when entering type-checker.

  • tcPluginSolve :: s -> TcPluginSolver

    Solve some constraints.

    This function will be invoked at two points in the constraint solving process: once to manipulate given constraints, and once to solve wanted constraints. In the first case (and only in the first case), no wanted constraints will be passed to the plugin.

    The plugin can either return a contradiction, or specify that it has solved some constraints (with evidence), and possibly emit additional wanted constraints.

    Use \ _ _ _ -> pure $ TcPluginOK [] [] if your plugin does not provide this functionality.

  • tcPluginRewrite :: s -> UniqFM TcPluginRewriter

    Rewrite saturated type family applications.

    The plugin is expected to supply a mapping from type family names to rewriting functions. For each type family TyCon, the plugin should provide a function which takes in the given constraints and arguments of a saturated type family application, and return a possible rewriting. See TcPluginRewriter for the expected shape of such a function.

    Use const emptyUFM if your plugin does not provide this functionality.

  • tcPluginStop :: s -> TcPluginM Stop ()

    Clean up after the plugin, when exiting the type-checker.

mkTcPlugin Source #

Arguments

:: TcPlugin

type-checking plugin written with this library

-> TcPlugin

type-checking plugin for GHC

Use this function to create a type-checker plugin to pass to GHC.

Plugin state

A type-checker plugin can define its own state, corresponding to the existential parameter s in the definition of TcPlugin. This allows a plugin to look up information a single time on initialisation, and pass it on for access in all further invocations of the plugin.

For example:

data MyDefinitions { myTyFam :: !TyCon, myClass :: !Class }

Usually, the tcPluginInit part of the plugin looks up all this information and returns it:

myTcPluginInit :: TcPluginM Init MyDefinitions

This step should also be used to initialise any external tools, such as an external SMT solver.

This information will then be passed to other stages of the plugin:

myTcPluginSolve :: MyDefinitions -> TcPluginSolver

The type-checking plugin monads

Different stages of type-checking plugins have access to different information. For a unified interface, an MTL-style approach is used, with the MonadTcPlugin typeclass providing overloading (for operations that work in all stages).

data TcPluginStage Source #

Stage of a type-checking plugin, used as a data kind.

Constructors

Init 
Solve 
Rewrite 
Stop 

class (Monad m, forall x y. Coercible x y => Coercible (m x) (m y)) => MonadTcPlugin (m :: Type -> Type) Source #

A MonadTcPlugin is essentially a reader monad over GHC's TcM monad.

This means we have both a lift and an unlift operation, similar to MonadUnliftIO or MonadBaseControl.

See for instance unsafeLiftThroughTcM, which is an example of function that one would not be able to write using only a lift operation.

Note that you must import the internal module in order to access the methods. Please report a bug if you find yourself needing this functionality.

Minimal complete definition

liftTcPluginM, unsafeWithRunInTcM

data family TcPluginM (s :: TcPluginStage) :: Type -> Type Source #

The monad used for a type-checker plugin, parametrised by the TcPluginStage of the plugin.

Instances

Instances details
Monad (TcPluginM 'Init) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

(>>=) :: TcPluginM 'Init a -> (a -> TcPluginM 'Init b) -> TcPluginM 'Init b #

(>>) :: TcPluginM 'Init a -> TcPluginM 'Init b -> TcPluginM 'Init b #

return :: a -> TcPluginM 'Init a #

Monad (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

(>>=) :: TcPluginM 'Solve a -> (a -> TcPluginM 'Solve b) -> TcPluginM 'Solve b #

(>>) :: TcPluginM 'Solve a -> TcPluginM 'Solve b -> TcPluginM 'Solve b #

return :: a -> TcPluginM 'Solve a #

Monad (TcPluginM 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Monad (TcPluginM 'Stop) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

(>>=) :: TcPluginM 'Stop a -> (a -> TcPluginM 'Stop b) -> TcPluginM 'Stop b #

(>>) :: TcPluginM 'Stop a -> TcPluginM 'Stop b -> TcPluginM 'Stop b #

return :: a -> TcPluginM 'Stop a #

Functor (TcPluginM 'Init) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

fmap :: (a -> b) -> TcPluginM 'Init a -> TcPluginM 'Init b #

(<$) :: a -> TcPluginM 'Init b -> TcPluginM 'Init a #

Functor (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

fmap :: (a -> b) -> TcPluginM 'Solve a -> TcPluginM 'Solve b #

(<$) :: a -> TcPluginM 'Solve b -> TcPluginM 'Solve a #

Functor (TcPluginM 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

fmap :: (a -> b) -> TcPluginM 'Rewrite a -> TcPluginM 'Rewrite b #

(<$) :: a -> TcPluginM 'Rewrite b -> TcPluginM 'Rewrite a #

Functor (TcPluginM 'Stop) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

fmap :: (a -> b) -> TcPluginM 'Stop a -> TcPluginM 'Stop b #

(<$) :: a -> TcPluginM 'Stop b -> TcPluginM 'Stop a #

Applicative (TcPluginM 'Init) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

pure :: a -> TcPluginM 'Init a #

(<*>) :: TcPluginM 'Init (a -> b) -> TcPluginM 'Init a -> TcPluginM 'Init b #

liftA2 :: (a -> b -> c) -> TcPluginM 'Init a -> TcPluginM 'Init b -> TcPluginM 'Init c #

(*>) :: TcPluginM 'Init a -> TcPluginM 'Init b -> TcPluginM 'Init b #

(<*) :: TcPluginM 'Init a -> TcPluginM 'Init b -> TcPluginM 'Init a #

Applicative (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

pure :: a -> TcPluginM 'Solve a #

(<*>) :: TcPluginM 'Solve (a -> b) -> TcPluginM 'Solve a -> TcPluginM 'Solve b #

liftA2 :: (a -> b -> c) -> TcPluginM 'Solve a -> TcPluginM 'Solve b -> TcPluginM 'Solve c #

(*>) :: TcPluginM 'Solve a -> TcPluginM 'Solve b -> TcPluginM 'Solve b #

(<*) :: TcPluginM 'Solve a -> TcPluginM 'Solve b -> TcPluginM 'Solve a #

Applicative (TcPluginM 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Applicative (TcPluginM 'Stop) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

pure :: a -> TcPluginM 'Stop a #

(<*>) :: TcPluginM 'Stop (a -> b) -> TcPluginM 'Stop a -> TcPluginM 'Stop b #

liftA2 :: (a -> b -> c) -> TcPluginM 'Stop a -> TcPluginM 'Stop b -> TcPluginM 'Stop c #

(*>) :: TcPluginM 'Stop a -> TcPluginM 'Stop b -> TcPluginM 'Stop b #

(<*) :: TcPluginM 'Stop a -> TcPluginM 'Stop b -> TcPluginM 'Stop a #

(Monad (TcPluginM s), MonadTcPlugin (TcPluginM s)) => MonadThings (TcPluginM s) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

(TypeError ('Text "Cannot emit new work in 'tcPluginInit'.") :: Constraint) => MonadTcPluginWork (TcPluginM 'Init) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Init BuiltinDefs

MonadTcPluginWork (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Solve BuiltinDefs

MonadTcPluginWork (TcPluginM 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Rewrite BuiltinDefs

(TypeError ('Text "Cannot emit new work in 'tcPluginStop'.") :: Constraint) => MonadTcPluginWork (TcPluginM 'Stop) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Stop BuiltinDefs

MonadTcPlugin (TcPluginM 'Init) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

MonadTcPlugin (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

MonadTcPlugin (TcPluginM 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

MonadTcPlugin (TcPluginM 'Stop) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

newtype TcPluginM 'Init a Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

newtype TcPluginM 'Solve a Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

newtype TcPluginM 'Solve a = TcPluginSolveM {}
newtype TcPluginM 'Rewrite a Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

newtype TcPluginM 'Stop a Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

tcPluginIO :: MonadTcPlugin m => IO a -> m a Source #

Run an IO computation within the plugin.

Emitting new work, and throwing type-errors

Some operations only make sense in the two main phases, solving and rewriting. This is captured by the MonadTcPluginWork typeclass, which allows emitting new work, including throwing type errors.

class MonadTcPlugin m => MonadTcPluginWork m Source #

Monads for type-checking plugins which are able to emit new constraints and throw errors.

These operations are supported by the monads that tcPluginSolve and tcPluginRewrite use; it is not possible to emit work or throw type errors in tcPluginInit or tcPluginStop.

See mkTcPluginErrorTy and emitWork for functions which require this typeclass.

Instances

Instances details
(TypeError ('Text "Cannot emit new work in 'tcPluginInit'.") :: Constraint) => MonadTcPluginWork (TcPluginM 'Init) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Init BuiltinDefs

MonadTcPluginWork (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Solve BuiltinDefs

MonadTcPluginWork (TcPluginM 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Rewrite BuiltinDefs

(TypeError ('Text "Cannot emit new work in 'tcPluginStop'.") :: Constraint) => MonadTcPluginWork (TcPluginM 'Stop) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Stop BuiltinDefs

data TcPluginErrorMessage Source #

Use this type like ErrorMessage to write an error message. This error message can then be thrown at the type-level by the plugin, by emitting a wanted constraint whose predicate is obtained from mkTcPluginErrorTy.

A CtLoc will still need to be provided in order to inform GHC of the origin of the error (e.g.: which part of the source code should be highlighted?). See setCtLocM.

Constructors

Txt !String

Show the text as is.

PrintType !Type

Pretty print the given type.

(:|:) !TcPluginErrorMessage !TcPluginErrorMessage infixl 5

Put two messages side by side.

(:-:) !TcPluginErrorMessage !TcPluginErrorMessage infixl 6

Stack two messages vertically.

mkTcPluginErrorTy :: MonadTcPluginWork m => TcPluginErrorMessage -> m PredType Source #

Create an error type with the desired error message.

The result can be paired with a CtLoc in order to throw a type error, for instance by using newWanted.

Name resolution

Name resolution is usually the first step in writing a type-checking plugin: plugins need to look up the names of the objects they want to manipulate.

For instance, to lookup the type family MyFam in module MyModule in package my-pkg:

lookupMyModule :: MonadTcPlugin m => m Module
lookupMyModule = do
   findResult <- findImportedModule ( mkModuleName "MyModule" ) ( Just $ fsLit "my-pkg" )
   case findResult of
     Found _ myModule -> pure myModule
     _ -> error "MyPlugin couldn't find MyModule in my-pkg"

lookupMyFam :: MonadTcPlugin m => Module -> m TyCon
lookupMyFam myModule = tcLookupTyCon =<< lookupOrig myModule ( mkTcOcc "MyFam" )

Most of these operations should be performed in tcPluginInit, and passed on to the other stages: the plugin initialisation is called only once in each module that the plugin is used, whereas the solver and rewriter are usually called repeatedly.

Packages and modules

Use these functions to lookup a module, from the current package or imported packages.

findImportedModule Source #

Arguments

:: MonadTcPlugin m 
=> ModuleName

Module name, e.g. Data.List.

-> Maybe FastString

Package name, e.g. Just "base". Use Nothing for the current home package

-> m FindResult 

Lookup a Haskell module from the given package.

data Module #

A Module is a pair of a UnitId and a ModuleName.

Module variables (i.e. H) which can be instantiated to a specific module at some later point in time are represented with moduleUnitId set to holeUnitId (this allows us to avoid having to make moduleUnitId a partial operation.)

Instances

Instances details
Eq Module 
Instance details

Defined in Module

Methods

(==) :: Module -> Module -> Bool #

(/=) :: Module -> Module -> Bool #

Data Module 
Instance details

Defined in Module

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Module -> c Module #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Module #

toConstr :: Module -> Constr #

dataTypeOf :: Module -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Module) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module) #

gmapT :: (forall b. Data b => b -> b) -> Module -> Module #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r #

gmapQ :: (forall d. Data d => d -> u) -> Module -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Module -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Module -> m Module #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Module -> m Module #

Ord Module 
Instance details

Defined in Module

NFData Module 
Instance details

Defined in Module

Methods

rnf :: Module -> () #

Binary Module 
Instance details

Defined in Module

Methods

put_ :: BinHandle -> Module -> IO () #

put :: BinHandle -> Module -> IO (Bin Module) #

get :: BinHandle -> IO Module #

Uniquable Module 
Instance details

Defined in Module

Methods

getUnique :: Module -> Unique #

Outputable Module 
Instance details

Defined in Module

Methods

ppr :: Module -> SDoc #

pprPrec :: Rational -> Module -> SDoc #

DbUnitIdModuleRep InstalledUnitId ComponentId UnitId ModuleName Module 
Instance details

Defined in Module

data ModuleName #

A ModuleName is essentially a simple string, e.g. Data.List.

Instances

Instances details
Eq ModuleName 
Instance details

Defined in Module

Data ModuleName 
Instance details

Defined in Module

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ModuleName -> c ModuleName #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ModuleName #

toConstr :: ModuleName -> Constr #

dataTypeOf :: ModuleName -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ModuleName) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleName) #

gmapT :: (forall b. Data b => b -> b) -> ModuleName -> ModuleName #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ModuleName -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ModuleName -> r #

gmapQ :: (forall d. Data d => d -> u) -> ModuleName -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleName -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName #

Ord ModuleName 
Instance details

Defined in Module

NFData ModuleName 
Instance details

Defined in Module

Methods

rnf :: ModuleName -> () #

Binary ModuleName 
Instance details

Defined in Module

Uniquable ModuleName 
Instance details

Defined in Module

Outputable ModuleName 
Instance details

Defined in Module

BinaryStringRep ModuleName 
Instance details

Defined in Module

DbUnitIdModuleRep InstalledUnitId ComponentId UnitId ModuleName Module 
Instance details

Defined in Module

data FindResult #

The result of searching for an imported module.

NB: FindResult manages both user source-import lookups (which can result in Module) as well as direct imports for interfaces (which always result in InstalledModule).

Constructors

Found ModLocation Module

The module was found

NoPackage UnitId

The requested package was not found

FoundMultiple [(Module, ModuleOrigin)]

_Error_: both in multiple packages

NotFound

Not found

Names

Occurence names

The most basic type of name is the OccName, which is a simple textual name within a namespace (e.g. the class namespace), without any disambiguation (no module qualifier, etc).

Names

After having looked up the Module, we can obtain the full Name referred to by an OccName. This is fully unambiguous, as it contains a Unique identifier for the name.

lookupOrig :: MonadTcPlugin m => Module -> OccName -> m Name Source #

Obtain the full internal Name (with its unique identifier, etc) from its OccName.

Example usage:

lookupOrig preludeModule ( mkTcOcc "Bool" )

This will obtain the Name associated with the type Bool.

You can then call tcLookupTyCon to obtain the associated TyCon.

TyCon, Class, DataCon, etc

Finally, we can obtain the actual objects we're interested in handling, such as classes, type families, data constructors... by looking them up using their Name.

tcLookupTyCon :: MonadTcPlugin m => Name -> m TyCon Source #

Lookup a type constructor from its name (datatype, type synonym or type family).

tcLookupDataCon :: MonadTcPlugin m => Name -> m DataCon Source #

Lookup a data constructor (such as True, Just, ...) from its name.

tcLookupClass :: MonadTcPlugin m => Name -> m Class Source #

Lookup a typeclass from its name.

tcLookupGlobal :: MonadTcPlugin m => Name -> m TyThing Source #

Lookup a global typecheckable-thing from its name.

tcLookup :: MonadTcPlugin m => Name -> m TcTyThing Source #

Lookup a typecheckable-thing available in a local context, such as a local type variable.

tcLookupId :: MonadTcPlugin m => Name -> m Id Source #

Lookup an identifier, such as a type variable.

Constraint solving

Type-checking plugins will often want to manipulate constraints, e.g. solve constraints that GHC can't solve on its own, or emit their own constraints.

There are two different constraint flavours:

  • Given constraints, which are already known and have evidence associated to them,
  • Wanted constraints, for which evidence has not yet been found.

When GHC can't solve a Wanted constraint, it will get reported to the user as a type error.

type TcPluginSolver Source #

Arguments

 = [Ct]

Givens

-> [Ct]

Wanteds

-> TcPluginM Solve TcPluginSolveResult 

The solve function of a type-checking plugin takes in Given and Wanted constraints, and should return a TcPluginSolveResult indicating which Wanted constraints it could solve, or whether any are insoluble.

data TcPluginSolveResult Source #

Result of running a solver plugin.

pattern TcPluginContradiction :: [Ct] -> TcPluginSolveResult Source #

The plugin found a contradiction. The returned constraints are removed from the inert set, and recorded as insoluble.

The returned list of constraints should never be empty.

pattern TcPluginOk :: [(EvTerm, Ct)] -> [Ct] -> TcPluginSolveResult Source #

The plugin has not found any contradictions,

The first field is for constraints that were solved. The second field contains new work, that should be processed by the constraint solver.

The tcPluginSolve method of a typechecker plugin will be invoked in two different ways:

  1. to simplify Given constraints. In this case, the tcPluginSolve function will not be passed any Wanted constraints, and
  2. to solve Wanted constraints.

The plugin can then respond in one of two ways:

  • with TcPluginOk solved new, where solved is a list of solved constraints and new is a list of new constraints for GHC to process;
  • with TcPluginContradiction contras, where contras is a list of impossible constraints, so that they can be turned into errors.

In both cases, the plugin must respond with constraints of the same flavour, i.e. in (1) it should return only Givens, and for (2) it should return only Wanteds; all other constraints will be ignored.

Getting started with constraint solving

To get started, it can be helpful to immediately print out all the constraints that the plugin is given, using tcPluginTrace:

solver _ givens wanteds = do
  tcPluginTrace "---Plugin start---" (ppr givens $$ ppr wanteds)
  pure $ TcPluginOk [] []

This creates a plugin that prints outs the constraints it is passed, without doing anything with them.

To see this output, you will need to pass the flags -ddump-tc-trace and -ddump-to-file to GHC. This will output the trace as a log file, and you can search for "---Plugin start---" to find the plugin inputs.

Note that pretty-printing in GHC is done using the Outputable type class. We use its ppr method to turn things into pretty-printable documents, and ($$) to combine documents vertically. If you need more capabilities for pretty-printing documents, import GHC's GHC.Utils.Outputable module.

tcPluginTrace Source #

Arguments

:: MonadTcPlugin m 
=> String

Text at the top of the debug message.

-> SDoc

Formatted document to print (use the ppr pretty-printing function to obtain an SDoc from any Outputable)

-> m () 

Output some debugging information within the plugin.

Inspecting constraints & predicates

Canonical and non-canonical constraints

A constraint in GHC starts out as "non-canonical", which means that GHC doesn't know what type of constraint it is. GHC will inspect the constraint to turn it into a canonical form (class constraint, equality constraint, etc.) which satisfies certain invariants used during constraint solving.

Thus, whenever emitting new constraints, it is usually best to emit a non-canonical constraint, letting GHC canonicalise it.

Predicates

A type-checking plugin will usually need to inspect constraints, so that it can pick out the constraints it is going to interact with.

In general, type-checking plugins can encounter all sorts of constraints, whether in canonical form or not. In order to handle these constraints in a uniform manner, it is usually preferable to inspect each constraint's predicate, which can be obtained by using classifyPredType and ctPred.

This allows the plugin to determine what kind of constraints it is dealing with:

  • an equality constraint? at Nominal or Representational role?
  • a type-class constraint? for which class?
  • an irreducible constraint, e.g. something of the form c a?
  • a quantified constraint?

data Pred #

A predicate in the solver. The solver tries to prove Wanted predicates from Given ones.

pattern ClassPred :: Class -> [Type] -> Pred #

pattern EqPred :: EqRel -> Type -> Type -> Pred #

pattern IrredPred :: PredType -> Pred #

Handling type variables

type TyVar = Var #

Type or kind Variable

type CoVar = Id #

Coercion Variable

data MetaDetails #

Instances

Instances details
Outputable MetaDetails 
Instance details

Defined in TcType

data MetaInfo #

Instances

Instances details
Outputable MetaInfo 
Instance details

Defined in TcType

Some further functions for inspecting constraints

eqType :: Type -> Type -> Bool #

Type equality on source types. Does not look through newtypes or PredTypes, but it does look through type synonyms. This first checks that the kinds of the types are equal and then checks whether the types are equal, ignoring casts and coercions. (The kind check is a recursive call, but since all kinds have type Type, there is no need to check the types of kinds.) See also Note [Non-trivial definitional equality] in TyCoRep.

ctLoc :: Ct -> CtLoc #

ctFlavour :: Ct -> CtFlavour #

Get the flavour of the given Ct

ctEqRel :: Ct -> EqRel #

Get the equality relation for the given Ct

Constraint evidence

Coercions

Coercions are the evidence for type equalities. As such, when proving an equality, a type-checker plugin needs to construct the associated coercions.

mkPluginUnivCo Source #

Arguments

:: String

Name of equality (for the plugin's internal use, or for debugging)

-> Role 
-> TcType

LHS

-> TcType

RHS

-> Coercion 

Conjure up a coercion witnessing an equality between two types at the given Role (Nominal or Representational).

This amounts to telling GHC "believe me, these things are equal".

The plugin is responsible for not emitting any unsound coercions, such as a coercion between Int and Float.

newCoercionHole :: PredType -> TcPluginM Solve CoercionHole Source #

Create a fresh coercion hole.

mkReflCo :: Role -> Type -> Coercion #

Make a reflexive coercion

mkSymCo :: Coercion -> Coercion #

Create a symmetric version of the given Coercion that asserts equality between the same types but in the other "direction", so a kind of t1 ~ t2 becomes the kind t2 ~ t1.

mkTransCo :: Coercion -> Coercion -> Coercion #

Create a new Coercion by composing the two given Coercions transitively. (co1 ; co2)

mkUnivCo #

Arguments

:: UnivCoProvenance 
-> Role

role of the built coercion, "r"

-> Type

t1 :: k1

-> Type

t2 :: k2

-> Coercion

:: t1 ~r t2

Make a universal coercion between two arbitrary types.

Evidence terms

Typeclass constraints have a different notion of evidence: evidence terms.

A plugin that wants to solve a class constraint will need to provide an evidence term. Such evidence can be created from scratch, or it can be obtained by combining evidence that is already available.

mkPluginUnivEvTerm Source #

Arguments

:: String

Name of equality (for the plugin's internal use, or for debugging)

-> Role 
-> TcType

LHS

-> TcType

RHS

-> EvTerm 

Conjure up an evidence term for an equality between two types at the given Role (Nominal or Representational).

This can be used to supply a proof of a wanted equality in TcPluginOk.

The plugin is responsible for not emitting any unsound equalities, such as an equality between Int and Float.

newEvVar :: PredType -> TcPluginM Solve EvVar Source #

Create a fresh evidence variable.

setEvBind :: EvBind -> TcPluginM Solve () Source #

Bind an evidence variable.

evCast :: EvExpr -> TcCoercion -> EvTerm #

d |> co

askEvBinds :: TcPluginM Solve EvBindsVar Source #

Ask for the evidence currently gathered by the type-checker.

Only available in the solver part of the type-checking plugin.

mkLocalId :: Name -> Type -> Id #

For an explanation of global vs. local Ids, see Var

Class dictionaries

To create evidence terms for class constraints, type-checking plugins need to be able to construct the appropriate dictionaries containing the values for the class methods.

The class dictionary constructor can be obtained using classDataCon. Functions from GHC.Core.Make, which is re-exported by this library, will be useful for constructing the necessary terms

For instance, we can apply the class data constructor using mkCoreConApps. Remember that the type-level arguments (the typeclass variables) come first, before the actual evidence term (the class dictionary expression).

Class instances

In some cases, a type-checking plugin might need to access the class instances that are currently in scope, e.g. to obtain certain evidence terms.

getInstEnvs :: MonadTcPlugin m => m InstEnvs Source #

Obtain all currently-reachable typeclass instances.

Emitting new constraints

newWanted :: MonadTcPluginWork m => CtLoc -> PredType -> m CtEvidence Source #

Create a new Wanted constraint.

Requires a location (so that error messages can say where the constraint came from, what things were in scope at that point, etc), as well as the actual constraint (encoded as a type).

newGiven :: CtLoc -> PredType -> EvExpr -> TcPluginM Solve CtEvidence Source #

Create a new Given constraint.

Unlike newWanted, we need to supply evidence for this constraint.

The following functions allow plugins to create constraints for typeclasses and type equalities.

mkPrimEqPredRole :: Role -> Type -> Type -> PredType #

Makes a lifted equality predicate at the given role

Deriveds

Derived constraints are like Wanted constraints, except that they don't require evidence in order to be solved, and won't be seen in error messages if they go unsolved.

Solver plugins usually ignore this type of constraint entirely. They occur mostly when dealing with functional dependencies and type-family injectivity annotations.

GHC 9.4 removes this flavour of constraints entirely, subsuming their uses into Wanted constraints.

askDeriveds :: TcPluginM Solve [Ct] Source #

Ask for the Derived constraints that the solver was provided with.

Always returns the empty list on GHC 9.4 or above.

Location information and CtLocs

When creating new constraints, one still needs a mechanism allowing GHC to report a certain source location associated to them when throwing an error, as well as other information the type-checker was aware of at that point (e.g. available instances, given constraints, etc).

This is the purpose of CtLoc.

setCtLocM :: MonadTcPluginWork m => CtLoc -> m a -> m a Source #

Set the location information for a computation.

setCtLocRewriteM :: TcPluginM Rewrite a -> TcPluginM Rewrite a Source #

Use the RewriteEnv to set the CtLoc for a computation.

bumpCtLocDepth adds one to the "depth" of the constraint. Can help avoid loops, by triggering a "maximum depth exceeded" error.

Rewriting type-family applications

type TcPluginRewriter Source #

Arguments

 = [Ct]

Givens

-> [Type]

Type family arguments (saturated)

-> TcPluginM Rewrite TcPluginRewriteResult 

For rewriting type family applications, a type-checking plugin provides a function of this type for each type family TyCon.

The function is provided with the current set of Given constraints, together with the arguments to the type family. The type family application will always be fully saturated.

data TcPluginRewriteResult Source #

Constructors

TcPluginNoRewrite

The plugin does not rewrite the type family application.

TcPluginRewriteTo

The plugin rewrites the type family application providing a rewriting together with evidence.

The plugin can also emit additional wanted constraints.

Querying for type family reductions

matchFam :: MonadTcPlugin m => TyCon -> [TcType] -> m (Maybe Reduction) Source #

Ask GHC what a type family application reduces to.

Warning: can cause a loop when used within tcPluginRewrite.

getFamInstEnvs :: MonadTcPlugin m => m (FamInstEnv, FamInstEnv) Source #

Obtain all currently-reachable data/type family instances.

First result: external instances. Second result: instances in the current home package.

type FamInstEnv = UniqDFM FamilyInstEnv #

Specifying type family reductions

A plugin that wants to rewrite a type family application must provide two pieces of information:

  • the type that the type family application reduces to,
  • evidence for this reduction, i.e. a Coercion proving the equality.

In the rewriting stage, type-checking plugins have access to the rewriter environment RewriteEnv, which has information about the location of the type family application, the local type-checking environment, among other things.

Note that a plugin should provide a UniqFM from TyCon to rewriting functions, which specifies a rewriting function for each type family. Use emptyUFM or listToUFM to construct this map, or import the GHC module GHC.Types.Unique.FM for a more complete API.

askRewriteEnv :: TcPluginM Rewrite RewriteEnv Source #

Ask for the current rewriting environment.

Only available in the rewriter part of the type-checking plugin.

rewriteEnvCtLoc :: RewriteEnv -> CtLoc Source #

Obtain the CtLoc from a RewriteEnv.

This can be useful to obtain the location of the constraint currently being rewritten, so that newly emitted constraints can be given the same location information.

data RewriteEnv Source #

The type-family rewriting environment.

mkTyFamAppReduction Source #

Arguments

:: String

Name of reduction (for debugging)

-> Role

Role of reduction (Nominal or Representational)

-> TyCon

Type family TyCon

-> [TcType]

Type family arguments

-> TcType

The type that the type family application reduces to

-> Reduction 

Provide a rewriting of a saturated type family application at the given Role (Nominal or Representational).

The result can be passed to TcPluginRewriteTo to specify the outcome of rewriting a type family application.

data Reduction Source #

A Reduction is the result of an operation that rewrites a type ty_in. The Reduction includes the rewritten type ty_out and a Coercion co such that co :: ty_in ~ ty_out, where the role of the coercion is determined by the context. That is, the LHS type of the coercion is the original type ty_in, while its RHS type is the rewritten type ty_out.

A Reduction is always homogeneous, unless it is wrapped inside a HetReduction, which separately stores the kind coercion.

Instances

Instances details
Outputable Reduction Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal.Shim.Reduction

Handling Haskell types

Type variables

newUnique :: MonadTcPlugin m => m Unique Source #

Create a new unique. Useful for generating new variables in the plugin.

newFlexiTyVar :: MonadTcPlugin m => Kind -> m TcTyVar Source #

Create a new meta-variable (unification variable) of the given kind.

isTouchableTcPluginM :: MonadTcPlugin m => TcTyVar -> m Bool Source #

Query whether a type variable is touchable: - is it a unification variable (and not a skolem variable)? - is it actually unifiable given the current TcLevel?

getTyVar_maybe :: Type -> Maybe TyVar #

Attempts to obtain the type variable underlying a Type

type TcType = Type #

type TcTyVar = Var #

Type variable that might be a metavariable

data Unique #

Unique identifier.

The type of unique identifiers that are used in many places in GHC for fast ordering and equality tests. You should generate these with the functions from the UniqSupply module

These are sometimes also referred to as "keys" in comments in GHC.

Instances

Instances details
Eq Unique 
Instance details

Defined in Unique

Methods

(==) :: Unique -> Unique -> Bool #

(/=) :: Unique -> Unique -> Bool #

Show Unique 
Instance details

Defined in Unique

Uniquable Unique 
Instance details

Defined in Unique

Methods

getUnique :: Unique -> Unique #

Outputable Unique 
Instance details

Defined in Unique

Methods

ppr :: Unique -> SDoc #

pprPrec :: Rational -> Unique -> SDoc #

type Kind = Type #

The key type representing kinds in the compiler.

Type literals (natural numbers, type-level strings)

isNumLitTy :: Type -> Maybe Integer #

Is this a numeric literal. We also look through type synonyms.

isStrLitTy :: Type -> Maybe FastString #

Is this a symbol literal. We also look through type synonyms.

Creating and decomposing applications

mkTyConTy :: TyCon -> Type #

Create the plain type constructor type which has been applied to no type arguments at all.

mkTyConApp :: TyCon -> [Type] -> Type #

A key function: builds a TyConApp or FunTy as appropriate to its arguments. Applies its arguments to the constructor from left to right.

mkAppTy :: Type -> Type -> Type #

Applies a type to another, as in e.g. k a

mkAppTys :: Type -> [Type] -> Type #

splitTyConApp_maybe :: HasDebugCallStack => 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

tyConAppTyConPicky_maybe :: Type -> Maybe TyCon #

Retrieve the tycon heading this type, if there is one. Does not look through synonyms.

tyConAppTyCon_maybe :: Type -> Maybe TyCon #

The same as fst . splitTyConApp

splitAppTy_maybe :: 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!

Function types

mkForAllTy :: TyCoVar -> ArgFlag -> Type -> Type #

Like mkTyCoForAllTy, but does not check the occurrence of the binder See Note [Unused coercion variable in ForAllTy]

mkForAllTys :: [TyCoVarBinder] -> Type -> Type #

Wraps foralls over the type using the provided TyCoVars from left to right

Zonking

Zonking is the operation in which GHC actually switches out mutable unification variables for their actual filled in type.

See the Note [What is zonking?] in GHC's source code for more information.

zonkTcType :: MonadTcPluginWork m => TcType -> m TcType Source #

Zonk the given type, which takes the metavariables in the type and substitutes their actual value.

zonkCt :: MonadTcPluginWork m => Ct -> m Ct Source #

Zonk a given constraint.

Panicking

It is often better for type-checking plugins to panic when encountering a problem, as opposed to silently doing something wrong. Use pprPanic to throw an informative error message, so that users of your plugin can report an issue if a problem occurs.

panic :: String -> a #

Panics and asserts.

pprPanic :: HasCallStack => String -> SDoc -> a #

Throw an exception saying "bug in GHC"

Map-like data structures based on Uniques

Import GHC.Types.Unique.FM or GHC.Types.Unique.DFM for a more complete interface to maps whose keys are Uniques.

data UniqDFM ele #

Type of unique deterministic finite maps

Instances

Instances details
Functor UniqDFM 
Instance details

Defined in UniqDFM

Methods

fmap :: (a -> b) -> UniqDFM a -> UniqDFM b #

(<$) :: a -> UniqDFM b -> UniqDFM a #

Foldable UniqDFM

Deterministic, in O(n log n).

Instance details

Defined in UniqDFM

Methods

fold :: Monoid m => UniqDFM m -> m #

foldMap :: Monoid m => (a -> m) -> UniqDFM a -> m #

foldMap' :: Monoid m => (a -> m) -> UniqDFM a -> m #

foldr :: (a -> b -> b) -> b -> UniqDFM a -> b #

foldr' :: (a -> b -> b) -> b -> UniqDFM a -> b #

foldl :: (b -> a -> b) -> b -> UniqDFM a -> b #

foldl' :: (b -> a -> b) -> b -> UniqDFM a -> b #

foldr1 :: (a -> a -> a) -> UniqDFM a -> a #

foldl1 :: (a -> a -> a) -> UniqDFM a -> a #

toList :: UniqDFM a -> [a] #

null :: UniqDFM a -> Bool #

length :: UniqDFM a -> Int #

elem :: Eq a => a -> UniqDFM a -> Bool #

maximum :: Ord a => UniqDFM a -> a #

minimum :: Ord a => UniqDFM a -> a #

sum :: Num a => UniqDFM a -> a #

product :: Num a => UniqDFM a -> a #

Traversable UniqDFM

Deterministic, in O(n log n).

Instance details

Defined in UniqDFM

Methods

traverse :: Applicative f => (a -> f b) -> UniqDFM a -> f (UniqDFM b) #

sequenceA :: Applicative f => UniqDFM (f a) -> f (UniqDFM a) #

mapM :: Monad m => (a -> m b) -> UniqDFM a -> m (UniqDFM b) #

sequence :: Monad m => UniqDFM (m a) -> m (UniqDFM a) #

TrieMap UniqDFM 
Instance details

Defined in TrieMap

Associated Types

type Key UniqDFM #

Methods

emptyTM :: UniqDFM a #

lookupTM :: Key UniqDFM -> UniqDFM b -> Maybe b #

alterTM :: Key UniqDFM -> XT b -> UniqDFM b -> UniqDFM b #

mapTM :: (a -> b) -> UniqDFM a -> UniqDFM b #

foldTM :: (a -> b -> b) -> UniqDFM a -> b -> b #

Data ele => Data (UniqDFM ele) 
Instance details

Defined in UniqDFM

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniqDFM ele -> c (UniqDFM ele) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UniqDFM ele) #

toConstr :: UniqDFM ele -> Constr #

dataTypeOf :: UniqDFM ele -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UniqDFM ele)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UniqDFM ele)) #

gmapT :: (forall b. Data b => b -> b) -> UniqDFM ele -> UniqDFM ele #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM ele -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM ele -> r #

gmapQ :: (forall d. Data d => d -> u) -> UniqDFM ele -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UniqDFM ele -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) #

Semigroup (UniqDFM a) 
Instance details

Defined in UniqDFM

Methods

(<>) :: UniqDFM a -> UniqDFM a -> UniqDFM a #

sconcat :: NonEmpty (UniqDFM a) -> UniqDFM a #

stimes :: Integral b => b -> UniqDFM a -> UniqDFM a #

Monoid (UniqDFM a) 
Instance details

Defined in UniqDFM

Methods

mempty :: UniqDFM a #

mappend :: UniqDFM a -> UniqDFM a -> UniqDFM a #

mconcat :: [UniqDFM a] -> UniqDFM a #

Outputable a => Outputable (UniqDFM a) 
Instance details

Defined in UniqDFM

Methods

ppr :: UniqDFM a -> SDoc #

pprPrec :: Rational -> UniqDFM a -> SDoc #

type Key UniqDFM 
Instance details

Defined in TrieMap

lookupUDFM :: Uniquable key => UniqDFM elt -> key -> Maybe elt #

elemUDFM :: Uniquable key => key -> UniqDFM elt -> Bool #

type UniqFM ty a = UniqFM a Source #

listToUFM :: Uniquable key => [(key, elt)] -> UniqFM elt #

The type-checking environment

getEnvs :: MonadTcPlugin m => m (TcGblEnv, TcLclEnv) Source #

Obtain the current global and local type-checking environments.

Built-in types

This module also re-exports the built-in types that GHC already knows about.

This allows plugins to directly refer to e.g. the promoted data constructor True without having to look up its name.

Refer to GHC.Builtin.Names, GHC.Builtin.Types and GHC.Builtin.Types.Prim.

GHC types

These are the types that the plugin will inspect and manipulate.

END OF API DOCUMENTATION, RE-EXPORTS FOLLOW

Some basic types

type Arity = Int #

The number of value arguments that can be applied to a value before it does "real work". So: fib 100 has arity 0 x -> fib x has arity 1 See also Note [Definition of arity] in CoreArity

data PromotionFlag #

Is a TyCon a promoted data constructor or just a normal type constructor?

Constructors

NotPromoted 
IsPromoted 

Instances

Instances details
Eq PromotionFlag 
Instance details

Defined in BasicTypes

Data PromotionFlag 
Instance details

Defined in BasicTypes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PromotionFlag -> c PromotionFlag #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PromotionFlag #

toConstr :: PromotionFlag -> Constr #

dataTypeOf :: PromotionFlag -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PromotionFlag) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PromotionFlag) #

gmapT :: (forall b. Data b => b -> b) -> PromotionFlag -> PromotionFlag #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PromotionFlag -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PromotionFlag -> r #

gmapQ :: (forall d. Data d => d -> u) -> PromotionFlag -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PromotionFlag -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PromotionFlag -> m PromotionFlag #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PromotionFlag -> m PromotionFlag #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PromotionFlag -> m PromotionFlag #

data Boxity #

Constructors

Boxed 
Unboxed 

Instances

Instances details
Eq Boxity 
Instance details

Defined in BasicTypes

Methods

(==) :: Boxity -> Boxity -> Bool #

(/=) :: Boxity -> Boxity -> Bool #

Data Boxity 
Instance details

Defined in BasicTypes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Boxity -> c Boxity #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Boxity #

toConstr :: Boxity -> Constr #

dataTypeOf :: Boxity -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Boxity) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Boxity) #

gmapT :: (forall b. Data b => b -> b) -> Boxity -> Boxity #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r #

gmapQ :: (forall d. Data d => d -> u) -> Boxity -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Boxity -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity #

Outputable Boxity 
Instance details

Defined in BasicTypes

Methods

ppr :: Boxity -> SDoc #

pprPrec :: Rational -> Boxity -> SDoc #

data TupleSort #

Instances

Instances details
Eq TupleSort 
Instance details

Defined in BasicTypes

Data TupleSort 
Instance details

Defined in BasicTypes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TupleSort -> c TupleSort #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TupleSort #

toConstr :: TupleSort -> Constr #

dataTypeOf :: TupleSort -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TupleSort) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TupleSort) #

gmapT :: (forall b. Data b => b -> b) -> TupleSort -> TupleSort #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TupleSort -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TupleSort -> r #

gmapQ :: (forall d. Data d => d -> u) -> TupleSort -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TupleSort -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort #

Outputable TupleSort 
Instance details

Defined in BasicTypes

Names

data Name #

A unique, unambiguous name for something, containing information about where that thing originated.

Instances

Instances details
Eq Name

The same comments as for Name's Ord instance apply.

Instance details

Defined in Name

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Data Name 
Instance details

Defined in Name

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name #

toConstr :: Name -> Constr #

dataTypeOf :: Name -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) #

gmapT :: (forall b. Data b => b -> b) -> Name -> Name #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r #

gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name #

Ord Name

Caution: This instance is implemented via nonDetCmpUnique, which means that the ordering is not stable across deserialization or rebuilds.

See nonDetCmpUnique for further information, and trac #15240 for a bug caused by improper use of this instance.

Instance details

Defined in Name

Methods

compare :: Name -> Name -> Ordering #

(<) :: Name -> Name -> Bool #

(<=) :: Name -> Name -> Bool #

(>) :: Name -> Name -> Bool #

(>=) :: Name -> Name -> Bool #

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

NFData Name 
Instance details

Defined in Name

Methods

rnf :: Name -> () #

NamedThing Name 
Instance details

Defined in Name

HasOccName Name 
Instance details

Defined in Name

Methods

occName :: Name -> OccName #

Binary Name

Assumes that the Name is a non-binding one. See putIfaceTopBndr and getIfaceTopBndr for serializing binding Names. See UserData for the rationale for this distinction.

Instance details

Defined in Name

Methods

put_ :: BinHandle -> Name -> IO () #

put :: BinHandle -> Name -> IO (Bin Name) #

get :: BinHandle -> IO Name #

Uniquable Name 
Instance details

Defined in Name

Methods

getUnique :: Name -> Unique #

HasSrcSpan Name 
Instance details

Defined in Name

Outputable Name 
Instance details

Defined in Name

Methods

ppr :: Name -> SDoc #

pprPrec :: Rational -> Name -> SDoc #

OutputableBndr Name 
Instance details

Defined in Name

type SrcSpanLess Name 
Instance details

Defined in Name

data OccName #

Occurrence Name

In this context that means: "classified (i.e. as a type name, value name, etc) but not qualified and not yet resolved"

Instances

Instances details
Eq OccName 
Instance details

Defined in OccName

Methods

(==) :: OccName -> OccName -> Bool #

(/=) :: OccName -> OccName -> Bool #

Data OccName 
Instance details

Defined in OccName

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName #

toConstr :: OccName -> Constr #

dataTypeOf :: OccName -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) #

gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r #

gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName #

Ord OccName 
Instance details

Defined in OccName

NFData OccName 
Instance details

Defined in OccName

Methods

rnf :: OccName -> () #

HasOccName OccName 
Instance details

Defined in OccName

Methods

occName :: OccName -> OccName #

Binary OccName 
Instance details

Defined in OccName

Uniquable OccName 
Instance details

Defined in OccName

Methods

getUnique :: OccName -> Unique #

Outputable OccName 
Instance details

Defined in OccName

Methods

ppr :: OccName -> SDoc #

pprPrec :: Rational -> OccName -> SDoc #

OutputableBndr OccName 
Instance details

Defined in OccName

data TyThing #

A global typecheckable-thing, essentially anything that has a name. Not to be confused with a TcTyThing, which is also a typecheckable thing but in the *local* context. See TcEnv for how to retrieve a TyThing given a Name.

Instances

Instances details
NamedThing TyThing 
Instance details

Defined in TyCoRep

Outputable TyThing 
Instance details

Defined in TyCoRep

Methods

ppr :: TyThing -> SDoc #

pprPrec :: Rational -> TyThing -> SDoc #

data TcTyThing #

A typecheckable thing available in a local context. Could be AGlobal TyThing, but also lexically scoped variables, etc. See TcEnv for how to retrieve a TyThing given a Name.

Instances

Instances details
Outputable TcTyThing 
Instance details

Defined in TcRnTypes

class Monad m => MonadThings (m :: Type -> Type) where #

Class that abstracts out the common ability of the monads in GHC to lookup a TyThing in the monadic environment by Name. Provides a number of related convenience functions for accessing particular kinds of TyThing

Minimal complete definition

lookupThing

data Class #

Instances

Instances details
Eq Class 
Instance details

Defined in Class

Methods

(==) :: Class -> Class -> Bool #

(/=) :: Class -> Class -> Bool #

Data Class 
Instance details

Defined in Class

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Class -> c Class #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Class #

toConstr :: Class -> Constr #

dataTypeOf :: Class -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Class) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Class) #

gmapT :: (forall b. Data b => b -> b) -> Class -> Class #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Class -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Class -> r #

gmapQ :: (forall d. Data d => d -> u) -> Class -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Class -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Class -> m Class #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Class -> m Class #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Class -> m Class #

NamedThing Class 
Instance details

Defined in Class

Uniquable Class 
Instance details

Defined in Class

Methods

getUnique :: Class -> Unique #

Outputable Class 
Instance details

Defined in Class

Methods

ppr :: Class -> SDoc #

pprPrec :: Rational -> Class -> SDoc #

Lookupable Class Source # 
Instance details

Defined in GHC.TcPlugin.API.Names

data DataCon #

A data constructor

Instances

Instances details
Eq DataCon 
Instance details

Defined in DataCon

Methods

(==) :: DataCon -> DataCon -> Bool #

(/=) :: DataCon -> DataCon -> Bool #

Data DataCon 
Instance details

Defined in DataCon

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DataCon -> c DataCon #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DataCon #

toConstr :: DataCon -> Constr #

dataTypeOf :: DataCon -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DataCon) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataCon) #

gmapT :: (forall b. Data b => b -> b) -> DataCon -> DataCon #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DataCon -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DataCon -> r #

gmapQ :: (forall d. Data d => d -> u) -> DataCon -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DataCon -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DataCon -> m DataCon #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DataCon -> m DataCon #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DataCon -> m DataCon #

NamedThing DataCon 
Instance details

Defined in DataCon

Uniquable DataCon 
Instance details

Defined in DataCon

Methods

getUnique :: DataCon -> Unique #

Outputable DataCon 
Instance details

Defined in DataCon

Methods

ppr :: DataCon -> SDoc #

pprPrec :: Rational -> DataCon -> SDoc #

OutputableBndr DataCon 
Instance details

Defined in DataCon

Lookupable (Promoted DataCon) Source # 
Instance details

Defined in GHC.TcPlugin.API.Names

Lookupable DataCon Source # 
Instance details

Defined in GHC.TcPlugin.API.Names

data TyCon #

TyCons represent type constructors. Type constructors are introduced by things such as:

1) Data declarations: data Foo = ... creates the Foo type constructor of kind *

2) Type synonyms: type Foo = ... creates the Foo type constructor

3) Newtypes: newtype Foo a = MkFoo ... creates the Foo type constructor of kind * -> *

4) Class declarations: class Foo where creates the Foo type constructor of kind *

This data type also encodes a number of primitive, built in type constructors such as those for function and tuple types.

Instances

Instances details
Eq TyCon 
Instance details

Defined in TyCon

Methods

(==) :: TyCon -> TyCon -> Bool #

(/=) :: TyCon -> TyCon -> Bool #

Data TyCon 
Instance details

Defined in TyCon

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TyCon -> c TyCon #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TyCon #

toConstr :: TyCon -> Constr #

dataTypeOf :: TyCon -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TyCon) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyCon) #

gmapT :: (forall b. Data b => b -> b) -> TyCon -> TyCon #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyCon -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyCon -> r #

gmapQ :: (forall d. Data d => d -> u) -> TyCon -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TyCon -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TyCon -> m TyCon #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TyCon -> m TyCon #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TyCon -> m TyCon #

NamedThing TyCon 
Instance details

Defined in TyCon

Uniquable TyCon 
Instance details

Defined in TyCon

Methods

getUnique :: TyCon -> Unique #

Outputable TyCon 
Instance details

Defined in TyCon

Methods

ppr :: TyCon -> SDoc #

pprPrec :: Rational -> TyCon -> SDoc #

Lookupable TyCon Source # 
Instance details

Defined in GHC.TcPlugin.API.Names

type Id = Var #

Identifier

data FastString #

A FastString is a UTF-8 encoded string together with a unique ID. All FastStrings are stored in a global hashtable to support fast O(1) comparison.

It is also associated with a lazy reference to the Z-encoding of this string which is used by the compiler internally.

Instances

Instances details
Eq FastString 
Instance details

Defined in FastString

Data FastString 
Instance details

Defined in FastString

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FastString -> c FastString #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FastString #

toConstr :: FastString -> Constr #

dataTypeOf :: FastString -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FastString) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FastString) #

gmapT :: (forall b. Data b => b -> b) -> FastString -> FastString #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FastString -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FastString -> r #

gmapQ :: (forall d. Data d => d -> u) -> FastString -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FastString -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FastString -> m FastString #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FastString -> m FastString #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FastString -> m FastString #

Ord FastString 
Instance details

Defined in FastString

Show FastString 
Instance details

Defined in FastString

IsString FastString 
Instance details

Defined in FastString

Semigroup FastString 
Instance details

Defined in FastString

Monoid FastString 
Instance details

Defined in FastString

NFData FastString 
Instance details

Defined in FastString

Methods

rnf :: FastString -> () #

Uniquable FastString 
Instance details

Defined in Unique

Outputable FastString 
Instance details

Defined in Outputable

Constraints

data EqRel #

A choice of equality relation. This is separate from the type Role because Phantom does not define a (non-trivial) equality relation.

Constructors

NomEq 
ReprEq 

Instances

Instances details
Eq EqRel 
Instance details

Defined in Predicate

Methods

(==) :: EqRel -> EqRel -> Bool #

(/=) :: EqRel -> EqRel -> Bool #

Ord EqRel 
Instance details

Defined in Predicate

Methods

compare :: EqRel -> EqRel -> Ordering #

(<) :: EqRel -> EqRel -> Bool #

(<=) :: EqRel -> EqRel -> Bool #

(>) :: EqRel -> EqRel -> Bool #

(>=) :: EqRel -> EqRel -> Bool #

max :: EqRel -> EqRel -> EqRel #

min :: EqRel -> EqRel -> EqRel #

Outputable EqRel 
Instance details

Defined in Predicate

Methods

ppr :: EqRel -> SDoc #

pprPrec :: Rational -> EqRel -> SDoc #

type FunDep a = ([a], [a]) #

data CtFlavour #

Instances

Instances details
Eq CtFlavour 
Instance details

Defined in Constraint

Outputable CtFlavour 
Instance details

Defined in Constraint

data Ct #

Instances

Instances details
Outputable Ct 
Instance details

Defined in Constraint

Methods

ppr :: Ct -> SDoc #

pprPrec :: Rational -> Ct -> SDoc #

data CtLoc #

data CtEvidence #

Instances

Instances details
Outputable CtEvidence 
Instance details

Defined in Constraint

data CtOrigin #

Instances

Instances details
Outputable CtOrigin 
Instance details

Defined in TcOrigin

data QCInst #

Instances

Instances details
Outputable QCInst 
Instance details

Defined in Constraint

Methods

ppr :: QCInst -> SDoc #

pprPrec :: Rational -> QCInst -> SDoc #

data Type #

Instances

Instances details
Data Type 
Instance details

Defined in TyCoRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type #

toConstr :: Type -> Constr #

dataTypeOf :: Type -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) #

gmapT :: (forall b. Data b => b -> b) -> Type -> Type #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r #

gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type #

Outputable Type 
Instance details

Defined in TyCoRep

Methods

ppr :: Type -> SDoc #

pprPrec :: Rational -> Type -> SDoc #

Eq (DeBruijn Type) 
Instance details

Defined in CoreMap

Methods

(==) :: DeBruijn Type -> DeBruijn Type -> Bool #

(/=) :: DeBruijn Type -> DeBruijn Type -> Bool #

type PredType = Type #

A type of the form p of constraint kind represents a value whose type is the Haskell predicate p, where a predicate is what occurs before the => in a Haskell type.

We use PredType as documentation to mark those types that we guarantee to have this kind.

It can be expanded into its representation, but:

  • The type checker must treat it as opaque
  • The rest of the compiler treats it as transparent

Consider these examples:

f :: (Eq a) => a -> Int
g :: (?x :: Int -> Int) => a -> Int
h :: (r\l) => {r} => {l::Int | r}

Here the Eq a and ?x :: Int -> Int and rl are all called "predicates"

data InstEnvs #

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

Instances

Instances details
Eq TcLevel 
Instance details

Defined in TcType

Methods

(==) :: TcLevel -> TcLevel -> Bool #

(/=) :: TcLevel -> TcLevel -> Bool #

Ord TcLevel 
Instance details

Defined in TcType

Outputable TcLevel 
Instance details

Defined in TcType

Methods

ppr :: TcLevel -> SDoc #

pprPrec :: Rational -> TcLevel -> SDoc #

Coercions and evidence

data Coercion #

A Coercion is concrete evidence of the equality/convertibility of two types.

Instances

Instances details
Data Coercion 
Instance details

Defined in TyCoRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Coercion -> c Coercion #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Coercion #

toConstr :: Coercion -> Constr #

dataTypeOf :: Coercion -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Coercion) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Coercion) #

gmapT :: (forall b. Data b => b -> b) -> Coercion -> Coercion #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coercion -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coercion -> r #

gmapQ :: (forall d. Data d => d -> u) -> Coercion -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Coercion -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion #

Outputable Coercion 
Instance details

Defined in TyCoRep

Eq (DeBruijn Coercion) 
Instance details

Defined in CoreMap

Methods

(==) :: DeBruijn Coercion -> DeBruijn Coercion -> Bool #

(/=) :: DeBruijn Coercion -> DeBruijn Coercion -> Bool #

data Role #

Instances

Instances details
Eq Role 
Instance details

Defined in CoAxiom

Methods

(==) :: Role -> Role -> Bool #

(/=) :: Role -> Role -> Bool #

Data Role 
Instance details

Defined in CoAxiom

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role #

toConstr :: Role -> Constr #

dataTypeOf :: Role -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) #

gmapT :: (forall b. Data b => b -> b) -> Role -> Role #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r #

gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role #

Ord Role 
Instance details

Defined in CoAxiom

Methods

compare :: Role -> Role -> Ordering #

(<) :: Role -> Role -> Bool #

(<=) :: Role -> Role -> Bool #

(>) :: Role -> Role -> Bool #

(>=) :: Role -> Role -> Bool #

max :: Role -> Role -> Role #

min :: Role -> Role -> Role #

Binary Role 
Instance details

Defined in CoAxiom

Methods

put_ :: BinHandle -> Role -> IO () #

put :: BinHandle -> Role -> IO (Bin Role) #

get :: BinHandle -> IO Role #

Outputable Role 
Instance details

Defined in CoAxiom

Methods

ppr :: Role -> SDoc #

pprPrec :: Rational -> Role -> SDoc #

data UnivCoProvenance #

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 UnivCoProvenance 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 UnivCo constructor of Coercion.

Instances

Instances details
Data UnivCoProvenance 
Instance details

Defined in TyCoRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnivCoProvenance -> c UnivCoProvenance #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnivCoProvenance #

toConstr :: UnivCoProvenance -> Constr #

dataTypeOf :: UnivCoProvenance -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnivCoProvenance) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnivCoProvenance) #

gmapT :: (forall b. Data b => b -> b) -> UnivCoProvenance -> UnivCoProvenance #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnivCoProvenance -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnivCoProvenance -> r #

gmapQ :: (forall d. Data d => d -> u) -> UnivCoProvenance -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UnivCoProvenance -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance #

Outputable UnivCoProvenance 
Instance details

Defined in TyCoRep

data CoercionHole #

A coercion to be filled in by the type-checker. See Note [Coercion holes]

Constructors

CoercionHole 

Instances

Instances details
Data CoercionHole 
Instance details

Defined in TyCoRep

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoercionHole -> c CoercionHole #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoercionHole #

toConstr :: CoercionHole -> Constr #

dataTypeOf :: CoercionHole -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoercionHole) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoercionHole) #

gmapT :: (forall b. Data b => b -> b) -> CoercionHole -> CoercionHole #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r #

gmapQ :: (forall d. Data d => d -> u) -> CoercionHole -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CoercionHole -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole #

Outputable CoercionHole 
Instance details

Defined in TyCoRep

data EvBind #

Instances

Instances details
Outputable EvBind 
Instance details

Defined in TcEvidence

Methods

ppr :: EvBind -> SDoc #

pprPrec :: Rational -> EvBind -> SDoc #

data EvTerm #

Constructors

EvExpr EvExpr 

Instances

Instances details
Data EvTerm 
Instance details

Defined in TcEvidence

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvTerm -> c EvTerm #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvTerm #

toConstr :: EvTerm -> Constr #

dataTypeOf :: EvTerm -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvTerm) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvTerm) #

gmapT :: (forall b. Data b => b -> b) -> EvTerm -> EvTerm #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r #

gmapQ :: (forall d. Data d => d -> u) -> EvTerm -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EvTerm -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm #

Outputable EvTerm 
Instance details

Defined in TcEvidence

Methods

ppr :: EvTerm -> SDoc #

pprPrec :: Rational -> EvTerm -> SDoc #

type EvVar = EvId #

Evidence Variable

data EvBindsVar #

Instances

Instances details
Uniquable EvBindsVar 
Instance details

Defined in TcEvidence

Outputable EvBindsVar 
Instance details

Defined in TcEvidence

data Expr b #

This is the data type that represents GHCs core intermediate language. Currently GHC uses System FC https://www.microsoft.com/en-us/research/publication/system-f-with-type-equality-coercions/ for this purpose, which is closely related to the simpler and better known System F http://en.wikipedia.org/wiki/System_F.

We get from Haskell source to this Core language in a number of stages:

  1. The source code is parsed into an abstract syntax tree, which is represented by the data type HsExpr with the names being RdrNames
  2. This syntax tree is renamed, which attaches a Unique to every RdrName (yielding a Name) to disambiguate identifiers which are lexically identical. For example, this program:
     f x = let f x = x + 1
           in f (x - 2)

Would be renamed by having Uniques attached so it looked something like this:

     f_1 x_2 = let f_3 x_4 = x_4 + 1
               in f_3 (x_2 - 2)

But see Note [Shadowing] below.

  1. The resulting syntax tree undergoes type checking (which also deals with instantiating type class arguments) to yield a HsExpr type that has Id as it's names.
  2. Finally the syntax tree is desugared from the expressive HsExpr type into this Expr type, which has far fewer constructors and hence is easier to perform optimization, analysis and code generation on.

The type parameter b is for the type of binders in the expression tree.

The language consists of the following elements:

  • Variables See Note [Variable occurrences in Core]
  • Primitive literals
  • Applications: note that the argument may be a Type. See Note [CoreSyn let/app invariant] See Note [Levity polymorphism invariants]
  • Lambda abstraction See Note [Levity polymorphism invariants]
  • Recursive and non recursive lets. Operationally this corresponds to allocating a thunk for the things bound and then executing the sub-expression.

See Note [CoreSyn letrec invariant] See Note [CoreSyn let/app invariant] See Note [Levity polymorphism invariants] See Note [CoreSyn type and coercion invariant]

  • Case expression. Operationally this corresponds to evaluating the scrutinee (expression examined) to weak head normal form and then examining at most one level of resulting constructor (i.e. you cannot do nested pattern matching directly with this).

The binder gets bound to the value of the scrutinee, and the Type must be that of all the case alternatives

IMPORTANT: see Note [Case expression invariants]

  • Cast an expression to a particular type. This is used to implement newtypes (a newtype constructor or destructor just becomes a Cast in Core) and GADTs.
  • Notes. These allow general information to be added to expressions in the syntax tree
  • A type: this should only show up at the top level of an Arg
  • A coercion

Constructors

Var Id 
Type Type 
Coercion Coercion 

Instances

Instances details
Eq (DeBruijn CoreExpr) 
Instance details

Defined in CoreMap

Methods

(==) :: DeBruijn CoreExpr -> DeBruijn CoreExpr -> Bool #

(/=) :: DeBruijn CoreExpr -> DeBruijn CoreExpr -> Bool #

Eq (DeBruijn CoreAlt) 
Instance details

Defined in CoreMap

Methods

(==) :: DeBruijn CoreAlt -> DeBruijn CoreAlt -> Bool #

(/=) :: DeBruijn CoreAlt -> DeBruijn CoreAlt -> Bool #

Data b => Data (Expr b) 
Instance details

Defined in CoreSyn

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Expr b -> c (Expr b) #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Expr b) #

toConstr :: Expr b -> Constr #

dataTypeOf :: Expr b -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Expr b)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr b)) #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Expr b -> Expr b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr b -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Expr b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Expr b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Expr b -> m (Expr b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr b -> m (Expr b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Expr b -> m (Expr b) #

type CoreBndr = Var #

The common case for the type of binders and variables when we are manipulating the Core language within GHC

type CoreExpr = Expr CoreBndr #

Expressions where binders are CoreBndrs

data TcEvDest #

A place for type-checking evidence to go after it is generated. Wanted equalities are always HoleDest; other wanteds are always EvVarDest.

Constructors

EvVarDest EvVar

bind this var to the evidence EvVarDest is always used for non-type-equalities e.g. class constraints

HoleDest CoercionHole

fill in this hole with the evidence HoleDest is always used for type-equalities See Note [Coercion holes] in TyCoRep

Instances

Instances details
Outputable TcEvDest 
Instance details

Defined in Constraint

The type-checking environment

data TcGblEnv #

TcGblEnv describes the top-level of the module at the point at which the typechecker is finished work. It is this structure that is handed on to the desugarer For state that needs to be updated during the typechecking phase and returned at end, use a TcRef (= IORef).

Instances

Instances details
ContainsCostCentreState TcGblEnv 
Instance details

Defined in TcRnMonad

ContainsModule TcGblEnv 
Instance details

Defined in TcRnTypes

data TcLclEnv #

Source locations

data GenLocated l e #

We attach SrcSpans to lots of things, so let's have a datatype for it.

Constructors

L l e 

Instances

Instances details
Functor (GenLocated l) 
Instance details

Defined in SrcLoc

Methods

fmap :: (a -> b) -> GenLocated l a -> GenLocated l b #

(<$) :: a -> GenLocated l b -> GenLocated l a #

Foldable (GenLocated l) 
Instance details

Defined in SrcLoc

Methods

fold :: Monoid m => GenLocated l m -> m #

foldMap :: Monoid m => (a -> m) -> GenLocated l a -> m #

foldMap' :: Monoid m => (a -> m) -> GenLocated l a -> m #

foldr :: (a -> b -> b) -> b -> GenLocated l a -> b #

foldr' :: (a -> b -> b) -> b -> GenLocated l a -> b #

foldl :: (b -> a -> b) -> b -> GenLocated l a -> b #

foldl' :: (b -> a -> b) -> b -> GenLocated l a -> b #

foldr1 :: (a -> a -> a) -> GenLocated l a -> a #

foldl1 :: (a -> a -> a) -> GenLocated l a -> a #

toList :: GenLocated l a -> [a] #

null :: GenLocated l a -> Bool #

length :: GenLocated l a -> Int #

elem :: Eq a => a -> GenLocated l a -> Bool #

maximum :: Ord a => GenLocated l a -> a #

minimum :: Ord a => GenLocated l a -> a #

sum :: Num a => GenLocated l a -> a #

product :: Num a => GenLocated l a -> a #

Traversable (GenLocated l) 
Instance details

Defined in SrcLoc

Methods

traverse :: Applicative f => (a -> f b) -> GenLocated l a -> f (GenLocated l b) #

sequenceA :: Applicative f => GenLocated l (f a) -> f (GenLocated l a) #

mapM :: Monad m => (a -> m b) -> GenLocated l a -> m (GenLocated l b) #

sequence :: Monad m => GenLocated l (m a) -> m (GenLocated l a) #

NamedThing e => NamedThing (Located e) 
Instance details

Defined in Name

HasSrcSpan (Located a) 
Instance details

Defined in SrcLoc

(Eq l, Eq e) => Eq (GenLocated l e) 
Instance details

Defined in SrcLoc

Methods

(==) :: GenLocated l e -> GenLocated l e -> Bool #

(/=) :: GenLocated l e -> GenLocated l e -> Bool #

(Data l, Data e) => Data (GenLocated l e) 
Instance details

Defined in SrcLoc

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GenLocated l e -> c (GenLocated l e) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (GenLocated l e) #

toConstr :: GenLocated l e -> Constr #

dataTypeOf :: GenLocated l e -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (GenLocated l e)) #

dataCast2 :: Typeable t => (forall d e0. (Data d, Data e0) => c (t d e0)) -> Maybe (c (GenLocated l e)) #

gmapT :: (forall b. Data b => b -> b) -> GenLocated l e -> GenLocated l e #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GenLocated l e -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GenLocated l e -> r #

gmapQ :: (forall d. Data d => d -> u) -> GenLocated l e -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> GenLocated l e -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> GenLocated l e -> m (GenLocated l e) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GenLocated l e -> m (GenLocated l e) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GenLocated l e -> m (GenLocated l e) #

(Ord l, Ord e) => Ord (GenLocated l e) 
Instance details

Defined in SrcLoc

Methods

compare :: GenLocated l e -> GenLocated l e -> Ordering #

(<) :: GenLocated l e -> GenLocated l e -> Bool #

(<=) :: GenLocated l e -> GenLocated l e -> Bool #

(>) :: GenLocated l e -> GenLocated l e -> Bool #

(>=) :: GenLocated l e -> GenLocated l e -> Bool #

max :: GenLocated l e -> GenLocated l e -> GenLocated l e #

min :: GenLocated l e -> GenLocated l e -> GenLocated l e #

(Outputable l, Outputable e) => Outputable (GenLocated l e) 
Instance details

Defined in SrcLoc

Methods

ppr :: GenLocated l e -> SDoc #

pprPrec :: Rational -> GenLocated l e -> SDoc #

type SrcSpanLess (GenLocated l e) 
Instance details

Defined in SrcLoc

type SrcSpanLess (GenLocated l e) = e

unLoc :: HasSrcSpan a => a -> SrcSpanLess a #

getLoc :: HasSrcSpan a => a -> SrcSpan #

Pretty-printing

data SDoc #

Represents a pretty-printable document.

To display an SDoc, use printSDoc, printSDocLn, bufLeftRenderSDoc, or renderWithStyle. Avoid calling runSDoc directly as it breaks the abstraction layer.

Instances

Instances details
IsString SDoc 
Instance details

Defined in Outputable

Methods

fromString :: String -> SDoc #

Outputable SDoc 
Instance details

Defined in Outputable

Methods

ppr :: SDoc -> SDoc #

pprPrec :: Rational -> SDoc -> SDoc #

class Outputable a where #

Class designating that some type has an SDoc representation

Minimal complete definition

Nothing

Methods

ppr :: a -> SDoc #

pprPrec :: Rational -> a -> SDoc #

Instances

Instances details
Outputable Bool 
Instance details

Defined in Outputable

Methods

ppr :: Bool -> SDoc #

pprPrec :: Rational -> Bool -> SDoc #

Outputable Char 
Instance details

Defined in Outputable

Methods

ppr :: Char -> SDoc #

pprPrec :: Rational -> Char -> SDoc #

Outputable Double 
Instance details

Defined in Outputable

Methods

ppr :: Double -> SDoc #

pprPrec :: Rational -> Double -> SDoc #

Outputable Float 
Instance details

Defined in Outputable

Methods

ppr :: Float -> SDoc #

pprPrec :: Rational -> Float -> SDoc #

Outputable Int 
Instance details

Defined in Outputable

Methods

ppr :: Int -> SDoc #

pprPrec :: Rational -> Int -> SDoc #

Outputable Int32 
Instance details

Defined in Outputable

Methods

ppr :: Int32 -> SDoc #

pprPrec :: Rational -> Int32 -> SDoc #

Outputable Int64 
Instance details

Defined in Outputable

Methods

ppr :: Int64 -> SDoc #

pprPrec :: Rational -> Int64 -> SDoc #

Outputable Integer 
Instance details

Defined in Outputable

Methods

ppr :: Integer -> SDoc #

pprPrec :: Rational -> Integer -> SDoc #

Outputable Ordering 
Instance details

Defined in Outputable

Outputable Word 
Instance details

Defined in Outputable

Methods

ppr :: Word -> SDoc #

pprPrec :: Rational -> Word -> SDoc #

Outputable Word16 
Instance details

Defined in Outputable

Methods

ppr :: Word16 -> SDoc #

pprPrec :: Rational -> Word16 -> SDoc #

Outputable Word32 
Instance details

Defined in Outputable

Methods

ppr :: Word32 -> SDoc #

pprPrec :: Rational -> Word32 -> SDoc #

Outputable () 
Instance details

Defined in Outputable

Methods

ppr :: () -> SDoc #

pprPrec :: Rational -> () -> SDoc #

Outputable Fingerprint 
Instance details

Defined in Outputable

Outputable Serialized 
Instance details

Defined in Outputable

Outputable Extension 
Instance details

Defined in Outputable

Outputable CoreModule 
Instance details

Defined in GHC

Outputable WorkList 
Instance details

Defined in TcSMonad

Outputable InertSet 
Instance details

Defined in TcSMonad

Outputable InertCans 
Instance details

Defined in TcSMonad

Outputable DsMatchContext 
Instance details

Defined in DsMonad

Outputable EquationInfo 
Instance details

Defined in DsMonad

Outputable TypedHole 
Instance details

Defined in TcHoleFitTypes

Outputable HoleFitCandidate 
Instance details

Defined in TcHoleFitTypes

Outputable HoleFit 
Instance details

Defined in TcHoleFitTypes

Methods

ppr :: HoleFit -> SDoc #

pprPrec :: Rational -> HoleFit -> SDoc #

Outputable CandidatesQTvs 
Instance details

Defined in TcMType

Outputable TcBinder 
Instance details

Defined in TcRnTypes

Outputable ThStage 
Instance details

Defined in TcRnTypes

Methods

ppr :: ThStage -> SDoc #

pprPrec :: Rational -> ThStage -> SDoc #

Outputable TcTyThing 
Instance details

Defined in TcRnTypes

Outputable PromotionErr 
Instance details

Defined in TcRnTypes

Outputable IdBindingInfo 
Instance details

Defined in TcRnTypes

Outputable WhereFrom 
Instance details

Defined in TcRnTypes

Outputable TcSigInfo 
Instance details

Defined in TcRnTypes

Outputable TcIdSigInfo 
Instance details

Defined in TcRnTypes

Outputable TcIdSigInst 
Instance details

Defined in TcRnTypes

Outputable TcPatSynInfo 
Instance details

Defined in TcRnTypes

Outputable Ct 
Instance details

Defined in Constraint

Methods

ppr :: Ct -> SDoc #

pprPrec :: Rational -> Ct -> SDoc #

Outputable QCInst 
Instance details

Defined in Constraint

Methods

ppr :: QCInst -> SDoc #

pprPrec :: Rational -> QCInst -> SDoc #

Outputable Hole 
Instance details

Defined in Constraint

Methods

ppr :: Hole -> SDoc #

pprPrec :: Rational -> Hole -> SDoc #

Outputable WantedConstraints 
Instance details

Defined in Constraint

Outputable Implication 
Instance details

Defined in Constraint

Outputable ImplicStatus 
Instance details

Defined in Constraint

Outputable TcEvDest 
Instance details

Defined in Constraint

Outputable CtEvidence 
Instance details

Defined in Constraint

Outputable CtFlavour 
Instance details

Defined in Constraint

Outputable SubGoalDepth 
Instance details

Defined in Constraint

Outputable FloatBind 
Instance details

Defined in MkCore

Outputable Target 
Instance details

Defined in HscTypes

Methods

ppr :: Target -> SDoc #

pprPrec :: Rational -> Target -> SDoc #

Outputable TargetId 
Instance details

Defined in HscTypes

Outputable InteractiveImport 
Instance details

Defined in HscTypes

Outputable FixItem 
Instance details

Defined in HscTypes

Methods

ppr :: FixItem -> SDoc #

pprPrec :: Rational -> FixItem -> SDoc #

Outputable ModSummary 
Instance details

Defined in HscTypes

Outputable IfaceTrustInfo 
Instance details

Defined in HscTypes

Outputable CompleteMatch 
Instance details

Defined in HscTypes

Outputable TyEl 
Instance details

Defined in RdrHsSyn

Methods

ppr :: TyEl -> SDoc #

pprPrec :: Rational -> TyEl -> SDoc #

Outputable SkolemInfo 
Instance details

Defined in TcOrigin

Outputable CtOrigin 
Instance details

Defined in TcOrigin

Outputable UnboundVar 
Instance details

Defined in GHC.Hs.Expr

Outputable SpliceDecoration 
Instance details

Defined in GHC.Hs.Expr

Outputable PendingRnSplice 
Instance details

Defined in GHC.Hs.Expr

Outputable PendingTcSplice 
Instance details

Defined in GHC.Hs.Expr

Outputable NewOrData 
Instance details

Defined in GHC.Hs.Decls

Outputable ForeignImport 
Instance details

Defined in GHC.Hs.Decls

Outputable ForeignExport 
Instance details

Defined in GHC.Hs.Decls

Outputable DocDecl 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: DocDecl -> SDoc #

pprPrec :: Rational -> DocDecl -> SDoc #

Outputable TcSpecPrag 
Instance details

Defined in GHC.Hs.Binds

Outputable HsWrapper 
Instance details

Defined in TcEvidence

Outputable TcEvBinds 
Instance details

Defined in TcEvidence

Outputable EvBindsVar 
Instance details

Defined in TcEvidence

Outputable EvBindMap 
Instance details

Defined in TcEvidence

Outputable EvBind 
Instance details

Defined in TcEvidence

Methods

ppr :: EvBind -> SDoc #

pprPrec :: Rational -> EvBind -> SDoc #

Outputable EvTerm 
Instance details

Defined in TcEvidence

Methods

ppr :: EvTerm -> SDoc #

pprPrec :: Rational -> EvTerm -> SDoc #

Outputable EvTypeable 
Instance details

Defined in TcEvidence

Outputable EvCallStack 
Instance details

Defined in TcEvidence

Outputable Skeleton 
Instance details

Defined in StgLiftLams.Analysis

Outputable BinderInfo 
Instance details

Defined in StgLiftLams.Analysis

Outputable ClsInst 
Instance details

Defined in InstEnv

Methods

ppr :: ClsInst -> SDoc #

pprPrec :: Rational -> ClsInst -> SDoc #

Outputable ExpType 
Instance details

Defined in TcType

Methods

ppr :: ExpType -> SDoc #

pprPrec :: Rational -> ExpType -> SDoc #

Outputable InferResult 
Instance details

Defined in TcType

Outputable MetaInfo 
Instance details

Defined in TcType

Outputable TcLevel 
Instance details

Defined in TcType

Methods

ppr :: TcLevel -> SDoc #

pprPrec :: Rational -> TcLevel -> SDoc #

Outputable FamInst 
Instance details

Defined in FamInstEnv

Methods

ppr :: FamInst -> SDoc #

pprPrec :: Rational -> FamInst -> SDoc #

Outputable FamInstMatch 
Instance details

Defined in FamInstEnv

Outputable StgArg 
Instance details

Defined in StgSyn

Methods

ppr :: StgArg -> SDoc #

pprPrec :: Rational -> StgArg -> SDoc #

Outputable NoExtFieldSilent 
Instance details

Defined in StgSyn

Outputable AltType 
Instance details

Defined in StgSyn

Methods

ppr :: AltType -> SDoc #

pprPrec :: Rational -> AltType -> SDoc #

Outputable UpdateFlag 
Instance details

Defined in StgSyn

Outputable HsIPName 
Instance details

Defined in GHC.Hs.Types

Outputable NewHsTypeX 
Instance details

Defined in GHC.Hs.Types

Outputable HsTyLit 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsTyLit -> SDoc #

pprPrec :: Rational -> HsTyLit -> SDoc #

Outputable AltCon 
Instance details

Defined in CoreSyn

Methods

ppr :: AltCon -> SDoc #

pprPrec :: Rational -> AltCon -> SDoc #

Outputable HsSrcBang 
Instance details

Defined in DataCon

Outputable HsImplBang 
Instance details

Defined in DataCon

Outputable SrcStrictness 
Instance details

Defined in DataCon

Outputable SrcUnpackedness 
Instance details

Defined in DataCon

Outputable StrictnessMark 
Instance details

Defined in DataCon

Outputable EqRel 
Instance details

Defined in Predicate

Methods

ppr :: EqRel -> SDoc #

pprPrec :: Rational -> EqRel -> SDoc #

Outputable OverLitVal 
Instance details

Defined in GHC.Hs.Lit

Outputable Label 
Instance details

Defined in Hoopl.Label

Methods

ppr :: Label -> SDoc #

pprPrec :: Rational -> Label -> SDoc #

Outputable LabelSet 
Instance details

Defined in Hoopl.Label

Outputable Literal 
Instance details

Defined in Literal

Methods

ppr :: Literal -> SDoc #

pprPrec :: Rational -> Literal -> SDoc #

Outputable CoercionHole 
Instance details

Defined in TyCoRep

Outputable TyConBndrVis 
Instance details

Defined in TyCon

Outputable AlgTyConFlav 
Instance details

Defined in TyCon

Outputable FamTyConFlav 
Instance details

Defined in TyCon

Outputable PrimRep 
Instance details

Defined in TyCon

Methods

ppr :: PrimRep -> SDoc #

pprPrec :: Rational -> PrimRep -> SDoc #

Outputable PrimElemRep 
Instance details

Defined in TyCon

Outputable TyConFlavour 
Instance details

Defined in TyCon

Outputable InScopeSet 
Instance details

Defined in VarEnv

Outputable Class 
Instance details

Defined in Class

Methods

ppr :: Class -> SDoc #

pprPrec :: Rational -> Class -> SDoc #

Outputable LiftingContext 
Instance details

Defined in Coercion

Outputable CoAxBranch 
Instance details

Defined in CoAxiom

Outputable Role 
Instance details

Defined in CoAxiom

Methods

ppr :: Role -> SDoc #

pprPrec :: Rational -> Role -> SDoc #

Outputable CoAxiomRule 
Instance details

Defined in CoAxiom

Outputable DataCon 
Instance details

Defined in DataCon

Methods

ppr :: DataCon -> SDoc #

pprPrec :: Rational -> DataCon -> SDoc #

Outputable EqSpec 
Instance details

Defined in DataCon

Methods

ppr :: EqSpec -> SDoc #

pprPrec :: Rational -> EqSpec -> SDoc #

Outputable NoExtField 
Instance details

Defined in GHC.Hs.Extension

Outputable NoExtCon 
Instance details

Defined in GHC.Hs.Extension

Outputable PatSyn 
Instance details

Defined in PatSyn

Methods

ppr :: PatSyn -> SDoc #

pprPrec :: Rational -> PatSyn -> SDoc #

Outputable ForallVisFlag 
Instance details

Defined in Var

Outputable Annotation 
Instance details

Defined in Annotations

Outputable RdrName 
Instance details

Defined in RdrName

Methods

ppr :: RdrName -> SDoc #

pprPrec :: Rational -> RdrName -> SDoc #

Outputable LocalRdrEnv 
Instance details

Defined in RdrName

Outputable GlobalRdrElt 
Instance details

Defined in RdrName

Outputable Parent 
Instance details

Defined in RdrName

Methods

ppr :: Parent -> SDoc #

pprPrec :: Rational -> Parent -> SDoc #

Outputable ImportSpec 
Instance details

Defined in RdrName

Outputable AvailInfo 
Instance details

Defined in Avail

Outputable HsDocString 
Instance details

Defined in GHC.Hs.Doc

Outputable DeclDocMap 
Instance details

Defined in GHC.Hs.Doc

Outputable ArgDocMap 
Instance details

Defined in GHC.Hs.Doc

Outputable ModuleOrigin 
Instance details

Defined in Packages

Outputable UnusablePackageReason 
Instance details

Defined in Packages

Outputable Type 
Instance details

Defined in TyCoRep

Methods

ppr :: Type -> SDoc #

pprPrec :: Rational -> Type -> SDoc #

Outputable TyThing 
Instance details

Defined in TyCoRep

Methods

ppr :: TyThing -> SDoc #

pprPrec :: Rational -> TyThing -> SDoc #

Outputable Coercion 
Instance details

Defined in TyCoRep

Outputable UnivCoProvenance 
Instance details

Defined in TyCoRep

Outputable TyLit 
Instance details

Defined in TyCoRep

Methods

ppr :: TyLit -> SDoc #

pprPrec :: Rational -> TyLit -> SDoc #

Outputable TyCoBinder 
Instance details

Defined in TyCoRep

Outputable MCoercion 
Instance details

Defined in TyCoRep

Outputable ArgFlag 
Instance details

Defined in Var

Methods

ppr :: ArgFlag -> SDoc #

pprPrec :: Rational -> ArgFlag -> SDoc #

Outputable AnonArgFlag 
Instance details

Defined in Var

Outputable Var 
Instance details

Defined in Var

Methods

ppr :: Var -> SDoc #

pprPrec :: Rational -> Var -> SDoc #

Outputable WarnReason 
Instance details

Defined in DynFlags

Outputable Language 
Instance details

Defined in DynFlags

Outputable SafeHaskellMode 
Instance details

Defined in DynFlags

Outputable GhcMode 
Instance details

Defined in DynFlags

Methods

ppr :: GhcMode -> SDoc #

pprPrec :: Rational -> GhcMode -> SDoc #

Outputable PackageArg 
Instance details

Defined in DynFlags

Outputable ModRenaming 
Instance details

Defined in DynFlags

Outputable PackageFlag 
Instance details

Defined in DynFlags

Outputable Phase 
Instance details

Defined in DriverPhases

Methods

ppr :: Phase -> SDoc #

pprPrec :: Rational -> Phase -> SDoc #

Outputable ForeignCall 
Instance details

Defined in ForeignCall

Outputable Safety 
Instance details

Defined in ForeignCall

Methods

ppr :: Safety -> SDoc #

pprPrec :: Rational -> Safety -> SDoc #

Outputable CExportSpec 
Instance details

Defined in ForeignCall

Outputable CCallSpec 
Instance details

Defined in ForeignCall

Outputable CCallConv 
Instance details

Defined in ForeignCall

Outputable Header 
Instance details

Defined in ForeignCall

Methods

ppr :: Header -> SDoc #

pprPrec :: Rational -> Header -> SDoc #

Outputable CType 
Instance details

Defined in ForeignCall

Methods

ppr :: CType -> SDoc #

pprPrec :: Rational -> CType -> SDoc #

Outputable ModLocation 
Instance details

Defined in Module

Outputable IndefUnitId 
Instance details

Defined in Module

Outputable IndefModule 
Instance details

Defined in Module

Outputable InstalledModule 
Instance details

Defined in Module

Outputable DefUnitId 
Instance details

Defined in Module

Outputable Unique 
Instance details

Defined in Unique

Methods

ppr :: Unique -> SDoc #

pprPrec :: Rational -> Unique -> SDoc #

Outputable LeftOrRight 
Instance details

Defined in BasicTypes

Outputable Alignment 
Instance details

Defined in BasicTypes

Outputable OneShotInfo 
Instance details

Defined in BasicTypes

Outputable SwapFlag 
Instance details

Defined in BasicTypes

Outputable FunctionOrData 
Instance details

Defined in BasicTypes

Outputable StringLiteral 
Instance details

Defined in BasicTypes

Outputable WarningTxt 
Instance details

Defined in BasicTypes

Outputable Fixity 
Instance details

Defined in BasicTypes

Methods

ppr :: Fixity -> SDoc #

pprPrec :: Rational -> Fixity -> SDoc #

Outputable FixityDirection 
Instance details

Defined in BasicTypes

Outputable LexicalFixity 
Instance details

Defined in BasicTypes

Outputable TopLevelFlag 
Instance details

Defined in BasicTypes

Outputable Boxity 
Instance details

Defined in BasicTypes

Methods

ppr :: Boxity -> SDoc #

pprPrec :: Rational -> Boxity -> SDoc #

Outputable RecFlag 
Instance details

Defined in BasicTypes

Methods

ppr :: RecFlag -> SDoc #

pprPrec :: Rational -> RecFlag -> SDoc #

Outputable Origin 
Instance details

Defined in BasicTypes

Methods

ppr :: Origin -> SDoc #

pprPrec :: Rational -> Origin -> SDoc #

Outputable OverlapFlag 
Instance details

Defined in BasicTypes

Outputable OverlapMode 
Instance details

Defined in BasicTypes

Outputable TupleSort 
Instance details

Defined in BasicTypes

Outputable OccInfo 
Instance details

Defined in BasicTypes

Methods

ppr :: OccInfo -> SDoc #

pprPrec :: Rational -> OccInfo -> SDoc #

Outputable TailCallInfo 
Instance details

Defined in BasicTypes

Outputable SuccessFlag 
Instance details

Defined in BasicTypes

Outputable SourceText 
Instance details

Defined in BasicTypes

Outputable CompilerPhase 
Instance details

Defined in BasicTypes

Outputable Activation 
Instance details

Defined in BasicTypes

Outputable RuleMatchInfo 
Instance details

Defined in BasicTypes

Outputable InlinePragma 
Instance details

Defined in BasicTypes

Outputable InlineSpec 
Instance details

Defined in BasicTypes

Outputable IntegralLit 
Instance details

Defined in BasicTypes

Outputable FractionalLit 
Instance details

Defined in BasicTypes

Outputable IntWithInf 
Instance details

Defined in BasicTypes

Outputable TypeOrKind 
Instance details

Defined in BasicTypes

Outputable RealSrcLoc 
Instance details

Defined in SrcLoc

Outputable SrcLoc 
Instance details

Defined in SrcLoc

Methods

ppr :: SrcLoc -> SDoc #

pprPrec :: Rational -> SrcLoc -> SDoc #

Outputable RealSrcSpan 
Instance details

Defined in SrcLoc

Outputable SrcSpan 
Instance details

Defined in SrcLoc

Methods

ppr :: SrcSpan -> SDoc #

pprPrec :: Rational -> SrcSpan -> SDoc #

Outputable MetaDetails 
Instance details

Defined in TcType

Outputable TcTyVarDetails 
Instance details

Defined in TcType

Outputable PprStyle 
Instance details

Defined in Outputable

Outputable QualifyName 
Instance details

Defined in Outputable

Outputable Module 
Instance details

Defined in Module

Methods

ppr :: Module -> SDoc #

pprPrec :: Rational -> Module -> SDoc #

Outputable ModuleName 
Instance details

Defined in Module

Outputable UnitId 
Instance details

Defined in Module

Methods

ppr :: UnitId -> SDoc #

pprPrec :: Rational -> UnitId -> SDoc #

Outputable InstalledUnitId 
Instance details

Defined in Module

Outputable ComponentId 
Instance details

Defined in Module

Outputable FastString 
Instance details

Defined in Outputable

Outputable TyCon 
Instance details

Defined in TyCon

Methods

ppr :: TyCon -> SDoc #

pprPrec :: Rational -> TyCon -> SDoc #

Outputable SDoc 
Instance details

Defined in Outputable

Methods

ppr :: SDoc -> SDoc #

pprPrec :: Rational -> SDoc -> SDoc #

Outputable OccName 
Instance details

Defined in OccName

Methods

ppr :: OccName -> SDoc #

pprPrec :: Rational -> OccName -> SDoc #

Outputable Name 
Instance details

Defined in Name

Methods

ppr :: Name -> SDoc #

pprPrec :: Rational -> Name -> SDoc #

Outputable Reduction Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal.Shim.Reduction

Outputable NameSort 
Instance details

Defined in Name

Methods

ppr :: NameSort -> SDoc #

pprPrec :: Rational -> NameSort -> SDoc #

Outputable FamilyInstEnv 
Instance details

Defined in FamInstEnv

Methods

ppr :: FamilyInstEnv -> SDoc #

pprPrec :: Rational -> FamilyInstEnv -> SDoc #

Outputable ClsInstEnv 
Instance details

Defined in InstEnv

Methods

ppr :: ClsInstEnv -> SDoc #

pprPrec :: Rational -> ClsInstEnv -> SDoc #

Outputable UnitVisibility 
Instance details

Defined in Packages

Methods

ppr :: UnitVisibility -> SDoc #

pprPrec :: Rational -> UnitVisibility -> SDoc #

Outputable a => Outputable [a] 
Instance details

Defined in Outputable

Methods

ppr :: [a] -> SDoc #

pprPrec :: Rational -> [a] -> SDoc #

Outputable a => Outputable (Maybe a) 
Instance details

Defined in Outputable

Methods

ppr :: Maybe a -> SDoc #

pprPrec :: Rational -> Maybe a -> SDoc #

Outputable elt => Outputable (IntMap elt) 
Instance details

Defined in Outputable

Methods

ppr :: IntMap elt -> SDoc #

pprPrec :: Rational -> IntMap elt -> SDoc #

Outputable a => Outputable (SCC a) 
Instance details

Defined in Outputable

Methods

ppr :: SCC a -> SDoc #

pprPrec :: Rational -> SCC a -> SDoc #

Outputable a => Outputable (Set a) 
Instance details

Defined in Outputable

Methods

ppr :: Set a -> SDoc #

pprPrec :: Rational -> Set a -> SDoc #

OutputableBndrId a => Outputable (InstInfo (GhcPass a)) 
Instance details

Defined in TcEnv

Methods

ppr :: InstInfo (GhcPass a) -> SDoc #

pprPrec :: Rational -> InstInfo (GhcPass a) -> SDoc #

Outputable (PatBuilder GhcPs) 
Instance details

Defined in RdrHsSyn

OutputableBndrId p => Outputable (HsCmdTop (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: HsCmdTop (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsCmdTop (GhcPass p) -> SDoc #

OutputableBndrId idL => Outputable (ApplicativeArg (GhcPass idL)) 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsSplicedThing (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsBracket (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (ArithSeqInfo (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

OutputableBndr id => Outputable (HsMatchContext id) 
Instance details

Defined in GHC.Hs.Expr

(Outputable (GhcPass p), Outputable (NameOrRdrName (GhcPass p))) => Outputable (HsStmtContext (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: HsDecl (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsDecl (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (HsGroup (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: HsGroup (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsGroup (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (SpliceDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (TyClDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: TyClDecl (GhcPass p) -> SDoc #

pprPrec :: Rational -> TyClDecl (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (TyClGroup (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (FamilyDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Outputable (FamilyInfo pass) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: FamilyInfo pass -> SDoc #

pprPrec :: Rational -> FamilyInfo pass -> SDoc #

OutputableBndrId p => Outputable (HsDataDefn (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (HsDerivingClause (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (StandaloneKindSig (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (ConDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: ConDecl (GhcPass p) -> SDoc #

pprPrec :: Rational -> ConDecl (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (TyFamInstDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (DataFamInstDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (ClsInstDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (InstDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: InstDecl (GhcPass p) -> SDoc #

pprPrec :: Rational -> InstDecl (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (DerivDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (DerivStrategy (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (DefaultDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (ForeignDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (RuleDecls (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (RuleDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: RuleDecl (GhcPass p) -> SDoc #

pprPrec :: Rational -> RuleDecl (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (RuleBndr (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: RuleBndr (GhcPass p) -> SDoc #

pprPrec :: Rational -> RuleBndr (GhcPass p) -> SDoc #

OutputableBndr (IdP (GhcPass p)) => Outputable (WarnDecls (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndr (IdP (GhcPass p)) => Outputable (WarnDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: WarnDecl (GhcPass p) -> SDoc #

pprPrec :: Rational -> WarnDecl (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (AnnDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: AnnDecl (GhcPass p) -> SDoc #

pprPrec :: Rational -> AnnDecl (GhcPass p) -> SDoc #

OutputableBndr (IdP (GhcPass p)) => Outputable (RoleAnnotDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (ABExport (GhcPass p)) 
Instance details

Defined in GHC.Hs.Binds

Methods

ppr :: ABExport (GhcPass p) -> SDoc #

pprPrec :: Rational -> ABExport (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (HsIPBinds (GhcPass p)) 
Instance details

Defined in GHC.Hs.Binds

OutputableBndrId p => Outputable (IPBind (GhcPass p)) 
Instance details

Defined in GHC.Hs.Binds

Methods

ppr :: IPBind (GhcPass p) -> SDoc #

pprPrec :: Rational -> IPBind (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (Sig (GhcPass p)) 
Instance details

Defined in GHC.Hs.Binds

Methods

ppr :: Sig (GhcPass p) -> SDoc #

pprPrec :: Rational -> Sig (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (FixitySig (GhcPass p)) 
Instance details

Defined in GHC.Hs.Binds

Outputable a => Outputable (RecordPatSynField a) 
Instance details

Defined in GHC.Hs.Binds

Outputable a => Outputable (CoreMap a) 
Instance details

Defined in CoreMap

Methods

ppr :: CoreMap a -> SDoc #

pprPrec :: Rational -> CoreMap a -> SDoc #

OutputablePass pass => Outputable (GenStgTopBinding pass) 
Instance details

Defined in StgSyn

OutputablePass pass => Outputable (GenStgBinding pass) 
Instance details

Defined in StgSyn

Methods

ppr :: GenStgBinding pass -> SDoc #

pprPrec :: Rational -> GenStgBinding pass -> SDoc #

OutputablePass pass => Outputable (GenStgExpr pass) 
Instance details

Defined in StgSyn

Methods

ppr :: GenStgExpr pass -> SDoc #

pprPrec :: Rational -> GenStgExpr pass -> SDoc #

OutputablePass pass => Outputable (GenStgRhs pass) 
Instance details

Defined in StgSyn

Methods

ppr :: GenStgRhs pass -> SDoc #

pprPrec :: Rational -> GenStgRhs pass -> SDoc #

OutputableBndrId p => Outputable (LHsQTyVars (GhcPass p)) 
Instance details

Defined in GHC.Hs.Types

OutputableBndrId p => Outputable (HsTyVarBndr (GhcPass p)) 
Instance details

Defined in GHC.Hs.Types

OutputableBndrId p => Outputable (HsType (GhcPass p)) 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsType (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsType (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (ConDeclField (GhcPass p)) 
Instance details

Defined in GHC.Hs.Types

Outputable (FieldOcc pass) 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: FieldOcc pass -> SDoc #

pprPrec :: Rational -> FieldOcc pass -> SDoc #

Outputable (AmbiguousFieldOcc (GhcPass p)) 
Instance details

Defined in GHC.Hs.Types

Outputable b => Outputable (TaggedBndr b) 
Instance details

Defined in CoreSyn

Methods

ppr :: TaggedBndr b -> SDoc #

pprPrec :: Rational -> TaggedBndr b -> SDoc #

Outputable (HsLit (GhcPass p)) 
Instance details

Defined in GHC.Hs.Lit

Methods

ppr :: HsLit (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsLit (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (HsOverLit (GhcPass p)) 
Instance details

Defined in GHC.Hs.Lit

Outputable a => Outputable (LabelMap a) 
Instance details

Defined in Hoopl.Label

Methods

ppr :: LabelMap a -> SDoc #

pprPrec :: Rational -> LabelMap a -> SDoc #

Outputable (CoAxiom br) 
Instance details

Defined in CoAxiom

Methods

ppr :: CoAxiom br -> SDoc #

pprPrec :: Rational -> CoAxiom br -> SDoc #

OutputableBndrId p => Outputable (HsExpr (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: HsExpr (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsExpr (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (HsCmd (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: HsCmd (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsCmd (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (HsSplice (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: HsSplice (GhcPass p) -> SDoc #

pprPrec :: Rational -> HsSplice (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (SyntaxExpr (GhcPass p)) 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (ImportDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.ImpExp

OutputableBndr name => Outputable (IEWrappedName name) 
Instance details

Defined in GHC.Hs.ImpExp

Methods

ppr :: IEWrappedName name -> SDoc #

pprPrec :: Rational -> IEWrappedName name -> SDoc #

OutputableBndrId p => Outputable (IE (GhcPass p)) 
Instance details

Defined in GHC.Hs.ImpExp

Methods

ppr :: IE (GhcPass p) -> SDoc #

pprPrec :: Rational -> IE (GhcPass p) -> SDoc #

OutputableBndrId p => Outputable (Pat (GhcPass p)) 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: Pat (GhcPass p) -> SDoc #

pprPrec :: Rational -> Pat (GhcPass p) -> SDoc #

Outputable name => Outputable (AnnTarget name) 
Instance details

Defined in Annotations

Methods

ppr :: AnnTarget name -> SDoc #

pprPrec :: Rational -> AnnTarget name -> SDoc #

Outputable a => Outputable (FieldLbl a) 
Instance details

Defined in FieldLabel

Methods

ppr :: FieldLbl a -> SDoc #

pprPrec :: Rational -> FieldLbl a -> SDoc #

Outputable a => Outputable (OccEnv a) 
Instance details

Defined in OccName

Methods

ppr :: OccEnv a -> SDoc #

pprPrec :: Rational -> OccEnv a -> SDoc #

Outputable a => Outputable (Bag a) 
Instance details

Defined in Bag

Methods

ppr :: Bag a -> SDoc #

pprPrec :: Rational -> Bag a -> SDoc #

Outputable a => Outputable (UniqDFM a) 
Instance details

Defined in UniqDFM

Methods

ppr :: UniqDFM a -> SDoc #

pprPrec :: Rational -> UniqDFM a -> SDoc #

Outputable a => Outputable (UniqSet a) 
Instance details

Defined in UniqSet

Methods

ppr :: UniqSet a -> SDoc #

pprPrec :: Rational -> UniqSet a -> SDoc #

Outputable a => Outputable (UniqFM a) 
Instance details

Defined in UniqFM

Methods

ppr :: UniqFM a -> SDoc #

pprPrec :: Rational -> UniqFM a -> SDoc #

Outputable (DefMethSpec ty) 
Instance details

Defined in BasicTypes

Methods

ppr :: DefMethSpec ty -> SDoc #

pprPrec :: Rational -> DefMethSpec ty -> SDoc #

Outputable a => Outputable (Pair a) 
Instance details

Defined in Pair

Methods

ppr :: Pair a -> SDoc #

pprPrec :: Rational -> Pair a -> SDoc #

Outputable a => Outputable (TypeMapG a) 
Instance details

Defined in CoreMap

Methods

ppr :: TypeMapG a -> SDoc #

pprPrec :: Rational -> TypeMapG a -> SDoc #

Outputable a => Outputable (OnOff a) 
Instance details

Defined in DynFlags

Methods

ppr :: OnOff a -> SDoc #

pprPrec :: Rational -> OnOff a -> SDoc #

(Outputable a, Outputable b) => Outputable (Either a b) 
Instance details

Defined in Outputable

Methods

ppr :: Either a b -> SDoc #

pprPrec :: Rational -> Either a b -> SDoc #

(Outputable a, Outputable b) => Outputable (a, b) 
Instance details

Defined in Outputable

Methods

ppr :: (a, b) -> SDoc #

pprPrec :: Rational -> (a, b) -> SDoc #

(Outputable key, Outputable elt) => Outputable (Map key elt) 
Instance details

Defined in Outputable

Methods

ppr :: Map key elt -> SDoc #

pprPrec :: Rational -> Map key elt -> SDoc #

(OutputableBndrId pr, Outputable body) => Outputable (Match (GhcPass pr) body) 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: Match (GhcPass pr) body -> SDoc #

pprPrec :: Rational -> Match (GhcPass pr) body -> SDoc #

(Outputable (StmtLR idL idL (LHsExpr idL)), Outputable (XXParStmtBlock idL idR)) => Outputable (ParStmtBlock idL idR) 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: ParStmtBlock idL idR -> SDoc #

pprPrec :: Rational -> ParStmtBlock idL idR -> SDoc #

Outputable arg => Outputable (HsRecFields p arg) 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: HsRecFields p arg -> SDoc #

pprPrec :: Rational -> HsRecFields p arg -> SDoc #

(Outputable p, Outputable arg) => Outputable (HsRecField' p arg) 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: HsRecField' p arg -> SDoc #

pprPrec :: Rational -> HsRecField' p arg -> SDoc #

(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsLocalBindsLR (GhcPass pl) (GhcPass pr)) 
Instance details

Defined in GHC.Hs.Binds

(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsValBindsLR (GhcPass pl) (GhcPass pr)) 
Instance details

Defined in GHC.Hs.Binds

(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsBindLR (GhcPass pl) (GhcPass pr)) 
Instance details

Defined in GHC.Hs.Binds

Methods

ppr :: HsBindLR (GhcPass pl) (GhcPass pr) -> SDoc #

pprPrec :: Rational -> HsBindLR (GhcPass pl) (GhcPass pr) -> SDoc #

(OutputableBndrId l, OutputableBndrId r, Outputable (XXPatSynBind (GhcPass l) (GhcPass r))) => Outputable (PatSynBind (GhcPass l) (GhcPass r)) 
Instance details

Defined in GHC.Hs.Binds

Outputable thing => Outputable (HsImplicitBndrs (GhcPass p) thing) 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsImplicitBndrs (GhcPass p) thing -> SDoc #

pprPrec :: Rational -> HsImplicitBndrs (GhcPass p) thing -> SDoc #

Outputable thing => Outputable (HsWildCardBndrs (GhcPass p) thing) 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsWildCardBndrs (GhcPass p) thing -> SDoc #

pprPrec :: Rational -> HsWildCardBndrs (GhcPass p) thing -> SDoc #

(Outputable arg, Outputable rec) => Outputable (HsConDetails arg rec) 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsConDetails arg rec -> SDoc #

pprPrec :: Rational -> HsConDetails arg rec -> SDoc #

(Outputable tm, Outputable ty) => Outputable (HsArg tm ty) 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsArg tm ty -> SDoc #

pprPrec :: Rational -> HsArg tm ty -> SDoc #

(TrieMap m, Outputable a) => Outputable (ListMap m a) 
Instance details

Defined in TrieMap

Methods

ppr :: ListMap m a -> SDoc #

pprPrec :: Rational -> ListMap m a -> SDoc #

(Outputable a, Outputable (m a)) => Outputable (GenMap m a) 
Instance details

Defined in TrieMap

Methods

ppr :: GenMap m a -> SDoc #

pprPrec :: Rational -> GenMap m a -> SDoc #

Outputable tv => Outputable (VarBndr tv ArgFlag) 
Instance details

Defined in Var

OutputableBndr tv => Outputable (VarBndr tv TyConBndrVis) 
Instance details

Defined in TyCon

(Outputable l, Outputable e) => Outputable (GenLocated l e) 
Instance details

Defined in SrcLoc

Methods

ppr :: GenLocated l e -> SDoc #

pprPrec :: Rational -> GenLocated l e -> SDoc #

(Outputable a, Outputable b, Outputable c) => Outputable (a, b, c) 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c) -> SDoc #

pprPrec :: Rational -> (a, b, c) -> SDoc #

(OutputableBndrId pl, OutputableBndrId pr, Outputable body) => Outputable (StmtLR (GhcPass pl) (GhcPass pr) body) 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: StmtLR (GhcPass pl) (GhcPass pr) body -> SDoc #

pprPrec :: Rational -> StmtLR (GhcPass pl) (GhcPass pr) body -> SDoc #

(Outputable a, Outputable b, Outputable c, Outputable d) => Outputable (a, b, c, d) 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d) -> SDoc #

pprPrec :: Rational -> (a, b, c, d) -> SDoc #

(Outputable a, Outputable b, Outputable c, Outputable d, Outputable e) => Outputable (a, b, c, d, e) 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d, e) -> SDoc #

pprPrec :: Rational -> (a, b, c, d, e) -> SDoc #

(Outputable a, Outputable b, Outputable c, Outputable d, Outputable e, Outputable f) => Outputable (a, b, c, d, e, f) 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d, e, f) -> SDoc #

pprPrec :: Rational -> (a, b, c, d, e, f) -> SDoc #

(Outputable a, Outputable b, Outputable c, Outputable d, Outputable e, Outputable f, Outputable g) => Outputable (a, b, c, d, e, f, g) 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d, e, f, g) -> SDoc #

pprPrec :: Rational -> (a, b, c, d, e, f, g) -> SDoc #