[project @ 2002-12-04 12:06:28 by simonmar]
authorsimonmar <unknown>
Wed, 4 Dec 2002 12:06:28 +0000 (12:06 +0000)
committersimonmar <unknown>
Wed, 4 Dec 2002 12:06:28 +0000 (12:06 +0000)
Fix SPECIALISE documentation to not mention outdated syntax, and fix
the RULES syntax in one place

ghc/docs/users_guide/glasgow_exts.sgml

index 4cdc3cb..6b3bd13 100644 (file)
@@ -3604,11 +3604,14 @@ hammeredLookup :: Ord key => [(key, value)] -> key -> value
 {-# SPECIALIZE hammeredLookup :: [(Widget, value)] -> Widget -> value #-}
 </programlisting>
 
+      <para>A <literal>SPECIALIZE</literal> pragma for a function can
+      be put anywhere its type signature could be put.</para>
+
       <para>To get very fancy, you can also specify a named function
       to use for the specialised value, as in:</para>
 
 <programlisting>
-{-# RULES hammeredLookup = blah #-}
+{-# RULES "hammeredLookup" hammeredLookup = blah #-}
 </programlisting>
 
       <para>where <literal>blah</literal> is an implementation of
@@ -3631,7 +3634,7 @@ hammeredLookup :: Ord key => [(key, value)] -> key -> value
 toDouble :: Real a => a -> Double
 toDouble = fromRational . toRational
 
-{-# SPECIALIZE toDouble :: Int -> Double = i2d #-}
+{-# RULES "toDouble/Int" toDouble = i2d #-}
 i2d (I# i) = D# (int2Double# i) -- uses Glasgow prim-op directly
 </programlisting>
 
@@ -3640,9 +3643,6 @@ i2d (I# i) = D# (int2Double# i) -- uses Glasgow prim-op directly
       <literal>Rational</literal>&mdash;is obscenely expensive by
       comparison.</para>
 
-      <para>A <literal>SPECIALIZE</literal> pragma for a function can
-      be put anywhere its type signature could be put.</para>
-
     </sect2>
 
 <sect2 id="specialize-instance-pragma">