diff options
author | Pavol Vargovcik <pavol.vargovcik@gmail.com> | 2022-05-16 10:04:28 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-16 15:34:04 -0400 |
commit | 8dfea0789957278b99bf302dfb24078fff84b6d2 (patch) | |
tree | 1cc568b4d0d8e0c8d00466af7337ac462d59a7f4 /docs | |
parent | 43c018aaaf15ccce215958b7e09b1e29ee7b6d40 (diff) | |
download | haskell-8dfea0789957278b99bf302dfb24078fff84b6d2.tar.gz |
TcPlugin: access to irreducible givens + fix passed ev_binds_var
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/extending_ghc.rst | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index 1cec248364..998ddeeec0 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -577,12 +577,12 @@ is defined thus: data TcPlugin = forall s . TcPlugin { tcPluginInit :: TcPluginM s - , tcPluginSolve :: s -> EvBindsVar -> TcPluginSolver + , tcPluginSolve :: s -> TcPluginSolver , tcPluginRewrite :: s -> UniqFM TyCon TcPluginRewriter , tcPluginStop :: s -> TcPluginM () } - type TcPluginSolver = [Ct] -> [Ct] -> [Ct] -> TcPluginM TcPluginSolveResult + type TcPluginSolver = EvBindsVar -> [Ct] -> [Ct] -> [Ct] -> TcPluginM TcPluginSolveResult type TcPluginRewriter = RewriteEnv -> [Ct] -> [Type] -> TcPluginM TcPluginRewriteResult @@ -652,8 +652,8 @@ The key component of a typechecker plugin is a function of type :: - solve :: [Ct] -> [Ct] -> TcPluginM TcPluginSolveResult - solve givens wanteds = ... + solve :: EvBindsVar -> [Ct] -> [Ct] -> TcPluginM TcPluginSolveResult + solve binds givens wanteds = ... This function will be invoked in two different ways: @@ -701,6 +701,11 @@ the plugin to create equality axioms for use in evidence terms, but GHC does not check their consistency, and inconsistent axiom sets may lead to segfaults or other runtime misbehaviour. +Evidence is required also when creating new Given constraints, which are +usually implied by old ones. It is not uncommon that the evidence of a new +Given constraint contains a removed constraint: the new one has replaced the +removed one. + .. _type-family-rewriting-with-plugins: Type family rewriting with plugins |