diff options
-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> |