ghc-9.6.4: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Core.TyCo.Tidy

Description

Tidying types and coercions for printing in error messages.

Synopsis

Tidying type related things up for printing

tidyType :: TidyEnv -> Type -> Type Source #

Tidy a Type

See Note [Strictness in tidyType and friends]

tidyTypes :: TidyEnv -> [Type] -> [Type] Source #

Tidy a list of Types

See Note [Strictness in tidyType and friends]

tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type]) Source #

Grabs the free type variables, tidies them and then uses tidyType to work over the type itself

tidyVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar]) Source #

This tidies up a type for printing in an error message, or in an interface file.

It doesn't change the uniques at all, just the print names.

tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv Source #

Add the free TyVars to the env in tidy form, so that we can tidy the type they are free in

tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar) Source #

Treat a new TyCoVar as a binder, and give it a fresh tidy name using the environment if one has not already been allocated. See also tidyVarBndr

tidyTopType :: Type -> Type Source #

Calls tidyType on a top-level type (i.e. with an empty tidying environment)

tidyCo :: TidyEnv -> Coercion -> Coercion Source #

Tidy a Coercion

See Note [Strictness in tidyType and friends]