ghc-tcplugin-api-0.3.1.0: An API for type-checker plugins.
Safe HaskellSafe-Inferred
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 TyCon 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 => MonadTcPlugin m 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 Source #

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

Instances

Instances details
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 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

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

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

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 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

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

MonadTcPlugin (TcPluginM 'Init) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

MonadTcPlugin (TcPluginM 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

MonadTcPlugin (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

MonadTcPlugin (TcPluginM 'Stop) 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 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Rewrite BuiltinDefs

MonadTcPluginWork (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Solve 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

newtype TcPluginM 'Init a Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

newtype TcPluginM 'Rewrite 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 '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 'Rewrite) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Rewrite BuiltinDefs

MonadTcPluginWork (TcPluginM 'Solve) Source # 
Instance details

Defined in GHC.TcPlugin.API.Internal

Methods

askBuiltins :: TcPluginM 'Solve 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.

type Module = GenModule Unit #

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

data ModuleName #

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

Instances

Instances details
Data ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

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 #

Show ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

NFData ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

Methods

rnf :: ModuleName -> () #

Uniquable ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

Binary ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

Outputable ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

Methods

ppr :: ModuleName -> SDoc #

Eq ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

Ord ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

type Anno ModuleName 
Instance details

Defined in GHC.Hs.ImpExp

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 Unit

The requested unit was not found

FoundMultiple [(Module, ModuleOrigin)]

_Error_: both in multiple packages

NotFound

Not found

Fields

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 #

Constructors

TcPluginContradiction [Ct]

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.

TcPluginOk

The first field is for constraints that were solved. These are removed from the inert set, and the evidence for them is recorded. The second field contains new work, that should be processed by the constraint solver.

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?

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 GHC.Core.TyCo.Rep.

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.

pattern Coercion :: Coercion -> Expr b #

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

pattern Type :: Type -> Expr b #

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, re-exported here, will be useful for constructing the necessary terms, e.g. mkCoreApp for an application.

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 derived 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 and newDerived, we need to supply evidence for this constraint.

Use setCtLocM to pass along the location information, as only the CtOrigin gets taken into account here.

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.

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

Create a new derived constraint. See also newWanted.

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, so that the constraint solver reports an error at the given location.

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 #

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

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 #

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.

See Note [The Reduction type].

Instances

Instances details
Outputable Reduction 
Instance details

Defined in GHC.Core.Reduction

Methods

ppr :: Reduction -> SDoc #

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
Show Unique 
Instance details

Defined in GHC.Types.Unique

Uniquable Unique 
Instance details

Defined in GHC.Types.Unique

Methods

getUnique :: Unique -> Unique #

Outputable Unique 
Instance details

Defined in GHC.Types.Unique

Methods

ppr :: Unique -> SDoc #

Eq Unique 
Instance details

Defined in GHC.Types.Unique

Methods

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

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

type Kind = Type #

The key type representing kinds in the compiler.

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.

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

mkAppTy :: Type -> Type -> Type #

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

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

Function types

data AnonArgFlag #

The non-dependent version of ArgFlag. See Note [AnonArgFlag] Appears here partly so that it's together with its friends ArgFlag and ForallVisFlag, but also because it is used in IfaceType, rather early in the compilation chain

Constructors

VisArg

Used for (->): an ordinary non-dependent arrow. The argument is visible in source code.

InvisArg

Used for (=>): a non-dependent predicate arrow. The argument is invisible in source code.

Instances

Instances details
Data AnonArgFlag 
Instance details

Defined in GHC.Types.Var

Methods

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

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

toConstr :: AnonArgFlag -> Constr #

dataTypeOf :: AnonArgFlag -> DataType #

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

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

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

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

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

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

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

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

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

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

Binary AnonArgFlag 
Instance details

Defined in GHC.Types.Var

Outputable AnonArgFlag 
Instance details

Defined in GHC.Types.Var

Methods

ppr :: AnonArgFlag -> SDoc #

Eq AnonArgFlag 
Instance details

Defined in GHC.Types.Var

Ord AnonArgFlag 
Instance details

Defined in GHC.Types.Var

type Mult = Type #

Mult is a type alias for Type.

Mult must contain Type because multiplicity variables are mere type variables (of kind Multiplicity) in Haskell. So the simplest implementation is to make Mult be Type.

Multiplicities can be formed with: - One: GHC.Types.One (= oneDataCon) - Many: GHC.Types.Many (= manyDataCon) - Multiplication: GHC.Types.MultMul (= multMulTyCon)

So that Mult feels a bit more structured, we provide pattern synonyms and smart constructors for these.

mkFunTy :: AnonArgFlag -> Mult -> Type -> Type -> Type infixr 3 #

mkVisFunTy :: Mult -> Type -> Type -> Type infixr 3 #

mkInvisFunTy :: Mult -> Type -> Type -> Type infixr 3 #

mkVisFunTys :: [Scaled Type] -> Type -> Type #

Make nested arrow 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

mkInvisForAllTys :: [InvisTVBinder] -> Type -> Type #

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

mkVisFunTyMany :: Type -> Type -> Type infixr 3 #

Special, common, case: Arrow type with mult Many

mkInvisFunTyMany :: Type -> Type -> Type infixr 3 #

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.

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 key ele #

Type of unique deterministic finite maps

The key is just here to keep us honest. It's always safe to use a single type as key. If two types don't overlap in their uniques it's also safe to index the same map at multiple key types. But this is very much discouraged.

Instances

Instances details
Foldable (UniqDFM key)

Deterministic, in O(n log n).

Instance details

Defined in GHC.Types.Unique.DFM

Methods

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

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

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

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

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

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

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

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

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

toList :: UniqDFM key a -> [a] #

null :: UniqDFM key a -> Bool #

length :: UniqDFM key a -> Int #

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

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

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

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

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

Traversable (UniqDFM key)

Deterministic, in O(n log n).

Instance details

Defined in GHC.Types.Unique.DFM

Methods

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

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

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

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

Functor (UniqDFM key) 
Instance details

Defined in GHC.Types.Unique.DFM

Methods

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

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

Uniquable key => TrieMap (UniqDFM key) 
Instance details

Defined in GHC.Data.TrieMap

Associated Types

type Key (UniqDFM key) #

Methods

emptyTM :: UniqDFM key a #

lookupTM :: Key (UniqDFM key) -> UniqDFM key b -> Maybe b #

alterTM :: Key (UniqDFM key) -> XT b -> UniqDFM key b -> UniqDFM key b #

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

filterTM :: (a -> Bool) -> UniqDFM key a -> UniqDFM key a #

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

(Data key, Data ele) => Data (UniqDFM key ele) 
Instance details

Defined in GHC.Types.Unique.DFM

Methods

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

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

toConstr :: UniqDFM key ele -> Constr #

dataTypeOf :: UniqDFM key ele -> DataType #

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

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

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

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

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

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

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

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

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

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

Outputable a => Outputable (UniqDFM key a) 
Instance details

Defined in GHC.Types.Unique.DFM

Methods

ppr :: UniqDFM key a -> SDoc #

type Key (UniqDFM key) 
Instance details

Defined in GHC.Data.TrieMap

type Key (UniqDFM key) = key

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

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

data UniqFM key ele #

A finite map from uniques of one type to elements in another type.

The key is just here to keep us honest. It's always safe to use a single type as key. If two types don't overlap in their uniques it's also safe to index the same map at multiple key types. But this is very much discouraged.

Instances

Instances details
Functor (UniqFM key) 
Instance details

Defined in GHC.Types.Unique.FM

Methods

fmap :: (a -> b) -> UniqFM key a -> UniqFM key b #

(<$) :: a -> UniqFM key b -> UniqFM key a #

(Data key, Data ele) => Data (UniqFM key ele) 
Instance details

Defined in GHC.Types.Unique.FM

Methods

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

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

toConstr :: UniqFM key ele -> Constr #

dataTypeOf :: UniqFM key ele -> DataType #

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

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

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

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

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

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

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

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

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

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

Monoid (UniqFM key a) 
Instance details

Defined in GHC.Types.Unique.FM

Methods

mempty :: UniqFM key a #

mappend :: UniqFM key a -> UniqFM key a -> UniqFM key a #

mconcat :: [UniqFM key a] -> UniqFM key a #

Semigroup (UniqFM key a) 
Instance details

Defined in GHC.Types.Unique.FM

Methods

(<>) :: UniqFM key a -> UniqFM key a -> UniqFM key a #

sconcat :: NonEmpty (UniqFM key a) -> UniqFM key a #

stimes :: Integral b => b -> UniqFM key a -> UniqFM key a #

Outputable a => Outputable (UniqFM key a) 
Instance details

Defined in GHC.Types.Unique.FM

Methods

ppr :: UniqFM key a -> SDoc #

Eq ele => Eq (UniqFM key ele) 
Instance details

Defined in GHC.Types.Unique.FM

Methods

(==) :: UniqFM key ele -> UniqFM key ele -> Bool #

(/=) :: UniqFM key ele -> UniqFM key ele -> Bool #

emptyUFM :: UniqFM key elt #

listToUFM :: Uniquable key => [(key, elt)] -> UniqFM key 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.

GHC types

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

END OF API DOCUMENTATION, RE-EXPORTS FOLLOW

Names

data Name #

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

Instances

Instances details
Data Name 
Instance details

Defined in GHC.Types.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 #

NFData Name 
Instance details

Defined in GHC.Types.Name

Methods

rnf :: Name -> () #

NamedThing Name 
Instance details

Defined in GHC.Types.Name

HasOccName Name 
Instance details

Defined in GHC.Types.Name

Methods

occName :: Name -> OccName #

Uniquable Name 
Instance details

Defined in GHC.Types.Name

Methods

getUnique :: Name -> Unique #

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 GHC.Types.Name

Methods

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

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

get :: BinHandle -> IO Name #

Outputable Name 
Instance details

Defined in GHC.Types.Name

Methods

ppr :: Name -> SDoc #

OutputableBndr Name 
Instance details

Defined in GHC.Types.Name

Eq Name

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

Instance details

Defined in GHC.Types.Name

Methods

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

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

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 GHC.Types.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 #

type Anno Name 
Instance details

Defined in GHC.Hs.Extension

type Anno (LocatedN Name) 
Instance details

Defined in GHC.Hs.Binds

type Anno [LocatedN Name] 
Instance details

Defined in GHC.Hs.Binds

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
Data OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

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 #

NFData OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Methods

rnf :: OccName -> () #

HasOccName OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Methods

occName :: OccName -> OccName #

Uniquable OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Methods

getUnique :: OccName -> Unique #

Binary OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Outputable OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Methods

ppr :: OccName -> SDoc #

OutputableBndr OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Eq OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Methods

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

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

Ord OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

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 GHC.Tc.Utils.Env for how to retrieve a TyThing given a Name.

Instances

Instances details
NamedThing TyThing 
Instance details

Defined in GHC.Types.TyThing

Outputable TyThing 
Instance details

Defined in GHC.Types.TyThing

Methods

ppr :: TyThing -> SDoc #

data TcTyThing #

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

Instances

Instances details
Outputable TcTyThing 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: TcTyThing -> SDoc #

data Class #

Instances

Instances details
Data Class 
Instance details

Defined in GHC.Core.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 GHC.Core.Class

Uniquable Class 
Instance details

Defined in GHC.Core.Class

Methods

getUnique :: Class -> Unique #

Outputable Class 
Instance details

Defined in GHC.Core.Class

Methods

ppr :: Class -> SDoc #

Eq Class 
Instance details

Defined in GHC.Core.Class

Methods

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

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

data DataCon #

A data constructor

Instances

Instances details
Data DataCon 
Instance details

Defined in GHC.Core.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 GHC.Core.DataCon

Uniquable DataCon 
Instance details

Defined in GHC.Core.DataCon

Methods

getUnique :: DataCon -> Unique #

Outputable DataCon 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: DataCon -> SDoc #

OutputableBndr DataCon 
Instance details

Defined in GHC.Core.DataCon

Eq DataCon 
Instance details

Defined in GHC.Core.DataCon

Methods

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

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

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
Data TyCon 
Instance details

Defined in GHC.Core.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 GHC.Core.TyCon

Uniquable TyCon 
Instance details

Defined in GHC.Core.TyCon

Methods

getUnique :: TyCon -> Unique #

Outputable TyCon 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: TyCon -> SDoc #

Eq TyCon 
Instance details

Defined in GHC.Core.TyCon

Methods

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

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

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
Data FastString 
Instance details

Defined in GHC.Data.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 #

IsString FastString 
Instance details

Defined in GHC.Data.FastString

Monoid FastString 
Instance details

Defined in GHC.Data.FastString

Semigroup FastString 
Instance details

Defined in GHC.Data.FastString

Show FastString 
Instance details

Defined in GHC.Data.FastString

NFData FastString 
Instance details

Defined in GHC.Data.FastString

Methods

rnf :: FastString -> () #

Uniquable FastString 
Instance details

Defined in GHC.Types.Unique

Outputable FastString 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: FastString -> SDoc #

Eq FastString 
Instance details

Defined in GHC.Data.FastString

type Anno FieldLabelString 
Instance details

Defined in GHC.Hs.Expr

type Anno (SourceText, RuleName) 
Instance details

Defined in GHC.Hs.Decls

type Anno (SourceText, RuleName) 
Instance details

Defined in GHC.Hs.Decls

Constraints

data Pred #

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

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
Outputable EqRel 
Instance details

Defined in GHC.Core.Predicate

Methods

ppr :: EqRel -> SDoc #

Eq EqRel 
Instance details

Defined in GHC.Core.Predicate

Methods

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

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

Ord EqRel 
Instance details

Defined in GHC.Core.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 #

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

data CtFlavour #

Instances

Instances details
Outputable CtFlavour 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CtFlavour -> SDoc #

Eq CtFlavour 
Instance details

Defined in GHC.Tc.Types.Constraint

data Ct #

Instances

Instances details
Outputable Ct 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: Ct -> SDoc #

data CtLoc #

data CtEvidence #

Instances

Instances details
Outputable CtEvidence 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CtEvidence -> SDoc #

data CtOrigin #

Instances

Instances details
Outputable CtOrigin 
Instance details

Defined in GHC.Tc.Types.Origin

Methods

ppr :: CtOrigin -> SDoc #

data QCInst #

Instances

Instances details
Outputable QCInst 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: QCInst -> SDoc #

data CanEqLHS #

A CanEqLHS is a type that can appear on the left of a canonical equality: a type variable or exactly-saturated type family application.

Instances

Instances details
Outputable CanEqLHS 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CanEqLHS -> SDoc #

data Type #

Instances

Instances details
Data Type 
Instance details

Defined in GHC.Core.TyCo.Rep

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 GHC.Core.TyCo.Rep

Methods

ppr :: Type -> SDoc #

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
Outputable TcLevel 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

ppr :: TcLevel -> SDoc #

Eq TcLevel 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

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

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

Ord TcLevel 
Instance details

Defined in GHC.Tc.Utils.TcType

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 GHC.Core.TyCo.Rep

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 GHC.Core.TyCo.Rep

Methods

ppr :: Coercion -> SDoc #

data Role #

Instances

Instances details
Data Role 
Instance details

Defined in GHC.Core.Coercion.Axiom

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 #

Binary Role 
Instance details

Defined in GHC.Core.Coercion.Axiom

Methods

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

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

get :: BinHandle -> IO Role #

Outputable Role 
Instance details

Defined in GHC.Core.Coercion.Axiom

Methods

ppr :: Role -> SDoc #

Eq Role 
Instance details

Defined in GHC.Core.Coercion.Axiom

Methods

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

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

Ord Role 
Instance details

Defined in GHC.Core.Coercion.Axiom

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 #

type Anno (Maybe Role) 
Instance details

Defined in GHC.Hs.Decls

type Anno (Maybe Role) 
Instance details

Defined in GHC.Hs.Decls

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 GHC.Core.TyCo.Rep

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 GHC.Core.TyCo.Rep

Methods

ppr :: UnivCoProvenance -> SDoc #

data CoercionHole #

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

Instances

Instances details
Data CoercionHole 
Instance details

Defined in GHC.Core.TyCo.Rep

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 #

Uniquable CoercionHole 
Instance details

Defined in GHC.Core.TyCo.Rep

Outputable CoercionHole 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: CoercionHole -> SDoc #

data EvBind #

Instances

Instances details
Outputable EvBind 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvBind -> SDoc #

data EvTerm #

Instances

Instances details
Data EvTerm 
Instance details

Defined in GHC.Tc.Types.Evidence

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 GHC.Tc.Types.Evidence

Methods

ppr :: EvTerm -> SDoc #

type EvVar = EvId #

Evidence Variable

data EvBindsVar #

Instances

Instances details
Uniquable EvBindsVar 
Instance details

Defined in GHC.Tc.Types.Evidence

Outputable EvBindsVar 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvBindsVar -> SDoc #

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
ContainsModule TcGblEnv 
Instance details

Defined in GHC.Tc.Types

data TcLclEnv #

Pretty-printing

data SDoc #

Represents a pretty-printable document.

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

Instances

Instances details
IsString SDoc 
Instance details

Defined in GHC.Utils.Outputable

Methods

fromString :: String -> SDoc #

Outputable SDoc 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: SDoc -> SDoc #

OutputableP env SDoc 
Instance details

Defined in GHC.Utils.Outputable

Methods

pdoc :: env -> SDoc -> SDoc #

class Outputable a where #

Class designating that some type has an SDoc representation

Methods

ppr :: a -> SDoc #

Instances

Instances details
Outputable Fingerprint 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Fingerprint -> SDoc #

Outputable Int32 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Int32 -> SDoc #

Outputable Int64 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Int64 -> SDoc #

Outputable Word16 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Word16 -> SDoc #

Outputable Word32 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Word32 -> SDoc #

Outputable Word64 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Word64 -> SDoc #

Outputable IntSet 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: IntSet -> SDoc #

Outputable CoreModule 
Instance details

Defined in GHC

Methods

ppr :: CoreModule -> SDoc #

Outputable AltCon 
Instance details

Defined in GHC.Core

Methods

ppr :: AltCon -> SDoc #

Outputable Class 
Instance details

Defined in GHC.Core.Class

Methods

ppr :: Class -> SDoc #

Outputable LiftingContext 
Instance details

Defined in GHC.Core.Coercion

Methods

ppr :: LiftingContext -> SDoc #

Outputable CoAxBranch 
Instance details

Defined in GHC.Core.Coercion.Axiom

Methods

ppr :: CoAxBranch -> SDoc #

Outputable CoAxiomRule 
Instance details

Defined in GHC.Core.Coercion.Axiom

Methods

ppr :: CoAxiomRule -> SDoc #

Outputable Role 
Instance details

Defined in GHC.Core.Coercion.Axiom

Methods

ppr :: Role -> SDoc #

Outputable DataCon 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: DataCon -> SDoc #

Outputable EqSpec 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: EqSpec -> SDoc #

Outputable HsImplBang 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: HsImplBang -> SDoc #

Outputable HsSrcBang 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: HsSrcBang -> SDoc #

Outputable SrcStrictness 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: SrcStrictness -> SDoc #

Outputable SrcUnpackedness 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: SrcUnpackedness -> SDoc #

Outputable StrictnessMark 
Instance details

Defined in GHC.Core.DataCon

Methods

ppr :: StrictnessMark -> SDoc #

Outputable FamInst 
Instance details

Defined in GHC.Core.FamInstEnv

Methods

ppr :: FamInst -> SDoc #

Outputable FamInstMatch 
Instance details

Defined in GHC.Core.FamInstEnv

Methods

ppr :: FamInstMatch -> SDoc #

Outputable FamilyInstEnv 
Instance details

Defined in GHC.Core.FamInstEnv

Methods

ppr :: FamilyInstEnv -> SDoc #

Outputable ClsInst 
Instance details

Defined in GHC.Core.InstEnv

Methods

ppr :: ClsInst -> SDoc #

Outputable ClsInstEnv 
Instance details

Defined in GHC.Core.InstEnv

Methods

ppr :: ClsInstEnv -> SDoc #

Outputable FloatBind 
Instance details

Defined in GHC.Core.Make

Methods

ppr :: FloatBind -> SDoc #

Outputable PatSyn 
Instance details

Defined in GHC.Core.PatSyn

Methods

ppr :: PatSyn -> SDoc #

Outputable EqRel 
Instance details

Defined in GHC.Core.Predicate

Methods

ppr :: EqRel -> SDoc #

Outputable Reduction 
Instance details

Defined in GHC.Core.Reduction

Methods

ppr :: Reduction -> SDoc #

Outputable Coercion 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: Coercion -> SDoc #

Outputable CoercionHole 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: CoercionHole -> SDoc #

Outputable MCoercion 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: MCoercion -> SDoc #

Outputable TyCoBinder 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: TyCoBinder -> SDoc #

Outputable TyLit 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: TyLit -> SDoc #

Outputable Type 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: Type -> SDoc #

Outputable UnivCoProvenance 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: UnivCoProvenance -> SDoc #

Outputable AlgTyConFlav 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: AlgTyConFlav -> SDoc #

Outputable FamTyConFlav 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: FamTyConFlav -> SDoc #

Outputable PrimElemRep 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: PrimElemRep -> SDoc #

Outputable PrimRep 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: PrimRep -> SDoc #

Outputable TyCon 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: TyCon -> SDoc #

Outputable TyConBndrVis 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: TyConBndrVis -> SDoc #

Outputable TyConFlavour 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: TyConFlavour -> SDoc #

Outputable Usage 
Instance details

Defined in GHC.Core.UsageEnv

Methods

ppr :: Usage -> SDoc #

Outputable UsageEnv 
Instance details

Defined in GHC.Core.UsageEnv

Methods

ppr :: UsageEnv -> SDoc #

Outputable FastString 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: FastString -> SDoc #

Outputable LexicalFastString 
Instance details

Defined in GHC.Utils.Outputable

Outputable NonDetFastString 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: NonDetFastString -> SDoc #

Outputable XViaStrategyPs 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: XViaStrategyPs -> SDoc #

Outputable ArgDocMap 
Instance details

Defined in GHC.Hs.Doc

Methods

ppr :: ArgDocMap -> SDoc #

Outputable DeclDocMap 
Instance details

Defined in GHC.Hs.Doc

Methods

ppr :: DeclDocMap -> SDoc #

Outputable HsDocString 
Instance details

Defined in GHC.Hs.Doc

Methods

ppr :: HsDocString -> SDoc #

Outputable GrhsAnn 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: GrhsAnn -> SDoc #

Outputable PendingRnSplice 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: PendingRnSplice -> SDoc #

Outputable PendingTcSplice 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: PendingTcSplice -> SDoc #

Outputable SyntaxExprRn 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: SyntaxExprRn -> SDoc #

Outputable SyntaxExprTc 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: SyntaxExprTc -> SDoc #

Outputable XXExprGhcTc 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: XXExprGhcTc -> SDoc #

Outputable DsMatchContext 
Instance details

Defined in GHC.HsToCore.Monad

Methods

ppr :: DsMatchContext -> SDoc #

Outputable EquationInfo 
Instance details

Defined in GHC.HsToCore.Monad

Methods

ppr :: EquationInfo -> SDoc #

Outputable BinderInfo 
Instance details

Defined in GHC.Stg.Lift.Analysis

Methods

ppr :: BinderInfo -> SDoc #

Outputable Skeleton 
Instance details

Defined in GHC.Stg.Lift.Analysis

Methods

ppr :: Skeleton -> SDoc #

Outputable AltType 
Instance details

Defined in GHC.Stg.Syntax

Methods

ppr :: AltType -> SDoc #

Outputable ConstructorNumber 
Instance details

Defined in GHC.Stg.Syntax

Outputable NoExtFieldSilent 
Instance details

Defined in GHC.Stg.Syntax

Methods

ppr :: NoExtFieldSilent -> SDoc #

Outputable StgArg 
Instance details

Defined in GHC.Stg.Syntax

Methods

ppr :: StgArg -> SDoc #

Outputable UpdateFlag 
Instance details

Defined in GHC.Stg.Syntax

Methods

ppr :: UpdateFlag -> SDoc #

Outputable HoleFit 
Instance details

Defined in GHC.Tc.Errors.Hole.FitTypes

Methods

ppr :: HoleFit -> SDoc #

Outputable HoleFitCandidate 
Instance details

Defined in GHC.Tc.Errors.Hole.FitTypes

Methods

ppr :: HoleFitCandidate -> SDoc #

Outputable TypedHole 
Instance details

Defined in GHC.Tc.Errors.Hole.FitTypes

Methods

ppr :: TypedHole -> SDoc #

Outputable IdBindingInfo 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: IdBindingInfo -> SDoc #

Outputable PromotionErr 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: PromotionErr -> SDoc #

Outputable TcBinder 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: TcBinder -> SDoc #

Outputable TcIdSigInfo 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: TcIdSigInfo -> SDoc #

Outputable TcIdSigInst 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: TcIdSigInst -> SDoc #

Outputable TcPatSynInfo 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: TcPatSynInfo -> SDoc #

Outputable TcSigInfo 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: TcSigInfo -> SDoc #

Outputable TcTyThing 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: TcTyThing -> SDoc #

Outputable ThStage 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: ThStage -> SDoc #

Outputable WhereFrom 
Instance details

Defined in GHC.Tc.Types

Methods

ppr :: WhereFrom -> SDoc #

Outputable CanEqLHS 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CanEqLHS -> SDoc #

Outputable CheckTyEqResult 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CheckTyEqResult -> SDoc #

Outputable Ct 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: Ct -> SDoc #

Outputable CtEvidence 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CtEvidence -> SDoc #

Outputable CtFlavour 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CtFlavour -> SDoc #

Outputable CtIrredReason 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CtIrredReason -> SDoc #

Outputable HasGivenEqs 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: HasGivenEqs -> SDoc #

Outputable Hole 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: Hole -> SDoc #

Outputable HoleSort 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: HoleSort -> SDoc #

Outputable ImplicStatus 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: ImplicStatus -> SDoc #

Outputable Implication 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: Implication -> SDoc #

Outputable QCInst 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: QCInst -> SDoc #

Outputable SubGoalDepth 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: SubGoalDepth -> SDoc #

Outputable TcEvDest 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: TcEvDest -> SDoc #

Outputable WantedConstraints 
Instance details

Defined in GHC.Tc.Types.Constraint

Outputable EvBind 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvBind -> SDoc #

Outputable EvBindMap 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvBindMap -> SDoc #

Outputable EvBindsVar 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvBindsVar -> SDoc #

Outputable EvCallStack 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvCallStack -> SDoc #

Outputable EvTerm 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvTerm -> SDoc #

Outputable EvTypeable 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: EvTypeable -> SDoc #

Outputable HoleExprRef 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: HoleExprRef -> SDoc #

Outputable HsWrapper 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: HsWrapper -> SDoc #

Outputable TcEvBinds 
Instance details

Defined in GHC.Tc.Types.Evidence

Methods

ppr :: TcEvBinds -> SDoc #

Outputable CtOrigin 
Instance details

Defined in GHC.Tc.Types.Origin

Methods

ppr :: CtOrigin -> SDoc #

Outputable SkolemInfo 
Instance details

Defined in GHC.Tc.Types.Origin

Methods

ppr :: SkolemInfo -> SDoc #

Outputable IsExtraConstraint 
Instance details

Defined in GHC.Tc.Utils.Monad

Outputable ExpType 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

ppr :: ExpType -> SDoc #

Outputable InferResult 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

ppr :: InferResult -> SDoc #

Outputable MetaDetails 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

ppr :: MetaDetails -> SDoc #

Outputable MetaInfo 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

ppr :: MetaInfo -> SDoc #

Outputable TcLevel 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

ppr :: TcLevel -> SDoc #

Outputable TcTyVarDetails 
Instance details

Defined in GHC.Tc.Utils.TcType

Methods

ppr :: TcTyVarDetails -> SDoc #

Outputable Annotation 
Instance details

Defined in GHC.Types.Annotations

Methods

ppr :: Annotation -> SDoc #

Outputable AvailInfo 
Instance details

Defined in GHC.Types.Avail

Methods

ppr :: AvailInfo -> SDoc #

Outputable GreName 
Instance details

Defined in GHC.Types.Avail

Methods

ppr :: GreName -> SDoc #

Outputable Activation 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: Activation -> SDoc #

Outputable Alignment 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: Alignment -> SDoc #

Outputable Boxity 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: Boxity -> SDoc #

Outputable CompilerPhase 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: CompilerPhase -> SDoc #

Outputable FunctionOrData 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: FunctionOrData -> SDoc #

Outputable InlinePragma 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: InlinePragma -> SDoc #

Outputable InlineSpec 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: InlineSpec -> SDoc #

Outputable IntWithInf 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: IntWithInf -> SDoc #

Outputable LeftOrRight 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: LeftOrRight -> SDoc #

Outputable OccInfo 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: OccInfo -> SDoc #

Outputable OneShotInfo 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: OneShotInfo -> SDoc #

Outputable Origin 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: Origin -> SDoc #

Outputable OverlapFlag 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: OverlapFlag -> SDoc #

Outputable OverlapMode 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: OverlapMode -> SDoc #

Outputable PromotionFlag 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: PromotionFlag -> SDoc #

Outputable RecFlag 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: RecFlag -> SDoc #

Outputable RuleMatchInfo 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: RuleMatchInfo -> SDoc #

Outputable SuccessFlag 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: SuccessFlag -> SDoc #

Outputable SwapFlag 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: SwapFlag -> SDoc #

Outputable TailCallInfo 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: TailCallInfo -> SDoc #

Outputable TopLevelFlag 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: TopLevelFlag -> SDoc #

Outputable TupleSort 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: TupleSort -> SDoc #

Outputable TypeOrKind 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: TypeOrKind -> SDoc #

Outputable CompleteMatch 
Instance details

Defined in GHC.Types.CompleteMatch

Methods

ppr :: CompleteMatch -> SDoc #

Outputable DiagnosticHint 
Instance details

Defined in GHC.Types.Error

Methods

ppr :: DiagnosticHint -> SDoc #

Outputable DiagnosticReason 
Instance details

Defined in GHC.Types.Error

Methods

ppr :: DiagnosticReason -> SDoc #

Outputable Severity 
Instance details

Defined in GHC.Types.Error

Methods

ppr :: Severity -> SDoc #

Outputable DuplicateRecordFields 
Instance details

Defined in GHC.Types.FieldLabel

Outputable FieldLabel 
Instance details

Defined in GHC.Types.FieldLabel

Methods

ppr :: FieldLabel -> SDoc #

Outputable FieldSelectors 
Instance details

Defined in GHC.Types.FieldLabel

Methods

ppr :: FieldSelectors -> SDoc #

Outputable FixItem 
Instance details

Defined in GHC.Types.Fixity.Env

Methods

ppr :: FixItem -> SDoc #

Outputable CCallConv 
Instance details

Defined in GHC.Types.ForeignCall

Methods

ppr :: CCallConv -> SDoc #

Outputable CCallSpec 
Instance details

Defined in GHC.Types.ForeignCall

Methods

ppr :: CCallSpec -> SDoc #

Outputable CExportSpec 
Instance details

Defined in GHC.Types.ForeignCall

Methods

ppr :: CExportSpec -> SDoc #

Outputable CType 
Instance details

Defined in GHC.Types.ForeignCall

Methods

ppr :: CType -> SDoc #

Outputable ForeignCall 
Instance details

Defined in GHC.Types.ForeignCall

Methods

ppr :: ForeignCall -> SDoc #

Outputable Header 
Instance details

Defined in GHC.Types.ForeignCall

Methods

ppr :: Header -> SDoc #

Outputable Safety 
Instance details

Defined in GHC.Types.ForeignCall

Methods

ppr :: Safety -> SDoc #

Outputable Name 
Instance details

Defined in GHC.Types.Name

Methods

ppr :: Name -> SDoc #

Outputable NameSort 
Instance details

Defined in GHC.Types.Name

Methods

ppr :: NameSort -> SDoc #

Outputable OccName 
Instance details

Defined in GHC.Types.Name.Occurrence

Methods

ppr :: OccName -> SDoc #

Outputable GlobalRdrElt 
Instance details

Defined in GHC.Types.Name.Reader

Methods

ppr :: GlobalRdrElt -> SDoc #

Outputable ImportSpec 
Instance details

Defined in GHC.Types.Name.Reader

Methods

ppr :: ImportSpec -> SDoc #

Outputable LocalRdrEnv 
Instance details

Defined in GHC.Types.Name.Reader

Methods

ppr :: LocalRdrEnv -> SDoc #

Outputable Parent 
Instance details

Defined in GHC.Types.Name.Reader

Methods

ppr :: Parent -> SDoc #

Outputable RdrName 
Instance details

Defined in GHC.Types.Name.Reader

Methods

ppr :: RdrName -> SDoc #

Outputable RealSrcLoc 
Instance details

Defined in GHC.Types.SrcLoc

Methods

ppr :: RealSrcLoc -> SDoc #

Outputable RealSrcSpan 
Instance details

Defined in GHC.Types.SrcLoc

Methods

ppr :: RealSrcSpan -> SDoc #

Outputable SrcLoc 
Instance details

Defined in GHC.Types.SrcLoc

Methods

ppr :: SrcLoc -> SDoc #

Outputable SrcSpan 
Instance details

Defined in GHC.Types.SrcLoc

Methods

ppr :: SrcSpan -> SDoc #

Outputable UnhelpfulSpanReason 
Instance details

Defined in GHC.Types.SrcLoc

Outputable TyThing 
Instance details

Defined in GHC.Types.TyThing

Methods

ppr :: TyThing -> SDoc #

Outputable Unique 
Instance details

Defined in GHC.Types.Unique

Methods

ppr :: Unique -> SDoc #

Outputable AnonArgFlag 
Instance details

Defined in GHC.Types.Var

Methods

ppr :: AnonArgFlag -> SDoc #

Outputable ArgFlag 
Instance details

Defined in GHC.Types.Var

Methods

ppr :: ArgFlag -> SDoc #

Outputable Var 
Instance details

Defined in GHC.Types.Var

Methods

ppr :: Var -> SDoc #

Outputable ModuleName 
Instance details

Defined in GHC.Unit.Module.Name

Methods

ppr :: ModuleName -> SDoc #

Outputable WarningTxt 
Instance details

Defined in GHC.Unit.Module.Warnings

Methods

ppr :: WarningTxt -> SDoc #

Outputable ModuleOrigin 
Instance details

Defined in GHC.Unit.State

Methods

ppr :: ModuleOrigin -> SDoc #

Outputable UnitErr 
Instance details

Defined in GHC.Unit.State

Methods

ppr :: UnitErr -> SDoc #

Outputable UnitVisibility 
Instance details

Defined in GHC.Unit.State

Methods

ppr :: UnitVisibility -> SDoc #

Outputable UnusableUnitReason 
Instance details

Defined in GHC.Unit.State

Outputable InstalledModule 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: InstalledModule -> SDoc #

Outputable InstantiatedModule 
Instance details

Defined in GHC.Unit.Types

Outputable InstantiatedUnit 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: InstantiatedUnit -> SDoc #

Outputable Module 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: Module -> SDoc #

Outputable Unit 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: Unit -> SDoc #

Outputable UnitId 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: UnitId -> SDoc #

Outputable PprStyle 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: PprStyle -> SDoc #

Outputable QualifyName 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: QualifyName -> SDoc #

Outputable SDoc 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: SDoc -> SDoc #

Outputable DocDecl 
Instance details

Defined in Language.Haskell.Syntax.Decls

Methods

ppr :: DocDecl -> SDoc #

Outputable ForeignExport 
Instance details

Defined in Language.Haskell.Syntax.Decls

Methods

ppr :: ForeignExport -> SDoc #

Outputable ForeignImport 
Instance details

Defined in Language.Haskell.Syntax.Decls

Methods

ppr :: ForeignImport -> SDoc #

Outputable NewOrData 
Instance details

Defined in Language.Haskell.Syntax.Decls

Methods

ppr :: NewOrData -> SDoc #

Outputable SpliceDecoration 
Instance details

Defined in Language.Haskell.Syntax.Expr

Methods

ppr :: SpliceDecoration -> SDoc #

Outputable Serialized 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Serialized -> SDoc #

Outputable Extension 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Extension -> SDoc #

Outputable Ordering 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Ordering -> SDoc #

Outputable UTCTime 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: UTCTime -> SDoc #

Outputable Integer 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Integer -> SDoc #

Outputable () 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: () -> SDoc #

Outputable Bool 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Bool -> SDoc #

Outputable Char 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Char -> SDoc #

Outputable Double 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Double -> SDoc #

Outputable Float 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Float -> SDoc #

Outputable Int 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Int -> SDoc #

Outputable Word 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Word -> SDoc #

Outputable a => Outputable (NonEmpty a) 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: NonEmpty a -> SDoc #

Outputable a => Outputable (SCC a) 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: SCC a -> SDoc #

Outputable elt => Outputable (IntMap elt) 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: IntMap elt -> SDoc #

Outputable a => Outputable (Set a) 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Set a -> SDoc #

Outputable b => Outputable (TaggedBndr b) 
Instance details

Defined in GHC.Core

Methods

ppr :: TaggedBndr b -> SDoc #

Outputable ev => Outputable (NormaliseStepResult ev) 
Instance details

Defined in GHC.Core.Coercion

Methods

ppr :: NormaliseStepResult ev -> SDoc #

Outputable (CoAxiom br) 
Instance details

Defined in GHC.Core.Coercion.Axiom

Methods

ppr :: CoAxiom br -> SDoc #

Outputable a => Outputable (CoreMap a) 
Instance details

Defined in GHC.Core.Map.Expr

Methods

ppr :: CoreMap a -> SDoc #

Outputable a => Outputable (Scaled a) 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: Scaled a -> SDoc #

Outputable a => Outputable (Bag a) 
Instance details

Defined in GHC.Data.Bag

Methods

ppr :: Bag a -> SDoc #

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

Defined in GHC.Hs.ImpExp

Methods

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

OutputableBndr name => Outputable (IEWrappedName name) 
Instance details

Defined in GHC.Hs.ImpExp

Methods

ppr :: IEWrappedName name -> SDoc #

(OutputableBndrId p, Outputable (Anno (IE (GhcPass p)))) => Outputable (ImportDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.ImpExp

Methods

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

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

Defined in GHC.Tc.Utils.Env

Methods

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

Outputable name => Outputable (AnnTarget name) 
Instance details

Defined in GHC.Types.Annotations

Methods

ppr :: AnnTarget name -> SDoc #

Outputable (DefMethSpec ty) 
Instance details

Defined in GHC.Types.Basic

Methods

ppr :: DefMethSpec ty -> SDoc #

Outputable a => Outputable (OccEnv a) 
Instance details

Defined in GHC.Types.Name.Occurrence

Methods

ppr :: OccEnv a -> SDoc #

Outputable e => Outputable (Located e) 
Instance details

Defined in GHC.Types.SrcLoc

Methods

ppr :: Located e -> SDoc #

Outputable unit => Outputable (Definite unit) 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: Definite unit -> SDoc #

Outputable a => Outputable (GenWithIsBoot a) 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: GenWithIsBoot a -> SDoc #

Outputable unit => Outputable (Indefinite unit) 
Instance details

Defined in GHC.Unit.Types

Methods

ppr :: Indefinite unit -> SDoc #

Outputable (XRec a RdrName) => Outputable (RecordPatSynField a) 
Instance details

Defined in Language.Haskell.Syntax.Binds

Methods

ppr :: RecordPatSynField a -> SDoc #

Outputable (FamilyInfo pass) 
Instance details

Defined in Language.Haskell.Syntax.Decls

Methods

ppr :: FamilyInfo pass -> SDoc #

Outputable (XRec p FieldLabelString) => Outputable (DotFieldOcc p) 
Instance details

Defined in Language.Haskell.Syntax.Expr

Methods

ppr :: DotFieldOcc p -> SDoc #

(UnXRec p, Outputable (XRec p FieldLabelString)) => Outputable (FieldLabelStrings p) 
Instance details

Defined in Language.Haskell.Syntax.Expr

Methods

ppr :: FieldLabelStrings p -> SDoc #

Outputable a => Outputable (Maybe a) 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: Maybe a -> SDoc #

Outputable a => Outputable [a] 
Instance details

Defined in GHC.Utils.Outputable

Methods

ppr :: [a] -> SDoc #

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

Defined in GHC.Utils.Outputable

Methods

ppr :: Either a b -> SDoc #

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

Defined in GHC.Utils.Outputable

Methods

ppr :: Map key elt -> SDoc #

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

Defined in GHC.Data.TrieMap

Methods

ppr :: GenMap m a -> SDoc #

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

Defined in GHC.Data.TrieMap

Methods

ppr :: ListMap m a -> SDoc #

(Outputable a, Outputable b) => Outputable (HsExpansion a b)

Just print the original expression (the a).

Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: HsExpansion a b -> SDoc #

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

Defined in GHC.Hs.Pat

Methods

ppr :: HsPatExpansion a b -> SDoc #

Outputable e => Outputable (GenLocated RealSrcSpan e) 
Instance details

Defined in GHC.Types.SrcLoc

Outputable a => Outputable (UniqDFM key a) 
Instance details

Defined in GHC.Types.Unique.DFM

Methods

ppr :: UniqDFM key a -> SDoc #

Outputable a => Outputable (UniqFM key a) 
Instance details

Defined in GHC.Types.Unique.FM

Methods

ppr :: UniqFM key a -> SDoc #

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

Defined in GHC.Core.TyCon

Methods

ppr :: VarBndr tv TyConBndrVis -> SDoc #

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

Defined in GHC.Types.Var

Methods

ppr :: VarBndr tv ArgFlag -> SDoc #

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

Defined in GHC.Types.Var

Methods

ppr :: VarBndr tv Specificity -> SDoc #

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

Defined in GHC.Utils.Outputable

Methods

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

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

Defined in GHC.Utils.Outputable

Methods

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

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

Defined in GHC.Utils.Outputable

Methods

ppr :: (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 GHC.Utils.Outputable

Methods

ppr :: (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 GHC.Utils.Outputable

Methods

ppr :: (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 GHC.Utils.Outputable

Methods

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