[project @ 2001-08-27 11:45:23 by simonmar]
[ghc-hetmet.git] / ghc / docs / users_guide / glasgow_exts.sgml
index abe513a..5c80925 100644 (file)
@@ -142,6 +142,9 @@ Executive summary of our extensions:
     <varlistentry>
       <term>Generic classes:</term>
       <listitem>
+       <para>(Note: support for generic classes is currently broken
+        in GHC 5.02).</para>
+
        <para>Generic class declarations allow you to define a class
         whose methods say how to work over an arbitrary data type.
         Then it's really easy to make any new type into an instance of
@@ -3008,14 +3011,14 @@ The following are good producers:
  <function>++</function>
 </para>
 </listitem>
-<listitem>
 
+<listitem>
 <para>
  <function>map</function>
 </para>
 </listitem>
-<listitem>
 
+<listitem>
 <para>
  <function>filter</function>
 </para>
@@ -3065,8 +3068,14 @@ The following are good consumers:
  <function>++</function> (on its first argument)
 </para>
 </listitem>
+
 <listitem>
+<para>
+ <function>foldr</function>
+</para>
+</listitem>
 
+<listitem>
 <para>
  <function>map</function>
 </para>
@@ -3260,6 +3269,9 @@ program even if fusion doesn't happen.  More rules in <filename>PrelList.lhs</fi
 <sect1 id="generic-classes">
 <title>Generic classes</title>
 
+    <para>(Note: support for generic classes is currently broken in
+    GHC 5.02).</para>
+
 <para>
 The ideas behind this extension are described in detail in "Derivable type classes",
 Ralf Hinze and Simon Peyton Jones, Haskell Workshop, Montreal Sept 2000, pp94-105.
@@ -3415,10 +3427,10 @@ So this too is illegal:
 <programlisting>
   class Foo a where
     op1 :: a -> Bool
-    op {| a :*: b |} (Inl x) = True
+    op1 {| a :*: b |} (x :*: y) = True
 
     op2 :: a -> Bool
-    op {| p :*: q |} (Inr y) = False
+    op2 {| p :*: q |} (x :*: y) = False
 </programlisting>
 (The reason for this restriction is that we gather all the equations for a particular type consructor
 into a single generic instance declaration.)