HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-tcplugin-api-0.20.1.0Haskell2010

GHC.TcPlugin.API.TyConSubst

This module provides functionality for recognising whether a type is a TyConApp while taking into account Given nominal equalities.

In particular, this allows dealing with flattening variables on older GHC versions (9.0 and below). For example, instead of [W] m + n ~ n + m, older GHCs might produce [G] u ~ m + n, [G] v ~ n + m, [W] u ~ v. In this case, one needs to use the Givens to recognise that u ~ v can be solved using the laws of natural number arithmetic.

Usage:

Notes:

  • splitTyConApp_upTo will also look through type synonyms,

  • splitTyConApp_upTo only takes into account nominal equalities. Please open a ticket if you have a need for rewriting modulo representational equalities.

  • 1 type
  • 2 values
datadata TyConSubst
#

Substitution for recognizing TyCon applications modulo nominal equalities.

Instances1Outputable