Tidy a Type
See Note [Strictness in tidyType and friends]
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10
Moduleghc-lib-parser-9.14.1.20251220GHC2021
Tidying types and coercions for printing in error messages.
Tidy a Type
See Note [Strictness in tidyType and friends]
Tidy a list of Types
See Note [Strictness in tidyType and friends]
Tidy a Coercion
See Note [Strictness in tidyType and friends]
Calls tidyType on a top-level type (i.e. with an empty tidying environment)
Grabs the free type variables, tidies them and then uses tidyType to work over the type itself
Add the free TyVars to the env in tidy form, so that we can tidy the type they are free in Precondition: input free vars are closed over kinds and This function does a scopedSort, so that tidied variables have tidied kinds. See Note [Tidying is idempotent]
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 See Note [Tidying is idempotent]
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.