diff options
author | Sasha Bogicevic <sasa.bogicevic@pm.me> | 2021-04-27 18:23:08 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-27 21:59:08 -0400 |
commit | d2399a46a01a6e46c831c19e797e656a0b8ca16d (patch) | |
tree | a50089ba5838085d36f37e1a3ecf781de2cab557 /docs | |
parent | 9ead1b35e193b07e82af289cc85ab4b26cf89df6 (diff) | |
download | haskell-d2399a46a01a6e46c831c19e797e656a0b8ca16d.tar.gz |
19079 DerivingVia: incorrectly accepts deriving via types with differing runtime representations
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/exts/deriving_via.rst | 8 |
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) |