summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/safe_haskell.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/users_guide/safe_haskell.rst b/docs/users_guide/safe_haskell.rst
index 3914820ebe..6ce8b8fc26 100644
--- a/docs/users_guide/safe_haskell.rst
+++ b/docs/users_guide/safe_haskell.rst
@@ -278,6 +278,15 @@ Furthermore, we restrict the following features:
between types. Derived instances (through the :ghc-flag:`-XDeriveDataTypeable`
extension) are still allowed.
+- ``GHC.Generics`` — Hand crafted instances of the ``Generic`` type class are
+ not allowed in Safe Haskell. Such instances aren't strictly unsafe, but
+ there is an important invariant that a ``Generic`` instance should adhere to
+ the structure of the data type for which the instance is defined, and
+ allowing manually implemented ``Generic`` instances would break that
+ invariant. Derived instances (through the :ghc-flag:`-XDeriveGeneric`
+ extension) are still allowed. Refer to the
+ :ref:`generic programming <generic-programming>` section for more details.
+
.. _safe-overlapping-instances:
Safe Overlapping Instances