[commit: ghc] master: Fix syntax in some code in the user guide; fixes #8007 (451e0dd)
Ian Lynagh
igloo at earth.li
Sat Jun 22 14:51:58 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
https://github.com/ghc/ghc/commit/451e0dd875274aeb492a681bcdf944ab6deac39f
>---------------------------------------------------------------
commit 451e0dd875274aeb492a681bcdf944ab6deac39f
Author: Ian Lynagh <ian at well-typed.com>
Date: Sat Jun 22 13:32:03 2013 +0100
Fix syntax in some code in the user guide; fixes #8007
>---------------------------------------------------------------
docs/users_guide/glasgow_exts.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 710efbb..b398597 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 <- f a c ===> (b,c) <- mfix (\~(b,c) -> do { b <- f a c
- ; c <- f b a } ; c <- f b a
- ; return (b,c) })
+rec { b <- f a c ===> (b,c) <- mfix (\ ~(b,c) -> do { b <- f a c
+ ; c <- f b a } ; c <- 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> <- mfix (\~<replaceable>vs</replaceable> -> do { <replaceable>ss</replaceable>; return <replaceable>vs</replaceable> })
+<replaceable>vs</replaceable> <- mfix (\ ~<replaceable>vs</replaceable> -> 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>
More information about the ghc-commits
mailing list