[Git][ghc/ghc][master] Clarify -XGADTs enables existential quantification
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Jun 18 22:47:50 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
d70abb49 by sheaf at 2024-06-18T18:47:20-04:00
Clarify -XGADTs enables existential quantification
Even though -XGADTs does not turn on -XExistentialQuantification,
it does allow the user of existential quantification syntax, without
needing to use GADT-style syntax.
Fixes #20865
- - - - -
1 changed file:
- docs/users_guide/exts/gadt.rst
Changes:
=====================================
docs/users_guide/exts/gadt.rst
=====================================
@@ -93,6 +93,12 @@ also sets :extension:`GADTSyntax` and :extension:`MonoLocalBinds`.
-- essentially the same as:
-- MkG :: Int -> Int -> G Int
+ Note that, even though :extension:`GADTs` technically does not imply
+ :extension:`ExistentialQuantification`, enabling :extension:`GADTs`
+ does also enable the syntax for existential quantification: ::
+
+ data SomeShow = forall a. Show a => SomeShow a
+
- It is permitted to declare an ordinary algebraic data type using
GADT-style syntax. What makes a GADT into a GADT is not the syntax,
but rather the presence of data constructors whose result type is not
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d70abb49cdcbcd0cabc977d6804c6e083bc9f31d
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d70abb49cdcbcd0cabc977d6804c6e083bc9f31d
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/20240618/18a13637/attachment.html>
More information about the ghc-commits
mailing list