Commit b3d55e20 authored by Ryan Scott's avatar Ryan Scott

Document Safe Haskell restrictions on Generic instances

Commit 578fbeca disallowed hand-written
`Generic` instances in Safe Haskell, but this wasn't documented anywhere.
parent 28a00eaf
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment