[commit: ghc] ghc-7.4: Document the Num superclass divergence from H98/H2010 (0877e14)
Ian Lynagh
igloo at earth.li
Sat Jan 14 22:10:44 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-7.4
http://hackage.haskell.org/trac/ghc/changeset/0877e14e3b4accd706c80b5087f1b8e5a08bec59
>---------------------------------------------------------------
commit 0877e14e3b4accd706c80b5087f1b8e5a08bec59
Author: Ian Lynagh <igloo at earth.li>
Date: Sat Jan 14 13:40:58 2012 +0000
Document the Num superclass divergence from H98/H2010
>---------------------------------------------------------------
docs/users_guide/bugs.xml | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/docs/users_guide/bugs.xml b/docs/users_guide/bugs.xml
index 12ef946..9da7927 100644
--- a/docs/users_guide/bugs.xml
+++ b/docs/users_guide/bugs.xml
@@ -150,6 +150,39 @@ main = do args <- getArgs
<variablelist>
<varlistentry>
+ <term>Num superclasses</term>
+ <listitem>
+ <para>
+ The <literal>Num</literal> class does not have
+ <literal>Show</literal> or <literal>Eq</literal>
+ superclasses.
+ </para>
+
+ <para>
+ You can make code that works with both
+ Haskell98/Haskell2010 and GHC by:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Whenever you make a <literal>Num</literal> instance
+ of a type, also make <literal>Show</literal> and
+ <literal>Eq</literal> instances, and
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Whenever you give a function, instance or class a
+ <literal>Num t</literal> constraint, also give it
+ <literal>Show t</literal> and
+ <literal>Eq t</literal> constraints.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>Multiply-defined array elements—not checked:</term>
<listitem>
<para>This code fragment should
More information about the Cvs-ghc
mailing list