[Git][ghc/ghc][master] Docs: Linear types: link Strict Patterns subsection
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Sat Oct 12 03:45:44 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
4dd30cba by Artem Pelenitsyn at 2024-10-11T23:45:09-04:00
Docs: Linear types: link Strict Patterns subsection
Also, fix a bug in RST with missing newline before a listing.
Co-authored-by: Arnaud Spiwack <arnaud at spiwack.net>
- - - - -
1 changed file:
- docs/users_guide/exts/linear_types.rst
Changes:
=====================================
docs/users_guide/exts/linear_types.rst
=====================================
@@ -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 at 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 …
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4dd30cba51c7936dc53f0c1d331f88a590f93013
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4dd30cba51c7936dc53f0c1d331f88a590f93013
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241011/a8a41326/attachment-0001.html>
More information about the ghc-commits
mailing list