From 74261d9b0d8efc1b0975372b3fcdc60ebc95c221 Mon Sep 17 00:00:00 2001
From: Francesco Ariis <fa-ml@ariis.it>
Date: Fri, 8 Dec 2023 07:53:40 +0100
Subject: [PATCH] Add `TypeAbstractions` extension

---
 Cabal-syntax/src/Language/Haskell/Extension.hs        |  2 ++
 .../tests/UnitTests/Distribution/Utils/Structured.hs  |  8 ++++----
 changelog.d/pr-9502                                   | 11 +++++++++++
 editors/vim/syntax/cabal.vim                          |  2 ++
 4 files changed, 19 insertions(+), 4 deletions(-)
 create mode 100644 changelog.d/pr-9502

diff --git a/Cabal-syntax/src/Language/Haskell/Extension.hs b/Cabal-syntax/src/Language/Haskell/Extension.hs
index f1b3e64431..b95bd23002 100644
--- a/Cabal-syntax/src/Language/Haskell/Extension.hs
+++ b/Cabal-syntax/src/Language/Haskell/Extension.hs
@@ -540,6 +540,8 @@ data KnownExtension
     AlternativeLayoutRuleTransitional
   | -- | Undocumented parsing-related extensions introduced in GHC 7.2.
     RelaxedLayout
+  | -- | Allow the use of type abstraction syntax.
+    TypeAbstractions
   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 18fbcf549a..799c7f58d9 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)
-    0xf5fdb32b43aca790192f44d9ecaa9689
+    0x87037bc65fba873f53c03ce572a42229
 #else
-    0xb287a6f04e34ef990cdd15bc6cb01c76
+    0x5817c798e23df281d794ad27754ad43f
 #endif
 
 md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
 md5CheckLocalBuildInfo proxy = md5Check proxy
 #if MIN_VERSION_base(4,19,0)
-    0x205fbe2649bc5e488bce50c07a71cadb
+    0x83cb87bceb4c1634e7dda192c3ad6579
 #else
-    0x26e91a71ebd19d4d6ce37f798ede249a
+    0x4beeb42e94807be904bc5d15355c98cd
 #endif
diff --git a/changelog.d/pr-9502 b/changelog.d/pr-9502
new file mode 100644
index 0000000000..12e5cc0e47
--- /dev/null
+++ b/changelog.d/pr-9502
@@ -0,0 +1,11 @@
+synopsis: Add language extension `TypeAbstractions`
+packages: Cabal-syntax
+prs: #9502
+issues: #9496
+
+description: {
+
+- Adds support for the TypeAbstractions language extension.
+
+}
+
diff --git a/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim
index 1a69bd7736..bb075d3f10 100644
--- a/editors/vim/syntax/cabal.vim
+++ b/editors/vim/syntax/cabal.vim
@@ -268,6 +268,7 @@ syn keyword cabalExtension contained
   \ TraditionalRecordSyntax
   \ TransformListComp
   \ TupleSections
+  \ TypeAbstractions
   \ TypeApplications
   \ TypeData
   \ TypeFamilies
@@ -408,6 +409,7 @@ syn keyword cabalExtension contained
   \ NoTraditionalRecordSyntax
   \ NoTransformListComp
   \ NoTupleSections
+  \ NoTypeAbstractions
   \ NoTypeApplications
   \ NoTypeData
   \ NoTypeFamilies
-- 
GitLab