Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/39291ddba48be9504985a40eeabe94eaf6dab85d >--------------------------------------------------------------- commit 39291ddba48be9504985a40eeabe94eaf6dab85d Author: Ian Lynagh <[email protected]> Date: Sat Jan 14 13:54:51 2012 +0000 Document the Bits superclass divergence from Haskell 2010 >--------------------------------------------------------------- docs/users_guide/bugs.xml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/docs/users_guide/bugs.xml b/docs/users_guide/bugs.xml index 9da7927..d52391c 100644 --- a/docs/users_guide/bugs.xml +++ b/docs/users_guide/bugs.xml @@ -183,6 +183,49 @@ main = do args <- getArgs </varlistentry> <varlistentry> + <term>Bits superclasses</term> + <listitem> + <para> + The <literal>Bits</literal> class does not have + a <literal>Num</literal> superclasses. It therefore + does not have default methods for the + <literal>bit</literal>, + <literal>testBit</literal> and + <literal>popCount</literal> methods. + </para> + + <para> + You can make code that works with both + Haskell2010 and GHC by: + <itemizedlist> + <listitem> + <para> + Whenever you make a <literal>Bits</literal> instance + of a type, also make a <literal>Num</literal> + instance, and + </para> + </listitem> + <listitem> + <para> + Whenever you give a function, instance or class a + <literal>Bits t</literal> constraint, also give it + a <literal>Num t</literal> constraint, and + </para> + </listitem> + <listitem> + <para> + Always define the <literal>bit</literal>, + <literal>testBit</literal> and + <literal>popCount</literal> methods in + <literal>Bits</literal> instances. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> + + <varlistentry> <term>Multiply-defined array elements—not checked:</term> <listitem> <para>This code fragment should _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
