From a133c7e4dc38834e0cd913eeb7a10d501642dc26 Mon Sep 17 00:00:00 2001
From: Martijn Bastiaan <martijn@hmbastiaan.nl>
Date: Sun, 20 Jul 2025 07:47:53 +0200
Subject: [PATCH] Import `Data.Type.Ord` for GHC version agnostic errors (#91)

Fixes #89
---
 .github/workflows/haskell-ci.yml |  5 +++++
 tests/ErrorTests.hs              | 20 ++++++++++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)

--- a/tests/ErrorTests.hs
+++ b/tests/ErrorTests.hs
@@ -28,6 +28,10 @@ import GHC.IO.Encoding            (getLo
 import Language.Haskell.TH        (litE, stringL)
 import Language.Haskell.TH.Syntax (runIO)
 
+#if __GLASGOW_HASKELL__ >= 901
+import qualified Data.Type.Ord
+#endif
+
 testProxy1 :: Proxy (x + 1) -> Proxy (2 + x)
 testProxy1 = id
 
@@ -194,8 +198,8 @@ testProxy10Errors =
 #if __GLASGOW_HASKELL__ >= 910
   [$(do localeEncoding <- runIO (getLocaleEncoding)
         if textEncodingName localeEncoding == textEncodingName utf8
-          then litE $ stringL "Couldn't match type ‘ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
-          else litE $ stringL "Couldn't match type `ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
+          then litE $ stringL "Couldn't match type ‘Data.Type.Ord.OrdCond"
+          else litE $ stringL "Couldn't match type `Data.Type.Ord.OrdCond"
     )
   ,$(do localeEncoding <- runIO (getLocaleEncoding)
         if textEncodingName localeEncoding == textEncodingName utf8
@@ -337,8 +341,8 @@ testProxy14Errors =
 #if __GLASGOW_HASKELL__ >= 910
   [$(do localeEncoding <- runIO (getLocaleEncoding)
         if textEncodingName localeEncoding == textEncodingName utf8
-          then litE $ stringL "Couldn't match type ‘ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
-          else litE $ stringL "Couldn't match type `ghc-internal-9.1001.0:GHC.Internal.Data.Type.Ord.OrdCond"
+          then litE $ stringL "Couldn't match type ‘Data.Type.Ord.OrdCond"
+          else litE $ stringL "Couldn't match type `Data.Type.Ord.OrdCond"
     )
   ,$(do localeEncoding <- runIO (getLocaleEncoding)
         if textEncodingName localeEncoding == textEncodingName utf8
