[Git][ghc/ghc][master] docs: Update info on TypeAbstractions

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Mar 9 22:38:54 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
2b1faea9 by Vladislav Zavialov at 2024-03-09T17:38:21-05:00
docs: Update info on TypeAbstractions

* Mention TypeAbstractions in 9.10.1-notes.rst
* Set the status to "Experimental".
* Add a "Since: GHC 9.x" comment to each section.

- - - - -


2 changed files:

- docs/users_guide/9.10.1-notes.rst
- docs/users_guide/exts/type_abstractions.rst


Changes:

=====================================
docs/users_guide/9.10.1-notes.rst
=====================================
@@ -124,6 +124,20 @@ Language
 
   The extension is enabled by default, establishing the usual behavior.
 
+- In accordance with GHC Proposal `#448 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0448-type-variable-scoping.rst>`_,
+  the :extension:`TypeAbstractions` extension has been extended to support
+  ``@``-binders in lambdas and function equations::
+
+    id :: forall a. a -> a
+    id @t x = x :: t
+    -- ^^ @-binder in a function equation
+
+    e = higherRank (\ @t -> ... )
+    --                ^^ @-binder in a lambda
+
+  This feature is an experimental alternative to :extension:`ScopedTypeVariables`,
+  see the :ref:`type-abstractions-in-functions` section.
+
 Compiler
 ~~~~~~~~
 


=====================================
docs/users_guide/exts/type_abstractions.rst
=====================================
@@ -6,7 +6,7 @@ Type abstractions
 
     :since: 9.8.1
 
-    :status: Partially implemented
+    :status: Experimental
 
     Allow the use of type abstraction syntax.
 
@@ -22,6 +22,8 @@ and `#425 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/
 Type Abstractions in Patterns
 -----------------------------
 
+**Since:** GHC 9.2
+
 The type abstraction syntax can be used in patterns that match a data
 constructor. The syntax can't be used with record patterns or infix patterns.
 This is useful in particular to bind existential type variables associated with
@@ -99,6 +101,8 @@ matched, rather than ever referring to a variable from an outer scope. Type wild
 Type Abstractions in Functions
 ------------------------------
 
+**Since:** GHC 9.10
+
 Type abstraction syntax can be used in lambdas and function left-hand sides to
 bring into scope type variables associated with invisible ``forall``.
 For example::
@@ -200,6 +204,8 @@ At the moment, an ``@``-binder is valid only in a limited set of circumstances:
 Invisible Binders in Type Declarations
 --------------------------------------
 
+**Since:** GHC 9.8
+
 Syntax
 ~~~~~~
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2b1faea90dff1ad743925eb5a0b552a11c514349

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2b1faea90dff1ad743925eb5a0b552a11c514349
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/20240309/3141aac8/attachment-0001.html>


More information about the ghc-commits mailing list