summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-06-22 13:32:03 +0100
committerIan Lynagh <ian@well-typed.com>2013-06-22 13:32:03 +0100
commit451e0dd875274aeb492a681bcdf944ab6deac39f (patch)
tree691ccde6640ce80d491e120a1f0513444c4ef831
parent96ca465d7516e47f4ca46f3e91765c3e8411c8f3 (diff)
downloadhaskell-451e0dd875274aeb492a681bcdf944ab6deac39f.tar.gz
Fix syntax in some code in the user guide; fixes #8007
-rw-r--r--docs/users_guide/glasgow_exts.xml8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 710efbb1ec..b3985978be 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -922,14 +922,14 @@ As you can guess <literal>justOnes</literal> will evaluate to <literal>Just [-1,
to the underlying monadic value-recursion operator <literal>mfix</literal>, belonging to the
<literal>MonadFix</literal> class. Here is an example:
<programlisting>
-rec { b &lt;- f a c ===> (b,c) &lt;- mfix (\~(b,c) -> do { b &lt;- f a c
- ; c &lt;- f b a } ; c &lt;- f b a
- ; return (b,c) })
+rec { b &lt;- f a c ===> (b,c) &lt;- mfix (\ ~(b,c) -> do { b &lt;- f a c
+ ; c &lt;- f b a } ; c &lt;- f b a
+ ; return (b,c) })
</programlisting>
As usual, the meta-variables <literal>b</literal>, <literal>c</literal> etc., can be arbitrary patterns.
In general, the statement <literal>rec <replaceable>ss</replaceable></literal> is desugared to the statement
<programlisting>
-<replaceable>vs</replaceable> &lt;- mfix (\~<replaceable>vs</replaceable> -&gt; do { <replaceable>ss</replaceable>; return <replaceable>vs</replaceable> })
+<replaceable>vs</replaceable> &lt;- mfix (\ ~<replaceable>vs</replaceable> -&gt; do { <replaceable>ss</replaceable>; return <replaceable>vs</replaceable> })
</programlisting>
where <replaceable>vs</replaceable> is a tuple of the variables bound by <replaceable>ss</replaceable>.
</para>