ghc-typelits-presburger-0.7.2.0: Presburger Arithmetic Solver for GHC Type-level natural numbers.
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.TypeLits.Presburger.Compat

Synopsis

Documentation

data Plugin #

Plugin is the compiler plugin data type. Try to avoid constructing one of these directly, and just modify some fields of defaultPlugin instead: this is to try and preserve source-code compatibility when we add fields to this.

Nonetheless, this API is preliminary and highly likely to change in the future.

Constructors

Plugin 

Fields

tcPluginTrace :: String -> SDoc -> TcPluginM () #

Output useful for debugging the compiler.

tcPluginIO :: IO a -> TcPluginM a #

Perform some IO, typically to interact with an external tool.

newWanted :: CtLoc -> PredType -> TcPluginM CtEvidence #

Create a new wanted constraint.

defaultPlugin :: Plugin #

Default plugin: does nothing at all, except for marking that safe inference has failed unless -fplugin-trustworthy is passed. For compatibility reason you should base all your plugin definitions on this default value.

data TcPluginResult #

Constructors

TcPluginContradiction [Ct]

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

TcPluginOk [(EvTerm, Ct)] [Ct]

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.

data TcPluginM a #

Instances

Instances details
MonadFail TcPluginM 
Instance details

Defined in GHC.Tc.Types

Methods

fail :: String -> TcPluginM a #

Applicative TcPluginM 
Instance details

Defined in GHC.Tc.Types

Methods

pure :: a -> TcPluginM a #

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

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

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

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

Functor TcPluginM 
Instance details

Defined in GHC.Tc.Types

Methods

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

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

Monad TcPluginM 
Instance details

Defined in GHC.Tc.Types

Methods

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

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

return :: a -> TcPluginM a #

data TcPlugin #

Constructors

TcPlugin 

Fields

data HscEnv #

HscEnv is like Session, except that some of the fields are immutable. An HscEnv is used to compile a single module from plain Haskell source code (after preprocessing) to either C, assembly or C--. It's also used to store the dynamic linker state to allow for multiple linkers in the same address space. Things like the module graph don't change during a single compilation.

Historical note: "hsc" used to be the name of the compiler binary, when there was a separate driver and compiler. To compile a single module, the driver would invoke hsc on the source code... so nowadays we think of hsc as the layer of the compiler that deals with compiling a single module.

data Hsc a #

The Hsc monad: Passing an environment and warning state

Instances

Instances details
MonadIO Hsc 
Instance details

Defined in GHC.Driver.Env.Types

Methods

liftIO :: IO a -> Hsc a #

Applicative Hsc 
Instance details

Defined in GHC.Driver.Env.Types

Methods

pure :: a -> Hsc a #

(<*>) :: Hsc (a -> b) -> Hsc a -> Hsc b #

liftA2 :: (a -> b -> c) -> Hsc a -> Hsc b -> Hsc c #

(*>) :: Hsc a -> Hsc b -> Hsc b #

(<*) :: Hsc a -> Hsc b -> Hsc a #

Functor Hsc 
Instance details

Defined in GHC.Driver.Env.Types

Methods

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

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

Monad Hsc 
Instance details

Defined in GHC.Driver.Env.Types

Methods

(>>=) :: Hsc a -> (a -> Hsc b) -> Hsc b #

(>>) :: Hsc a -> Hsc b -> Hsc b #

return :: a -> Hsc a #

HasDynFlags Hsc 
Instance details

Defined in GHC.Driver.Env.Types

HasLogger Hsc 
Instance details

Defined in GHC.Driver.Env.Types

Methods

getLogger :: Hsc Logger #

data CtEvidence #

Instances

Instances details
Outputable CtEvidence 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: CtEvidence -> SDoc #

data Ct #

Instances

Instances details
Outputable Ct 
Instance details

Defined in GHC.Tc.Types.Constraint

Methods

ppr :: Ct -> SDoc #

data HsParsedModule #

Constructors

HsParsedModule 

Fields

  • hpm_module :: Located HsModule
     
  • hpm_src_files :: [FilePath]

    extra source files (e.g. from #includes). The lexer collects these from '# file line' pragmas, which the C preprocessor leaves behind. These files and their timestamps are stored in the .hi file, so that we can force recompilation if any of them change (#3589)

data HsModule #

Haskell Module

All we actually declare here is the top-level structure for a module.

Constructors

HsModule 

Fields

Instances

Instances details
Data HsModule 
Instance details

Defined in GHC.Hs

Methods

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

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

toConstr :: HsModule -> Constr #

dataTypeOf :: HsModule -> DataType #

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

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

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

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

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

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

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

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

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

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

Outputable HsModule 
Instance details

Defined in GHC.Hs

Methods

ppr :: HsModule -> SDoc #

data ImportDeclQualifiedStyle #

If/how an import is qualified.

Constructors

QualifiedPre

qualified appears in prepositive position.

QualifiedPost

qualified appears in postpositive position.

NotQualified

Not qualified.

Instances

Instances details
Data ImportDeclQualifiedStyle 
Instance details

Defined in GHC.Hs.ImpExp

Methods

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

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

toConstr :: ImportDeclQualifiedStyle -> Constr #

dataTypeOf :: ImportDeclQualifiedStyle -> DataType #

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

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

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

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

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

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

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

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

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

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

Eq ImportDeclQualifiedStyle 
Instance details

Defined in GHC.Hs.ImpExp

data ImportDecl pass #

Import Declaration

A single Haskell import declaration.

Constructors

ImportDecl 

Fields

XImportDecl !(XXImportDecl pass)

AnnKeywordIds

Instances

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

Defined in GHC.Hs.ImpExp

Methods

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

type Anno (ImportDecl (GhcPass p)) 
Instance details

Defined in GHC.Hs.ImpExp

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 #

tcTyFamInsts :: Type -> [(TyCon, [Type])] #

Finds outermost type-family applications occurring in a type, after expanding synonyms. In the list (F, tys) that is returned we guarantee that tys matches F's arity. For example, given type family F a :: * -> * (arity 1) calling tcTyFamInsts on (Maybe (F Int Bool) will return (F, [Int]), not (F, [Int,Bool])

This is important for its use in deciding termination of type instances (see #11581). E.g. type instance G [Int] = ...(F Int <big type>)... we don't need to take <big type> into account when asking if the calls on the RHS are smaller than the LHS

data NoExtField #

A placeholder type for TTG extension points that are not currently unused to represent any particular value.

This should not be confused with NoExtCon, which are found in unused extension constructors and therefore should never be inhabited. In contrast, NoExtField is used in extension points (e.g., as the field of some constructor), so it must have an inhabitant to construct AST passes that manipulate fields with that extension point as their type.

Constructors

NoExtField 

Instances

Instances details
Data NoExtField 
Instance details

Defined in Language.Haskell.Syntax.Extension

Methods

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

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

toConstr :: NoExtField -> Constr #

dataTypeOf :: NoExtField -> DataType #

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

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

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

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

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

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

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

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

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

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

Outputable NoExtField 
Instance details

Defined in Language.Haskell.Syntax.Extension

Methods

ppr :: NoExtField -> SDoc #

Eq NoExtField 
Instance details

Defined in Language.Haskell.Syntax.Extension

Ord NoExtField 
Instance details

Defined in Language.Haskell.Syntax.Extension

lookupPackageName :: UnitState -> PackageName -> Maybe IndefUnitId #

Find the unit we know about with the given package name (e.g. foo), if any (NB: there might be a locally defined unit name which overrides this)

data InjectivityCheckResult #

Result of testing two type family equations for injectiviy.

Constructors

InjectivityAccepted

Either RHSs are distinct or unification of RHSs leads to unification of LHSs

InjectivityUnified CoAxBranch CoAxBranch

RHSs unify but LHSs don't unify under that substitution. Relevant for closed type families where equation after unification might be overlpapped (in which case it is OK if they don't unify). Constructor stores axioms after unification.

data FamInstMatch #

Constructors

FamInstMatch 

Instances

Instances details
Outputable FamInstMatch 
Instance details

Defined in GHC.Core.FamInstEnv

Methods

ppr :: FamInstMatch -> SDoc #

type FamInstEnv = UniqDFM TyCon FamilyInstEnv #

data FamInst #

Instances

Instances details
NamedThing FamInst 
Instance details

Defined in GHC.Core.FamInstEnv

Outputable FamInst 
Instance details

Defined in GHC.Core.FamInstEnv

Methods

ppr :: FamInst -> SDoc #

topReduceTyFamApp_maybe :: FamInstEnvs -> TyCon -> [Type] -> Maybe (Coercion, Type, MCoercion) #

Try to simplify a type-family application, by *one* step If topReduceTyFamApp_maybe env r F tys = Just (co, rhs, res_co) then co :: F tys ~R# rhs res_co :: typeKind(F tys) ~ typeKind(rhs) Type families and data families; always Representational role

topNormaliseType_maybe :: FamInstEnvs -> Type -> Maybe (Coercion, Type) #

Get rid of *outermost* (or toplevel) * type function redex * data family redex * newtypes returning an appropriate Representational coercion. Specifically, if topNormaliseType_maybe env ty = Just (co, ty') then (a) co :: ty ~R ty' (b) ty' is not a newtype, and is not a type-family or data-family redex

However, ty' can be something like (Maybe (F ty)), where (F ty) is a redex.

Always operates homogeneously: the returned type has the same kind as the original type, and the returned coercion is always homogeneous.

mkSingleCoAxiom :: Role -> Name -> [TyVar] -> [TyVar] -> [CoVar] -> TyCon -> [Type] -> Type -> CoAxiom Unbranched #

mkNewTypeCoAxiom :: Name -> TyCon -> [TyVar] -> [Role] -> Type -> CoAxiom Unbranched #

Create a coercion constructor (axiom) suitable for the given newtype TyCon. The Name should be that of a new coercion CoAxiom, the TyVars the arguments expected by the newtype and the type the appropriate right hand side of the newtype, with the free variables a subset of those TyVars.

mkCoAxBranch :: [TyVar] -> [TyVar] -> [CoVar] -> [Type] -> Type -> [Role] -> SrcSpan -> CoAxBranch #

lookupFamInstEnvInjectivityConflicts :: [Bool] -> FamInstEnvs -> FamInst -> [CoAxBranch] #

Check whether an open type family equation can be added to already existing instance environment without causing conflicts with supplied injectivity annotations. Returns list of conflicting axioms (type instance declarations).

injectiveBranches :: [Bool] -> CoAxBranch -> CoAxBranch -> InjectivityCheckResult #

Check whether two type family axioms don't violate injectivity annotation.

apartnessCheck #

Arguments

:: [Type]

flattened target arguments. Make sure they're flattened! See Note [Flattening type-family applications when matching instances] in GHC.Core.Unify.

-> CoAxBranch

the candidate equation we wish to use Precondition: this matches the target

-> Bool

True = equation can fire

Do an apartness check, as described in the "Closed Type Families" paper (POPL '14). This should be used when determining if an equation (CoAxBranch) of a closed type family can be used to reduce a certain target type family application.

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 #

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

Makes a lifted equality predicate at the given role

splitTyConApp :: Type -> (TyCon, [Type]) #

Attempts to tease a type apart into a type constructor and the application of a number of arguments to that constructor. Panics if that is not possible. See also splitTyConApp_maybe

isStrLitTy :: Type -> Maybe FastString #

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

isNumLitTy :: Type -> Maybe Integer #

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

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.

type TvSubstEnv = TyVarEnv Type #

A substitution of Types for TyVars and Kinds for KindVars

data TCvSubst #

Type & coercion substitution

The following invariants must hold of a TCvSubst:

  1. The in-scope set is needed only to guide the generation of fresh uniques
  2. In particular, the kind of the type variables in the in-scope set is not relevant
  3. The substitution is only applied ONCE! This is because in general such application will not reach a fixed point.

Instances

Instances details
Outputable TCvSubst 
Instance details

Defined in GHC.Core.TyCo.Subst

Methods

ppr :: TCvSubst -> SDoc #

data TyConFlavour #

Paints a picture of what a TyCon represents, in broad strokes. This is used towards more informative error messages.

Instances

Instances details
Outputable TyConFlavour 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: TyConFlavour -> SDoc #

Eq TyConFlavour 
Instance details

Defined in GHC.Core.TyCon

data TyConBndrVis #

Instances

Instances details
Binary TyConBndrVis 
Instance details

Defined in GHC.Core.TyCon

Outputable TyConBndrVis 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: TyConBndrVis -> SDoc #

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

Defined in GHC.Core.TyCon

Methods

ppr :: VarBndr tv TyConBndrVis -> SDoc #

data RuntimeRepInfo #

Some promoted datacons signify extra info relevant to GHC. For example, the IntRep constructor of RuntimeRep corresponds to the IntRep constructor of PrimRep. This data structure allows us to store this information right in the TyCon. The other approach would be to look up things like RuntimeRep's PrimRep by known-key every time. See also Note [Getting from RuntimeRep to PrimRep] in GHC.Types.RepType

Constructors

NoRRI

an ordinary promoted data con

RuntimeRep ([Type] -> [PrimRep])

A constructor of RuntimeRep. The argument to the function should be the list of arguments to the promoted datacon.

VecCount Int

A constructor of VecCount

VecElem PrimElemRep

A constructor of VecElem

LiftedInfo

A constructor of Levity

UnliftedInfo

A constructor of Levity

data PrimRep #

A PrimRep is an abstraction of a type. It contains information that the code generator needs in order to pass arguments, return results, and store values of this type. See also Note [RuntimeRep and PrimRep] in GHC.Types.RepType and Note [VoidRep] in GHC.Types.RepType.

Constructors

VoidRep 
LiftedRep 
UnliftedRep

Unlifted pointer

Int8Rep

Signed, 8-bit value

Int16Rep

Signed, 16-bit value

Int32Rep

Signed, 32-bit value

Int64Rep

Signed, 64 bit value

IntRep

Signed, word-sized value

Word8Rep

Unsigned, 8 bit value

Word16Rep

Unsigned, 16 bit value

Word32Rep

Unsigned, 32 bit value

Word64Rep

Unsigned, 64 bit value

WordRep

Unsigned, word-sized value

AddrRep

A pointer, but not to a Haskell value (use '(Un)liftedRep')

FloatRep 
DoubleRep 
VecRep Int PrimElemRep

A vector

Instances

Instances details
Show PrimRep 
Instance details

Defined in GHC.Core.TyCon

Outputable PrimRep 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: PrimRep -> SDoc #

Eq PrimRep 
Instance details

Defined in GHC.Core.TyCon

Methods

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

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

data Injectivity #

Constructors

NotInjective 
Injective [Bool] 

Instances

Instances details
Binary Injectivity 
Instance details

Defined in GHC.Core.TyCon

Eq Injectivity 
Instance details

Defined in GHC.Core.TyCon

data FamTyConFlav #

Information pertaining to the expansion of a type synonym (type)

Constructors

DataFamilyTyCon TyConRepName

Represents an open type family without a fixed right hand side. Additional instances can appear at any time.

These are introduced by either a top level declaration:

data family T a :: *

Or an associated data type declaration, within a class declaration:

class C a b where
  data T b :: *
OpenSynFamilyTyCon

An open type synonym family e.g. type family F x y :: * -> *

ClosedSynFamilyTyCon (Maybe (CoAxiom Branched))

A closed type synonym family e.g. type family F x where { F Int = Bool }

AbstractClosedSynFamilyTyCon

A closed type synonym family declared in an hs-boot file with type family F a where ..

BuiltInSynFamTyCon BuiltInSynFamily

Built-in type family used by the TypeNats solver

Instances

Instances details
Outputable FamTyConFlav 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: FamTyConFlav -> SDoc #

data AlgTyConRhs #

Represents right-hand-sides of TyCons for algebraic types

Constructors

AbstractTyCon

Says that we know nothing about this data type, except that it's represented by a pointer. Used when we export a data type abstractly into an .hi file.

DataTyCon

Information about those TyCons derived from a data declaration. This includes data types with no constructors at all.

Fields

  • data_cons :: [DataCon]

    The data type constructors; can be empty if the user declares the type to have no constructors

    INVARIANT: Kept in order of increasing DataCon tag (see the tag assignment in mkTyConTagMap)

  • data_cons_size :: Int

    Cached value: length data_cons

  • is_enum :: Bool

    Cached value: is this an enumeration type? See Note [Enumeration types]

TupleTyCon 

Fields

SumTyCon

An unboxed sum type.

Fields

  • data_cons :: [DataCon]

    The data type constructors; can be empty if the user declares the type to have no constructors

    INVARIANT: Kept in order of increasing DataCon tag (see the tag assignment in mkTyConTagMap)

  • data_cons_size :: Int

    Cached value: length data_cons

NewTyCon

Information about those TyCons derived from a newtype declaration

Fields

data AlgTyConFlav #

Constructors

VanillaAlgTyCon TyConRepName

An ordinary type constructor has no parent.

UnboxedAlgTyCon (Maybe TyConRepName)

An unboxed type constructor. The TyConRepName is a Maybe since we currently don't allow unboxed sums to be Typeable since there are too many of them. See #13276.

ClassTyCon Class TyConRepName

Type constructors representing a class dictionary. See Note [ATyCon for classes] in GHC.Core.TyCo.Rep

DataFamInstTyCon (CoAxiom Unbranched) TyCon [Type]

Type constructors representing an *instance* of a *data* family. Parameters:

1) The type family in question

2) Instance types; free variables are the tyConTyVars of the current TyCon (not the family one). INVARIANT: the number of types matches the arity of the family TyCon

3) A CoTyCon identifying the representation type with the type instance family

Instances

Instances details
Outputable AlgTyConFlav 
Instance details

Defined in GHC.Core.TyCon

Methods

ppr :: AlgTyConFlav -> SDoc #

visibleDataCons :: AlgTyConRhs -> [DataCon] #

Both type classes as well as family instances imply implicit type constructors. These implicit type constructors refer to their parent structure (ie, the class or family from which they derive) using a type of the following form.

Extract those DataCons that we are able to learn about. Note that visibility in this sense does not correspond to visibility in the context of any particular user program!

unwrapNewTyCon_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched) #

Take a TyCon apart into the TyVars it scopes over, the Type it expands into, and (possibly) a coercion from the representation type to the newtype. Returns Nothing if this is not possible.

tyConStupidTheta :: TyCon -> [PredType] #

Find the "stupid theta" of the TyCon. A "stupid theta" is the context to the left of an algebraic type declaration, e.g. Eq a in the declaration data Eq a => T a ...

tyConSkolem :: TyCon -> Bool #

Returns whether or not this TyCon is definite, or a hole that may be filled in at some later point. See Note [Skolem abstract data]

tyConSingleDataCon_maybe :: TyCon -> Maybe DataCon #

If the given TyCon has a single data constructor, i.e. it is a data type with one alternative, a tuple type or a newtype then that constructor is returned. If the TyCon has more than one constructor, or represents a primitive or function type constructor then Nothing is returned.

tyConRuntimeRepInfo :: TyCon -> RuntimeRepInfo #

Extract any RuntimeRepInfo from this TyCon

tyConRoles :: TyCon -> [Role] #

Get the list of roles for the type parameters of a TyCon

tyConRepModOcc :: Module -> OccName -> (Module, OccName) #

The name (and defining module) for the Typeable representation (TyCon) of a type constructor.

See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable.

tyConInjectivityInfo :: TyCon -> Injectivity #

tyConInjectivityInfo tc returns Injective is if tc is an injective tycon (where is states for which tyConBinders tc is injective), or NotInjective otherwise.

tyConFlavourAssoc_maybe :: TyConFlavour -> Maybe TyCon #

Get the enclosing class TyCon (if there is one) for the given TyConFlavour

tyConFieldLabels :: TyCon -> [FieldLabel] #

The labels for the fields of this particular TyCon

tyConFamilySize :: TyCon -> Int #

Determine the number of value constructors a TyCon has. Panics if the TyCon is not algebraic or a tuple

tyConFamilyResVar_maybe :: TyCon -> Maybe Name #

Extract type variable naming the result of injective type family

tyConFamilyCoercion_maybe :: TyCon -> Maybe (CoAxiom Unbranched) #

If this TyCon is that of a data family instance, return a TyCon which represents a coercion identifying the representation type with the type instance family. Otherwise, return Nothing

tyConFamInst_maybe :: TyCon -> Maybe (TyCon, [Type]) #

If this TyCon is that of a data family instance, return the family in question and the instance types. Otherwise, return Nothing

tyConDataCons_maybe :: TyCon -> Maybe [DataCon] #

Determine the DataCons originating from the given TyCon, if the TyCon is the sort that can have any constructors (note: this does not include abstract algebraic types)

tyConDataCons :: TyCon -> [DataCon] #

As tyConDataCons_maybe, but returns the empty list of constructors if no constructors could be found

tyConClass_maybe :: TyCon -> Maybe Class #

If this TyCon is that for a class instance, return the class it is for. Otherwise returns Nothing

tyConAssoc_maybe :: TyCon -> Maybe TyCon #

Get the enclosing class TyCon (if there is one) for the given TyCon.

tyConAlgDataCons_maybe :: TyCon -> Maybe [DataCon] #

Returns Just dcs if the given TyCon is a data type, a tuple type or a sum type with data constructors dcs. If the TyCon has more than one constructor, or represents a primitive or function type constructor then Nothing is returned.

Like tyConDataCons_maybe, but returns Nothing for newtypes.

tyConATs :: TyCon -> [TyCon] #

Return the associated types of the TyCon, if any

tcFlavourIsOpen :: TyConFlavour -> Bool #

Is this flavour of TyCon an open type family or a data family?

synTyConRhs_maybe :: TyCon -> Maybe Type #

Extract the information pertaining to the right hand side of a type synonym (type) declaration.

synTyConDefn_maybe :: TyCon -> Maybe ([TyVar], Type) #

Extract the TyVars bound by a vanilla type synonym and the corresponding (unsubstituted) right hand side.

primRepSizeB :: Platform -> PrimRep -> Int #

The size of a PrimRep in bytes.

This applies also when used in a constructor, where we allow packing the fields. For instance, in data Foo = Foo Float# Float# the two fields will take only 8 bytes, which for 64-bit arch will be equal to 1 word. See also mkVirtHeapOffsetsWithPadding for details of how data fields are laid out.

primRepIsFloat :: PrimRep -> Maybe Bool #

Return if Rep stands for floating type, returns Nothing for vector types.

noTcTyConScopedTyVars :: [(Name, TcTyVar)] #

No scoped type variables (to be used with mkTcTyCon).

newTyConRhs :: TyCon -> ([TyVar], Type) #

Extract the bound type variables and type expansion of a type synonym TyCon. Panics if the TyCon is not a synonym

newTyConEtadRhs :: TyCon -> ([TyVar], Type) #

Extract the bound type variables and type expansion of an eta-contracted type synonym TyCon. Panics if the TyCon is not a synonym

newTyConEtadArity :: TyCon -> Int #

The number of type parameters that need to be passed to a newtype to resolve it. May be less than in the definition if it can be eta-contracted.

newTyConCo_maybe :: TyCon -> Maybe (CoAxiom Unbranched) #

Extracts the newtype coercion from such a TyCon, which can be used to construct something with the newtypes type from its representation type (right hand side). If the supplied TyCon is not a newtype, returns Nothing

mustBeSaturated :: TyCon -> Bool #

True iff we can decompose (T a b c) into ((T a b) c) I.e. is it injective and generative w.r.t nominal equality? That is, if (T a b) ~N d e f, is it always the case that (T ~N d), (a ~N e) and (b ~N f)? Specifically NOT true of synonyms (open and otherwise)

It'd be unusual to call mustBeSaturated on a regular H98 type synonym, because you should probably have expanded it first But regardless, it's not decomposable

mkTupleTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

Result kind of the TyCon

-> Arity

Arity of the tuple TyCon

-> DataCon 
-> TupleSort

Whether the tuple is boxed or unboxed

-> AlgTyConFlav 
-> TyCon 

mkTcTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

result kind only

-> [(Name, TcTyVar)]

Scoped type variables; see Note [How TcTyCons work] in GHC.Tc.TyCl

-> Bool

Is this TcTyCon generalised already?

-> TyConFlavour

What sort of TyCon this represents

-> TyCon 

Makes a tycon suitable for use during type-checking. It stores a variety of details about the definition of the TyCon, but no right-hand side. It lives only during the type-checking of a mutually-recursive group of tycons; it is then zonked to a proper TyCon in zonkTcTyCon. See also Note [Kind checking recursive type and class declarations] in GHC.Tc.TyCl.

mkSynonymTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

result kind

-> [Role] 
-> Type 
-> Bool 
-> Bool 
-> Bool 
-> TyCon 

Create a type synonym TyCon

mkSumTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

Kind of the resulting TyCon

-> Arity

Arity of the sum

-> [TyVar]

TyVars scoped over: see tyConTyVars

-> [DataCon] 
-> AlgTyConFlav 
-> TyCon 

mkRequiredTyConBinder :: TyCoVarSet -> TyVar -> TyConBinder #

Make a Required TyConBinder. It chooses between NamedTCB and AnonTCB based on whether the tv is mentioned in the dependent set

mkPromotedDataCon :: DataCon -> Name -> TyConRepName -> [TyConTyCoBinder] -> Kind -> [Role] -> RuntimeRepInfo -> TyCon #

Create a promoted data constructor TyCon Somewhat dodgily, we give it the same Name as the data constructor itself; when we pretty-print the TyCon we add a quote; see the Outputable TyCon instance

mkPrimTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

result kind, never levity-polymorphic

-> [Role] 
-> TyCon 

Create an unlifted primitive TyCon, such as Int#.

mkLiftedPrimTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

result kind

-> [Role] 
-> TyCon 

Create a lifted primitive TyCon such as RealWorld

mkKindTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

result kind

-> [Role] 
-> Name 
-> TyCon 

Kind constructors

mkFunTyCon :: Name -> [TyConBinder] -> Name -> TyCon #

Given the name of the function type constructor and it's kind, create the corresponding TyCon. It is recommended to use funTyCon if you want this functionality

mkFamilyTyCon #

Arguments

:: Name 
-> [TyConBinder] 
-> Kind

result kind

-> Maybe Name 
-> FamTyConFlav 
-> Maybe Class 
-> Injectivity 
-> TyCon 

Create a type family TyCon

mkClassTyCon :: Name -> [TyConBinder] -> [Role] -> AlgTyConRhs -> Class -> Name -> TyCon #

Simpler specialization of mkAlgTyCon for classes

mkAlgTyCon #

Arguments

:: Name 
-> [TyConBinder]

Binders of the TyCon

-> Kind

Result kind

-> [Role]

The roles for each TyVar

-> Maybe CType

The C type this type corresponds to when using the CAPI FFI

-> [PredType]

Stupid theta: see algTcStupidTheta

-> AlgTyConRhs

Information about data constructors

-> AlgTyConFlav

What flavour is it? (e.g. vanilla, type family)

-> Bool

Was the TyCon declared with GADT syntax?

-> TyCon 

This is the making of an algebraic TyCon.

lookupTyConFieldLabel :: FieldLabelString -> TyCon -> Maybe FieldLabel #

Look up a field label belonging to this TyCon

isVanillaAlgTyCon :: TyCon -> Bool #

Returns True for vanilla AlgTyCons -- that is, those created with a data or newtype declaration.

isUnliftedTyCon :: TyCon -> Bool #

Is this TyCon unlifted (i.e. cannot contain bottom)? Note that this can only be true for primitive and unboxed-tuple TyCons

isUnboxedSumTyCon :: TyCon -> Bool #

Is this the TyCon for an unboxed sum?

isTypeSynonymTyCon :: TyCon -> Bool #

Is this a TyCon representing a regular H98 type synonym (type)?

isTypeFamilyTyCon :: TyCon -> Bool #

Is this a synonym TyCon that can have may have further instances appear?

isTyConWithSrcDataCons :: TyCon -> Bool #

Check if the tycon actually refers to a proper `data` or `newtype` with user defined constructors rather than one from a class or other construction.

isTyConAssoc :: TyCon -> Bool #

Is this TyCon for an associated type?

isTcTyCon :: TyCon -> Bool #

Is this a TcTyCon? (That is, one only used during type-checking?)

isTcLevPoly :: TyCon -> Bool #

Could this TyCon ever be levity-polymorphic when fully applied? True is safe. False means we're sure. Does only a quick check based on the TyCon's category. Precondition: The fully-applied TyCon has kind (TYPE blah)

isPromotedTupleTyCon :: TyCon -> Bool #

Is this the TyCon for a promoted tuple?

isPromotedDataCon_maybe :: TyCon -> Maybe DataCon #

Retrieves the promoted DataCon if this is a PromotedDataCon;

isPromotedDataCon :: TyCon -> Bool #

Is this a PromotedDataCon?

isPrimTyCon :: TyCon -> Bool #

Does this TyCon represent something that cannot be defined in Haskell?

isOpenTypeFamilyTyCon :: TyCon -> Bool #

Is this an open type family TyCon?

isOpenFamilyTyCon :: TyCon -> Bool #

Is this a TyCon, synonym or otherwise, that defines a family with instances?

isNewTyCon :: TyCon -> Bool #

Is this TyCon that for a newtype

isKindTyCon :: TyCon -> Bool #

Is this tycon really meant for use at the kind level? That is, should it be permitted without -XDataKinds?

isInjectiveTyCon :: TyCon -> Role -> Bool #

isInjectiveTyCon is true of TyCons for which this property holds (where X is the role passed in): If (T a1 b1 c1) ~X (T a2 b2 c2), then (a1 ~X1 a2), (b1 ~X2 b2), and (c1 ~X3 c2) (where X1, X2, and X3, are the roles given by tyConRolesX tc X) See also Note [Decomposing equality] in GHC.Tc.Solver.Canonical

isImplicitTyCon :: TyCon -> Bool #

Identifies implicit tycons that, in particular, do not go into interface files (because they are implicitly reconstructed when the interface is read).

Note that:

  • Associated families are implicit, as they are re-constructed from the class declaration in which they reside, and
  • Family instances are not implicit as they represent the instance body (similar to a dfun does that for a class instance).
  • Tuples are implicit iff they have a wired-in name (namely: boxed and unboxed tuples are wired-in and implicit, but constraint tuples are not)

isGenerativeTyCon :: TyCon -> Role -> Bool #

isGenerativeTyCon is true of TyCons for which this property holds (where X is the role passed in): If (T tys ~X t), then (t's head ~X T). See also Note [Decomposing equality] in GHC.Tc.Solver.Canonical

isGenInjAlgRhs :: AlgTyConRhs -> Bool #

Is this an AlgTyConRhs of a TyCon that is generative and injective with respect to representational equality?

isGadtSyntaxTyCon :: TyCon -> Bool #

Is this an algebraic TyCon declared with the GADT syntax?

isForgetfulSynTyCon :: TyCon -> Bool #

Is this a forgetful type synonym? If this is a type synonym whose RHS does not mention one (or more) of its bound variables, returns True. Thus, False means that all bound variables appear on the RHS; True may not mean anything, as the test to set this flag is conservative.

isFamilyTyCon :: TyCon -> Bool #

Is this a TyCon, synonym or otherwise, that defines a family?

isFamInstTyCon :: TyCon -> Bool #

Is this TyCon that for a data family instance?

isFamFreeTyCon :: TyCon -> Bool #

Is this tycon neither a type family nor a synonym that expands to a type family?

isEnumerationTyCon :: TyCon -> Bool #

Is this an algebraic TyCon which is just an enumeration of values?

isDataTyCon :: TyCon -> Bool #

Returns True for data types that are definitely represented by heap-allocated constructors. These are scrutinised by Core-level case expressions, and they get info tables allocated for them.

Generally, the function will be true for all data types and false for newtypes, unboxed tuples, unboxed sums and type family TyCons. But it is not guaranteed to return True in all cases that it could.

NB: for a data type family, only the instance TyCons get an info table. The family declaration TyCon does not

isDataFamilyTyCon :: TyCon -> Bool #

Is this a synonym TyCon that can have may have further instances appear?

isConstraintKindCon :: TyCon -> Bool #

Returns True for the TyCon of the Constraint kind.

isClosedSynFamilyTyConWithAxiom_maybe :: TyCon -> Maybe (CoAxiom Branched) #

Is this a non-empty closed type family? Returns Nothing for abstract or empty closed families.

isClassTyCon :: TyCon -> Bool #

Is this TyCon that for a class instance?

isBoxedTupleTyCon :: TyCon -> Bool #

Is this the TyCon for a boxed tuple?

isAlgTyCon :: TyCon -> Bool #

Returns True if the supplied TyCon resulted from either a data or newtype declaration

isAbstractTyCon :: TyCon -> Bool #

Test if the TyCon is algebraic but abstract (invisible data constructors)

famTyConFlav_maybe :: TyCon -> Maybe FamTyConFlav #

Extract the flavour of a type family (with all the extra information that it carries)

expandSynTyCon_maybe #

Arguments

:: TyCon 
-> [tyco]

Arguments to TyCon

-> Maybe ([(TyVar, tyco)], Type, [tyco])

Returns a TyVar substitution, the body type of the synonym (not yet substituted) and any arguments remaining from the application ^ Expand a type synonym application Return Nothing if the TyCon is not a synonym, or if not enough arguments are supplied

algTyConRhs :: TyCon -> AlgTyConRhs #

Extract an AlgTyConRhs with information about data constructors from an algebraic or tuple TyCon. Panics for any other sort of TyCon

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

Constructors

BuiltInSynFamily 

Fields

mkInstTyTcOcc #

Arguments

:: String

Family name, e.g. Map

-> OccSet

avoid these Occs

-> OccName
R:Map

Derive a name for the representation type constructor of a data/newtype instance.

tyConAppTyCon_maybe :: Type -> Maybe TyCon #

The same as fst . splitTyConApp

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

mkTyConTy :: TyCon -> Type #

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

data Type #

Constructors

TyVarTy Var

Vanilla type or kind variable (*never* a coercion variable)

AppTy Type Type

Type application to something other than a TyCon. Parameters:

1) Function: must not be a TyConApp or CastTy, must be another AppTy, or TyVarTy See Note [Respecting definitional equality] (EQ1) about the no CastTy requirement

2) Argument type

TyConApp TyCon [KindOrType]

Application of a TyCon, including newtypes and synonyms. Invariant: saturated applications of FunTyCon must use FunTy and saturated synonyms must use their own constructors. However, unsaturated FunTyCons do appear as TyConApps. Parameters:

1) Type constructor being applied to.

2) Type arguments. Might not have enough type arguments here to saturate the constructor. Even type synonyms are not necessarily saturated; for example unsaturated type synonyms can appear as the right hand side of a type synonym.

ForAllTy !TyCoVarBinder Type

A Π type. INVARIANT: If the binder is a coercion variable, it must be mentioned in the Type. See Note [Unused coercion variable in ForAllTy]

FunTy

FUN m t1 t2 Very common, so an important special case See Note [Function types]

LitTy TyLit

Type literals are similar to type constructors.

CastTy Type KindCoercion

A kind cast. The coercion is always nominal. INVARIANT: The cast is never reflexive (EQ2) INVARIANT: The Type is not a CastTy (use TransCo instead) (EQ3) INVARIANT: The Type is not a ForAllTy over a tyvar (EQ4) See Note [Respecting definitional equality]

CoercionTy Coercion

Injection of a Coercion into a type This should only ever be used in the RHS of an AppTy, in the list of a TyConApp, when applying a promoted GADT data constructor

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 #

Eq (DeBruijn Type) 
Instance details

Defined in GHC.Core.Map.Type

data TyLit #

Constructors

NumTyLit Integer 

Instances

Instances details
Data TyLit 
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) -> TyLit -> c TyLit #

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

toConstr :: TyLit -> Constr #

dataTypeOf :: TyLit -> DataType #

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

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

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

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

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

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

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

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

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

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

Outputable TyLit 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

ppr :: TyLit -> SDoc #

Eq TyLit 
Instance details

Defined in GHC.Core.TyCo.Rep

Methods

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

(/=) :: TyLit -> TyLit -> 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 #

mkPrelTyConRepName :: Name -> TyConRepName #

Make a Name for the Typeable representation of the given wired-in type

isUnboxedTupleTyCon :: TyCon -> Bool #

Is this the TyCon for an unboxed tuple?

isTupleTyCon :: TyCon -> Bool #

Does this TyCon represent a tuple?

NB: when compiling Data.Tuple, the tycons won't reply True to isTupleTyCon, because they are built as AlgTyCons. However they get spat into the interface file as tuple tycons, so I don't think it matters.

newtype PackageName #

Constructors

PackageName 

Instances

Instances details
Uniquable PackageName 
Instance details

Defined in GHC.Unit.Info

Outputable PackageName 
Instance details

Defined in GHC.Unit.Info

Methods

ppr :: PackageName -> SDoc #

Eq PackageName 
Instance details

Defined in GHC.Unit.Info

type TyVar = Var #

Type or kind Variable

data IsBootInterface #

Indicates whether a module name is referring to a boot interface (hs-boot file) or regular module (hs file). We need to treat boot modules specially when building compilation graphs, since they break cycles. Regular source files and signature files are treated equivalently.

Constructors

NotBoot 
IsBoot 

Instances

Instances details
Data IsBootInterface 
Instance details

Defined in GHC.Unit.Types

Methods

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

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

toConstr :: IsBootInterface -> Constr #

dataTypeOf :: IsBootInterface -> DataType #

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

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

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

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

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

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

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

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

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

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

Show IsBootInterface 
Instance details

Defined in GHC.Unit.Types

Binary IsBootInterface 
Instance details

Defined in GHC.Unit.Types

Eq IsBootInterface 
Instance details

Defined in GHC.Unit.Types

Ord IsBootInterface 
Instance details

Defined in GHC.Unit.Types

mkUniqSet :: Uniquable a => [a] -> UniqSet a #

ppr :: Outputable a => a -> SDoc #

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 (SourceText, RuleName) 
Instance details

Defined in GHC.Hs.Decls

type Anno (SourceText, RuleName) 
Instance details

Defined in GHC.Hs.Decls

unpackFS :: FastString -> String #

Unpacks and decodes the FastString

data UnitDatabase unit #

Unit database

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 GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod #

Information about an unit (a unit is an installed module library).

This is a subset of Cabal's InstalledPackageInfo, with just the bits that GHC is interested in.

Some types are left as parameters to be instantiated differently in ghc-pkg and in ghc itself.

Constructors

GenericUnitInfo 

Fields

  • unitId :: uid

    Unique unit identifier that is used during compilation (e.g. to generate symbols).

  • unitInstanceOf :: compid

    Identifier of an indefinite unit (i.e. with module holes) that this unit is an instance of.

  • unitInstantiations :: [(modulename, mod)]

    How this unit instantiates some of its module holes. Map hole module names to actual module

  • unitPackageId :: srcpkgid

    Source package identifier.

    Cabal instantiates this with Distribution.Types.PackageId.PackageId type which only contains the source package name and version. Notice that it doesn't contain the Hackage revision, nor any kind of hash.

  • unitPackageName :: srcpkgname

    Source package name

  • unitPackageVersion :: Version

    Source package version

  • unitComponentName :: Maybe srcpkgname

    Name of the component.

    Cabal supports more than one components (libraries, executables, testsuites) in the same package. Each component has a name except the default one (that can only be a library component) for which we use Nothing.

    GHC only deals with "library" components as they are the only kind of components that can be registered in a database and used by other modules.

  • unitAbiHash :: ShortText

    ABI hash used to avoid mixing up units compiled with different dependencies, compiler, options, etc.

  • unitDepends :: [uid]

    Identifiers of the units this one depends on

  • unitAbiDepends :: [(uid, ShortText)]

    Like unitDepends, but each dependency is annotated with the ABI hash we expect the dependency to respect.

  • unitImportDirs :: [FilePathST]

    Directories containing module interfaces

  • unitLibraries :: [ShortText]

    Names of the Haskell libraries provided by this unit

  • unitExtDepLibsSys :: [ShortText]

    Names of the external system libraries that this unit depends on. See also unitExtDepLibsGhc field.

  • unitExtDepLibsGhc :: [ShortText]

    Because of slight differences between the GHC dynamic linker (in GHC.Runtime.Linker) and the native system linker, some packages have to link with a different list of libraries when using GHC's. Examples include: libs that are actually gnu ld scripts, and the possibility that the .a libs do not exactly match the .so/.dll equivalents.

    If this field is set, then we use that instead of the unitExtDepLibsSys field.

  • unitLibraryDirs :: [FilePathST]

    Directories containing libraries provided by this unit. See also unitLibraryDynDirs.

    It seems to be used to store paths to external library dependencies too.

  • unitLibraryDynDirs :: [FilePathST]

    Directories containing the dynamic libraries provided by this unit. See also unitLibraryDirs.

    It seems to be used to store paths to external dynamic library dependencies too.

  • unitExtDepFrameworks :: [ShortText]

    Names of the external MacOS frameworks that this unit depends on.

  • unitExtDepFrameworkDirs :: [FilePathST]

    Directories containing MacOS frameworks that this unit depends on.

  • unitLinkerOptions :: [ShortText]

    Linker (e.g. ld) command line options

  • unitCcOptions :: [ShortText]

    C compiler options that needs to be passed to the C compiler when we compile some C code against this unit.

  • unitIncludes :: [ShortText]

    C header files that are required by this unit (provided by this unit or external)

  • unitIncludeDirs :: [FilePathST]

    Directories containing C header files that this unit depends on.

  • unitHaddockInterfaces :: [FilePathST]

    Paths to Haddock interface files for this unit

  • unitHaddockHTMLs :: [FilePathST]

    Paths to Haddock directories containing HTML files

  • unitExposedModules :: [(modulename, Maybe mod)]

    Modules exposed by the unit.

    A module can be re-exported from another package. In this case, we indicate the module origin in the second parameter.

  • unitHiddenModules :: [modulename]

    Hidden modules.

    These are useful for error reporting (e.g. if a hidden module is imported)

  • unitIsIndefinite :: Bool

    True if this unit has some module holes that need to be instantiated with real modules to make the unit usable (a.k.a. Backpack).

  • unitIsExposed :: Bool

    True if the unit is exposed. A unit could be installed in a database by "disabled" by not being exposed.

  • unitIsTrusted :: Bool

    True if the unit is trusted (cf Safe Haskell)

Instances

Instances details
Binary DbUnitInfo 
Instance details

Defined in GHC.Unit.Database

(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid, Show srcpkgname) => Show (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod) 
Instance details

Defined in GHC.Unit.Database

Methods

showsPrec :: Int -> GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> ShowS #

show :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> String #

showList :: [GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod] -> ShowS #

(Eq uid, Eq compid, Eq modulename, Eq mod, Eq srcpkgid, Eq srcpkgname) => Eq (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod) 
Instance details

Defined in GHC.Unit.Database

Methods

(==) :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> Bool #

(/=) :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> Bool #

tracePlugin :: String -> TcPlugin -> TcPlugin #

Print out extra information about the initialisation, stop, and every run of the plugin when -ddump-tc-trace is enabled.

lookupModule #

Arguments

:: ModuleName

Name of the module

-> FastString

Name of the package containing the module. NOTE: This value is ignored on ghc>=8.0.

-> TcPluginM Module 

Find a module

evByFiat #

Arguments

:: String

Name the coercion should have

-> Type

The LHS of the equivalence relation (~)

-> Type

The RHS of the equivalence relation (~)

-> EvTerm 

The EvTerm equivalent for unsafeCoerce

newtype TypeEq Source #

Constructors

TypeEq 

Fields

Instances

Instances details
Eq TypeEq Source # 
Instance details

Defined in GHC.TypeLits.Presburger.Compat

Methods

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

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

Ord TypeEq Source # 
Instance details

Defined in GHC.TypeLits.Presburger.Compat

data TvSubst Source #

Instances

Instances details
Outputable TvSubst Source # 
Instance details

Defined in GHC.TypeLits.Presburger.Compat

Methods

ppr :: TvSubst -> SDoc #