summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMicha Wiedenmann <mw-r1@posteo.de>2019-09-23 05:07:49 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-12-10 19:52:44 -0500
commite3bba7e4b221139090edf54a18c7e0e1ec3f9be8 (patch)
treece064abd2796d83b14a0807cb68c48efb245b462 /docs
parentd46a72e19e1b508358827e7270139f3273915697 (diff)
downloadhaskell-e3bba7e4b221139090edf54a18c7e0e1ec3f9be8.tar.gz
users guide: Motivation of DefaultSignatures
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/glasgow_exts.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 7ba170845a..5034d012a1 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -6139,11 +6139,14 @@ a class: ::
enum = []
The type of the ``enum`` method is ``[a]``, and this is also the type of
-the default method. You can lift this restriction and give another type
-to the default method using the extension :extension:`DefaultSignatures`. For
-instance, if you have written a generic implementation of enumeration in
-a class ``GEnum`` with method ``genum`` in terms of ``GHC.Generics``,
-you can specify a default method that uses that generic implementation: ::
+the default method. You can change the type of the default method by
+requiring a different context using the extension
+:extension:`DefaultSignatures`. For instance, if you have written a
+generic implementation of enumeration in a class ``GEnum`` with method
+``genum``, you can specify a default method that uses that generic
+implementation. But your default implementation can only be used if the
+constraints are satisfied, therefore you need to change the type of the
+default method ::
class Enum a where
enum :: [a]