Commit 32c4b4b2 authored by simonpj's avatar simonpj
Browse files

[project @ 2003-12-16 16:18:08 by simonpj]

Clarify newtype deriving documentation
parent daacf054
......@@ -1597,9 +1597,9 @@ declarations
instance context2 => C type2 where ...
"overlap" if <literal>type1</literal> and <literal>type2</literal> unify.
"overlap" if <literal>type1</literal> and <literal>type2</literal> unify
However, if you give the command line option
option</primary></indexterm> then overlapping instance declarations are permitted.
......@@ -3105,17 +3105,24 @@ where
<literal>S</literal> is a type constructor,
<literal></literal> are types,
The <literal></literal> are types,
<literal></literal> are type variables which do not occur in any of
The <literal></literal> are type variables which do not occur in any of
the <literal>ti</literal>, and
the <literal>ci</literal> are partial applications of
The <literal>ci</literal> are partial applications of
classes of the form <literal>C t1''</literal>, where the arity of <literal>C</literal>
is exactly <literal>j+1</literal>. That is, <literal>C</literal> lacks exactly one type argument.
None of the <literal>ci</literal> is <literal>Read</literal>, <literal>Show</literal>,
<literal>Typeable</literal>, or <literal>Data</literal>. These classes
should not "look through" the type or its constructor. You can still
derive these classes for a newtype, but it happens in the usual way, not
via this new mechanism.
Then, for each <literal>ci</literal>, the derived instance
declaration is:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment