summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2022-04-25 10:51:47 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-27 10:08:40 -0400
commit7f618fd308b8db016009254aa8bbeb935d9d30e6 (patch)
tree7bee434ce6c464a3b401fcbbca802cffddc95238 /docs
parentc3105be4bbfeb5005d8c585b5a3f91a4c3ee5b4b (diff)
downloadhaskell-7f618fd308b8db016009254aa8bbeb935d9d30e6.tar.gz
Update docs for change to type-checking plugins
There was no mention of the changes to type-checking plugins in the 9.4.1 notes, and the extending_ghc documentation contained a reference to an outdated type.
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/9.4.1-notes.rst11
-rw-r--r--docs/users_guide/extending_ghc.rst4
2 files changed, 13 insertions, 2 deletions
diff --git a/docs/users_guide/9.4.1-notes.rst b/docs/users_guide/9.4.1-notes.rst
index 345badec57..42791d7153 100644
--- a/docs/users_guide/9.4.1-notes.rst
+++ b/docs/users_guide/9.4.1-notes.rst
@@ -72,6 +72,17 @@ Compiler
- New :ghc-flag:`-fprof-late` that adds automatic CCS annotations to all
top level functions *after* core optimisation have been run.
+- Typechecking plugins now support type-family rewriting. The ``TcPlugin``
+ datatype now contains an extra field, ``tcPluginRewrite``, which allows
+ typechecking plugin authors to specify which type families should be
+ rewritten by the plugin, returning for each type family application a
+ ``TcPluginRewriteResult``.
+ In addition, typechecking plugins now have the ability to emit new constraints
+ at the same time as contradictions. To account for these changes, the
+ ``TcPluginResult`` datatype has been renamed to ``TcPluginSolveResult``,
+ which bundles pattern synonyms ``TcPluginOk`` and ``TcPluginContradiction``
+ to recover the old interface.
+
- A new type of plugin: defaulting plugins. These plugins can propose
defaults for ambiguous variables that would otherwise cause errors
just like the built-in defaulting mechanism.
diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst
index a265a8323e..c12abc2b4c 100644
--- a/docs/users_guide/extending_ghc.rst
+++ b/docs/users_guide/extending_ghc.rst
@@ -582,7 +582,7 @@ is defined thus:
, tcPluginStop :: s -> TcPluginM ()
}
- type TcPluginSolver = [Ct] -> [Ct] -> [Ct] -> TcPluginM TcPluginResult
+ type TcPluginSolver = [Ct] -> [Ct] -> [Ct] -> TcPluginM TcPluginSolveResult
type TcPluginRewriter = RewriteEnv -> [Ct] -> [Type] -> TcPluginM TcPluginRewriteResult
@@ -615,7 +615,7 @@ The basic idea is as follows:
- During constraint solving, GHC repeatedly calls ``tcPluginSolve``.
This function is provided with the current set of constraints, and
- should return a ``TcPluginResult`` that indicates whether a
+ should return a ``TcPluginSolveResult`` that indicates whether a
contradiction was found or progress was made. If the plugin solver
makes progress, GHC will re-start the constraint solving pipeline,
looping until a fixed point is reached.