From ea7f8af293d3202f9d24b3b73a948b2c0869bc0c Mon Sep 17 00:00:00 2001
From: Torsten Schmits <git@tryp.io>
Date: Wed, 15 Mar 2023 13:52:33 +0100
Subject: [PATCH] add the extension ListTuplePuns (GHC proposal 475)

---
 Cabal-syntax/src/Language/Haskell/Extension.hs           | 3 +++
 .../tests/UnitTests/Distribution/Utils/Structured.hs     | 8 ++++----
 changelog.d/pr-8854                                      | 9 +++++++++
 editors/vim/syntax/cabal.vim                             | 1 +
 4 files changed, 17 insertions(+), 4 deletions(-)
 create mode 100644 changelog.d/pr-8854

diff --git a/Cabal-syntax/src/Language/Haskell/Extension.hs b/Cabal-syntax/src/Language/Haskell/Extension.hs
index 3fe8a60b38..d5fb797eea 100644
--- a/Cabal-syntax/src/Language/Haskell/Extension.hs
+++ b/Cabal-syntax/src/Language/Haskell/Extension.hs
@@ -542,6 +542,9 @@ data KnownExtension
     RelaxedLayout
   | -- | Allow the use of type abstraction syntax.
     TypeAbstractions
+  | -- | Allow the use of built-in syntax for list, tuple and sum type constructors
+    -- rather than being exclusive to data constructors.
+    ListTuplePuns
   deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Typeable, Data)
 
 instance Binary KnownExtension
diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
index 1c571ad5b8..64fff30e0d 100644
--- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
+++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
@@ -33,15 +33,15 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int
 md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion
 md5CheckGenericPackageDescription proxy = md5Check proxy
 #if MIN_VERSION_base(4,19,0)
-    0xbaf013a54a9ae4dab8d9c8beecb5ac5d
+    0x4136daf844669c3c272845160cb5a908
 #else
-    0xcbd99e3b359decfab4b25e1335067f72
+    0x196b441722dfe556ed5b5d1d874741b3
 #endif
 
 md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
 md5CheckLocalBuildInfo proxy = md5Check proxy
 #if MIN_VERSION_base(4,19,0)
-    0x403539e40a138deaf1a1189aa349cff2
+    0x8a30fa23374160aac9cdd1996dc5112b
 #else
-    0x279674c69cfcfd5e8ffd51bc02965cd7
+    0x2e959a7f1da8f0d11f6923831ab6ab55
 #endif
diff --git a/changelog.d/pr-8854 b/changelog.d/pr-8854
new file mode 100644
index 0000000000..8b77d09d3e
--- /dev/null
+++ b/changelog.d/pr-8854
@@ -0,0 +1,9 @@
+synopsis: Add language extension ListTuplePuns
+packages: Cabal-syntax
+prs: #8854
+
+description: {
+
+- adds support for the `ListTuplePuns` language extension (GHC proposal #475)
+
+}
diff --git a/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim
index bb075d3f10..210b637c14 100644
--- a/editors/vim/syntax/cabal.vim
+++ b/editors/vim/syntax/cabal.vim
@@ -209,6 +209,7 @@ syn keyword cabalExtension contained
   \ LexicalNegation
   \ LiberalTypeSynonyms
   \ LinearTypes
+  \ ListTuplePuns
   \ RequiredTypeArguments
   \ MagicHash
   \ MonadComprehensions
-- 
GitLab