Skip to content
Snippets Groups Projects
Commit 772b4f59 authored by Artem Pelenitsyn's avatar Artem Pelenitsyn Committed by Zubin
Browse files

Docs: Linear types: link Strict Patterns subsection


Also, fix a bug in RST with missing newline before a listing.

Co-authored-by: default avatarArnaud Spiwack <arnaud@spiwack.net>
(cherry picked from commit 4dd30cba)
parent 3d0fe159
No related branches found
No related tags found
No related merge requests found
......@@ -120,7 +120,7 @@ multiplicity if:
- The binding is a pattern binding (including a simple variable)
``p=e`` (you can't write ``let %1 f x = u``, instead write ``let %1
f = \x -> u``)
- Either ``p`` is strict (see infra) or ``p`` is a variable. In
- Either ``p`` is strict (see :ref:`strict-patterns-for-linear` below) or ``p`` is a variable. In
particular neither ``x@y`` nor ``(x)`` are covered by “is a
variable”
......@@ -144,6 +144,8 @@ When ``-XMonoLocalBinds`` is off, the following also holds:
- Non-variable pattern bindings which are inferred as polymorphic or
qualified are inferred as having multiplicity ``Many``.
.. _strict-patterns-for-linear:
Strict patterns
~~~~~~~~~~~~~~~
......@@ -189,6 +191,7 @@ Without ``-XStrict``::
case u of ~(x, y) -> …
With ``-XStrict``::
-- good
let %1 x = u in …
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment