From c9e34f5c7c02bc8777c5d55de8f6d84c88b70c80 Mon Sep 17 00:00:00 2001
From: Ryan Scott <ryan.gl.scott@gmail.com>
Date: Sat, 30 Sep 2023 20:19:45 -0400
Subject: [PATCH] Support the `FldName` namespace introduced in GHC 9.8

---
 singletons-th/src/Data/Singletons/TH/Promote.hs       | 9 +++++----
 singletons-th/src/Data/Singletons/TH/Single/Fixity.hs | 9 +++++----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/singletons-th/src/Data/Singletons/TH/Promote.hs b/singletons-th/src/Data/Singletons/TH/Promote.hs
index f49f6ee3..2f54df03 100644
--- a/singletons-th/src/Data/Singletons/TH/Promote.hs
+++ b/singletons-th/src/Data/Singletons/TH/Promote.hs
@@ -614,10 +614,11 @@ promoteInfixDecl mb_let_uniq name fixity = do
   mb_ns <- reifyNameSpace name
   case mb_ns of
     -- If we can't find the Name for some odd reason, fall back to promote_val
-    Nothing        -> promote_val
-    Just VarName   -> promote_val
-    Just DataName  -> never_mind
-    Just TcClsName -> do
+    Nothing          -> promote_val
+    Just VarName     -> promote_val
+    Just (FldName _) -> promote_val
+    Just DataName    -> never_mind
+    Just TcClsName   -> do
       mb_info <- dsReify name
       case mb_info of
         Just (DTyConI DClassD{} _)
diff --git a/singletons-th/src/Data/Singletons/TH/Single/Fixity.hs b/singletons-th/src/Data/Singletons/TH/Single/Fixity.hs
index 36801cca..1ba57194 100644
--- a/singletons-th/src/Data/Singletons/TH/Single/Fixity.hs
+++ b/singletons-th/src/Data/Singletons/TH/Single/Fixity.hs
@@ -15,10 +15,11 @@ singInfixDecl name fixity = do
   case mb_ns of
     -- If we can't find the Name for some odd reason,
     -- fall back to singValName
-    Nothing        -> finish $ singledValueName   opts name
-    Just VarName   -> finish $ singledValueName   opts name
-    Just DataName  -> finish $ singledDataConName opts name
-    Just TcClsName -> do
+    Nothing          -> finish $ singledValueName   opts name
+    Just VarName     -> finish $ singledValueName   opts name
+    Just (FldName _) -> finish $ singledValueName   opts name
+    Just DataName    -> finish $ singledDataConName opts name
+    Just TcClsName   -> do
       mb_info <- dsReify name
       case mb_info of
         Just (DTyConI DClassD{} _)