summaryrefslogtreecommitdiff
path: root/docs/users_guide/exts/lambda_case.rst
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-01-15 19:52:49 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-01-25 05:24:19 -0500
commit0a5e4f5f7d6cef16b6b11ac8d3a269b92016ed5d (patch)
tree9456f70f36a1d2fcc9ff6bf6bc6eab1c2beda862 /docs/users_guide/exts/lambda_case.rst
parentb1a32170a1b8e7a31c2dd28eb1b02f1375ea3998 (diff)
downloadhaskell-0a5e4f5f7d6cef16b6b11ac8d3a269b92016ed5d.tar.gz
Split glasgow_exts into several files (#17316)
Diffstat (limited to 'docs/users_guide/exts/lambda_case.rst')
-rw-r--r--docs/users_guide/exts/lambda_case.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/users_guide/exts/lambda_case.rst b/docs/users_guide/exts/lambda_case.rst
new file mode 100644
index 0000000000..a65c1e881e
--- /dev/null
+++ b/docs/users_guide/exts/lambda_case.rst
@@ -0,0 +1,28 @@
+.. _lambda-case:
+
+Lambda-case
+-----------
+
+.. extension:: LambdaCase
+ :shortdesc: Enable lambda-case expressions.
+
+ :since: 7.6.1
+
+ Allow the use of lambda-case syntax.
+
+The :extension:`LambdaCase` extension enables expressions of the form ::
+
+ \case { p1 -> e1; ...; pN -> eN }
+
+which is equivalent to ::
+
+ \freshName -> case freshName of { p1 -> e1; ...; pN -> eN }
+
+Note that ``\case`` starts a layout, so you can write ::
+
+ \case
+ p1 -> e1
+ ...
+ pN -> eN
+
+