diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-06-22 13:32:03 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-06-22 13:32:03 +0100 |
commit | 451e0dd875274aeb492a681bcdf944ab6deac39f (patch) | |
tree | 691ccde6640ce80d491e120a1f0513444c4ef831 | |
parent | 96ca465d7516e47f4ca46f3e91765c3e8411c8f3 (diff) | |
download | haskell-451e0dd875274aeb492a681bcdf944ab6deac39f.tar.gz |
Fix syntax in some code in the user guide; fixes #8007
-rw-r--r-- | docs/users_guide/glasgow_exts.xml | 8 |
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 <- 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> |