summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Bogicevic <sasa.bogicevic@pm.me>2021-04-27 18:23:08 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-04-27 21:59:08 -0400
commitd2399a46a01a6e46c831c19e797e656a0b8ca16d (patch)
treea50089ba5838085d36f37e1a3ecf781de2cab557
parent9ead1b35e193b07e82af289cc85ab4b26cf89df6 (diff)
downloadhaskell-d2399a46a01a6e46c831c19e797e656a0b8ca16d.tar.gz
19079 DerivingVia: incorrectly accepts deriving via types with differing runtime representations
-rw-r--r--docs/users_guide/exts/deriving_via.rst8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/users_guide/exts/deriving_via.rst b/docs/users_guide/exts/deriving_via.rst
index cc590987ea..26ff719780 100644
--- a/docs/users_guide/exts/deriving_via.rst
+++ b/docs/users_guide/exts/deriving_via.rst
@@ -13,9 +13,11 @@ Deriving via
:since: 8.6.1
This allows ``deriving`` a class instance for a type by specifying
-another type of equal runtime representation (such that there exists a
-``Coercible`` instance between the two: see :ref:`coercible`) that is
-already an instance of the that class.
+another type that is already an instance of that class.
+This only makes sense if the methods have identical runtime representations,
+in the sense that coerce (see The ``Coercible`` constraint) can convert
+the existing implementation into the desired implementation.
+The generated code will be rejected with a type error otherwise.
:extension:`DerivingVia` is indicated by the use of the ``via``
deriving strategy. ``via`` requires specifying another type (the ``via`` type)