hermit- Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellNone




GHC Imports

Things that have been copied from GHC, or imported directly, for various reasons.

module GhcPlugins

ppIdInfo :: Id -> IdInfo -> SDocSource

Pretty-print an identifier.

zapVarOccInfo :: Var -> VarSource

Erase all OccInfo in a variable if it is is an Id, or do nothing if it's a TyVar or CoVar (which have no OccInfo).

var2String :: Var -> StringSource

Convert a variable to a neat string for printing (unqualfied name).

name2THName :: Name -> NameSource

Converts a GHC Name to a Template Haskell Name, going via a String.

var2THName :: Var -> NameSource

Converts an Var to a Template Haskell Name, going via a String.

cmpTHName2Name :: Name -> Name -> BoolSource

Compare a Name to a Name for equality. See cmpString2Name.

cmpString2Name :: String -> Name -> BoolSource

Compare a String to a Name for equality. Strings containing a period are assumed to be fully qualified names.

cmpTHName2Var :: Name -> Var -> BoolSource

Compare a Name to a Var for equality. See cmpString2Name.

cmpString2Var :: String -> Var -> BoolSource

Compare a String to a Var for equality. See cmpString2Name.

fqName :: Name -> StringSource

Get the fully qualified name from a Name.

uqName :: NamedThing nm => nm -> StringSource

Get the unqualified name from a NamedThing.

findNamesFromString :: GlobalRdrEnv -> String -> [Name]Source

Find Names matching a given fully qualified or unqualified name. If given name is fully qualified, will only return first result, which is assumed unique.

data Type

The key representation of types within the compiler


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, must be another AppTy, or TyVarTy

2) Argument type

TyConApp TyCon [KindOrType]

Application of a TyCon, including newtypes and synonyms. Invariant: saturated appliations 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.

FunTy Type Type

Special case of TyConApp: TyConApp FunTyCon [t1, t2] See Note [Equality-constrained types]

ForAllTy Var Type

A polymorphic type

LitTy TyLit

Type literals are simillar to type constructors.

data GhcException

GHC's own exception type error messages all take the form:

      location: error

If the location is on the command line, or in GHC itself, then location=ghc. All of the error types below correspond to a location of ghc, except for ProgramError (where the string is assumed to contain a location already, so we don't print one).


ProgramError String

An error in the user's code, probably.

exprArity :: CoreExpr -> Arity

An approximate, fast, version of exprEtaExpandArity

isKind :: Kind -> Bool

Is this a kind (i.e. a type-of-types)?

exprType :: CoreExpr -> TypeSource

Recover the type of a well-typed Core expression. Fails when applied to the actual Type expression as it cannot really be said to have a type

notElemVarSet :: Var -> VarSet -> BoolSource

Determine if a Var is not an element of a VarSet.

varSetToStrings :: VarSet -> [String]Source

Convert a VarSet to a list of user-readable strings.

showVarSet :: VarSet -> StringSource

Show a human-readable version of a VarSet.

data Pair a




pFst :: a
pSnd :: a

liftIO :: MonadIO m => forall a. IO a -> m a