summaryrefslogtreecommitdiff
path: root/docs/users_guide/bugs.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/users_guide/bugs.rst')
-rw-r--r--docs/users_guide/bugs.rst12
1 files changed, 11 insertions, 1 deletions
diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst
index 5b710aa35d..5d303636f4 100644
--- a/docs/users_guide/bugs.rst
+++ b/docs/users_guide/bugs.rst
@@ -152,7 +152,7 @@ Numbers, basic types, and built-in classes
``Num`` superclasses
The ``Num`` class does not have ``Show`` or ``Eq`` superclasses.
-
+
You can make code that works with both Haskell98/Haskell2010 and GHC
by:
@@ -178,6 +178,16 @@ Numbers, basic types, and built-in classes
- Always define the ``bit``, ``testBit`` and ``popCount`` methods
in ``Bits`` instances.
+``Read`` class methods
+ The ``Read`` class has two extra methods, ``readPrec`` and
+ ``readListPrec``, that are not found in the Haskell 2010 since they rely
+ on the ``ReadPrec`` data type, which requires the :ghc-flag:`-XRankNTypes`
+ extension. GHC also derives ``Read`` instances by implementing ``readPrec``
+ instead of ``readsPrec``, and relies on a default implementation of
+ ``readsPrec`` that is defined in terms of ``readPrec``. GHC adds these two
+ extra methods simply because ``ReadPrec`` is more efficient than ``ReadS``
+ (the type on which ``readsPrec`` is based).
+
Extra instances
The following extra instances are defined: ::