Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
39291ddb
Commit
39291ddb
authored
Jan 14, 2012
by
Ian Lynagh
Browse files
Document the Bits superclass divergence from Haskell 2010
parent
57b1d54a
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/bugs.xml
View file @
39291ddb
...
...
@@ -182,6 +182,49 @@ main = do args <- getArgs
</listitem>
</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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment