summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>2012-07-15 00:53:52 +0700
committerSimon Marlow <marlowsd@gmail.com>2012-07-16 11:09:40 +0100
commitcc456b0be3f20a1c1cef4154ae40ac18f4f6711e (patch)
tree0ca2bc0cdfabd6f4c6e3e0a94170baae71d634c0 /docs
parentb1e97f2f325537664f09eee7ea0e7c53264b061e (diff)
downloadhaskell-cc456b0be3f20a1c1cef4154ae40ac18f4f6711e.tar.gz
Implemented MultiWayIf extension.
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/flags.xml6
-rw-r--r--docs/users_guide/glasgow_exts.xml21
2 files changed, 27 insertions, 0 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 544acd8c2a..24c52f214a 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -1128,6 +1128,12 @@
<entry><option>-XNoLambdaCase</option></entry>
</row>
<row>
+ <entry><option>-XMultiWayIf</option></entry>
+ <entry>Enable <link linkend="multi-way-if">multi-way if-expressions</link>.</entry>
+ <entry>dynamic</entry>
+ <entry><option>-XNoMultiWayIf</option></entry>
+ </row>
+ <row>
<entry><option>-XSafe</option></entry>
<entry>Enable the <link linkend="safe-haskell">Safe Haskell</link> Safe mode.</entry>
<entry>dynamic</entry>
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 805f53aa40..dde235eda4 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -1690,6 +1690,27 @@ Note that <literal>\case</literal> starts a layout, so you can write
</para>
</sect2>
+<sect2 id="multi-way-if">
+<title>Multi-way if-expressions</title>
+<para>
+With <option>-XMultiWayIf</option> flag GHC accepts conditional expressions
+with multiple branches:
+<programlisting>
+ if | guard1 -> expr1
+ | ...
+ | guardN -> exprN
+</programlisting>
+which is roughly equivalent to
+<programlisting>
+ case () of
+ _ | guard1 -> expr1
+ ...
+ _ | guardN -> exprN
+</programlisting>
+except that multi-way if-expressions do not alter the layout.
+</para>
+</sect2>
+
<sect2 id="disambiguate-fields">
<title>Record field disambiguation</title>
<para>