[commit: ghc] master: Document more stolen syntax (#4196) (da11bb1)

git at git.haskell.org git at git.haskell.org
Sat Sep 21 08:24:56 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/da11bb138c7a1b4f056fb90ce026f11b18b5ca2c/ghc

>---------------------------------------------------------------

commit da11bb138c7a1b4f056fb90ce026f11b18b5ca2c
Author: Krzysztof Gogolewski <krz.gogolewski at gmail.com>
Date:   Sat Sep 21 08:24:11 2013 +0200

    Document more stolen syntax (#4196)


>---------------------------------------------------------------

da11bb138c7a1b4f056fb90ce026f11b18b5ca2c
 docs/users_guide/glasgow_exts.xml |   27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index eb8e4d9..a8057a6 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -423,7 +423,11 @@ Indeed, the bindings can even be recursive.
 	import <literal>GHC.Prim</literal> (see <xref linkend="primitives"/>);
 	the <option>-XMagicHash</option> extension
 	then allows you to <emphasis>refer</emphasis> to the <literal>Int&num;</literal>
-	that is now in scope.</para>
+	that is now in scope. Note that with this option, the meaning of <literal>x&num;y = 0</literal>
+	is changed: it defines a function <literal>x&num;</literal> taking a single argument <literal>y</literal>;
+        to define the operator <literal>&num;</literal>, put a space: <literal>x &num; y = 0</literal>.
+
+</para>
       <para> The <option>-XMagicHash</option> also enables some new forms of literals (see <xref linkend="glasgow-unboxed"/>):
 	<itemizedlist>
 	  <listitem><para> <literal>'x'&num;</literal> has type <literal>Char&num;</literal></para> </listitem>
@@ -2268,13 +2272,30 @@ The following syntax is stolen:
 	      <replaceable>string</replaceable><literal>&num;</literal>,
 	      <replaceable>integer</replaceable><literal>&num;</literal>,
 	      <replaceable>float</replaceable><literal>&num;</literal>,
-	      <replaceable>float</replaceable><literal>&num;&num;</literal>,
-	      <literal>(&num;</literal>, <literal>&num;)</literal>
+	      <replaceable>float</replaceable><literal>&num;&num;</literal>
 	</term>
 	<listitem><para>
 	Stolen by: <option>-XMagicHash</option>
 	  </para></listitem>
       </varlistentry>
+
+      <varlistentry>
+	<term>
+	      <literal>(&num;</literal>, <literal>&num;)</literal>
+	</term>
+	<listitem><para>
+	Stolen by: <option>-XUnboxedTuples</option>
+	  </para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term>
+	      <replaceable>varid</replaceable><literal>!</literal><replaceable>varid</replaceable>
+	</term>
+	<listitem><para>
+	Stolen by: <option>-XBangPatterns</option>
+	  </para></listitem>
+      </varlistentry>
     </variablelist>
 </para>
 </sect2>




More information about the ghc-commits mailing list