TyCoTidy

ghc-8.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

TyCoTidy

Contents

- Tidying type related things up for printing

Description

Tidying types and coercions for printing in error messages.

Synopsis

- tidyType :: TidyEnv -> Type -> Type
- tidyTypes :: TidyEnv -> [Type] -> [Type]
- tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type)
- tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type])
- tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind)
- tidyVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
- avoidNameClashes :: [TyCoVar] -> TidyEnv -> TidyEnv
- tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tidyTyCoVarOcc :: TidyEnv -> TyCoVar -> TyCoVar
- tidyTopType :: Type -> Type
- tidyKind :: TidyEnv -> Kind -> Kind
- tidyCo :: TidyEnv -> Coercion -> Coercion
- tidyCos :: TidyEnv -> [Coercion] -> [Coercion]
- tidyTyCoVarBinder :: TidyEnv -> VarBndr TyCoVar vis -> (TidyEnv, VarBndr TyCoVar vis)
- tidyTyCoVarBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis])

# Tidying type related things up for printing

tidyType :: TidyEnv -> Type -> Type #

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

tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type) #

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

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

tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind) #

tidyVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar) #

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

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 #

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

avoidNameClashes :: [TyCoVar] -> TidyEnv -> TidyEnv #

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

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`

tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar]) #

tidyTyCoVarOcc :: TidyEnv -> TyCoVar -> TyCoVar #

tidyTopType :: Type -> Type #

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

tidyKind :: TidyEnv -> Kind -> Kind #

tidyCo :: TidyEnv -> Coercion -> Coercion #

tidyCos :: TidyEnv -> [Coercion] -> [Coercion] #

tidyTyCoVarBinder :: TidyEnv -> VarBndr TyCoVar vis -> (TidyEnv, VarBndr TyCoVar vis) #

tidyTyCoVarBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis]) #