From baa15c16da12867745f1eb07ec692aea0a313c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Thu, 15 Feb 2024 10:44:03 +0100 Subject: [PATCH 1/3] Add Show instances for Command and Options --- src/HieDb/Run.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/HieDb/Run.hs b/src/HieDb/Run.hs index 1d6e396..da91c51 100644 --- a/src/HieDb/Run.hs +++ b/src/HieDb/Run.hs @@ -83,6 +83,7 @@ data Options , srcBaseDir :: Maybe FilePath , skipIndexingOptions :: SkipOptions } + deriving Show data Command = Init @@ -107,6 +108,7 @@ data Command | Unreachable [Symbol] | Html [Symbol] | GCTypeNames + deriving Show progParseInfo :: FilePath -> Bool -> ParserInfo (Options, Command) progParseInfo db colr = info (progParser db colr <**> helper) From 2882a97ef046711866957f1c13e8c6c5f320882f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Thu, 15 Feb 2024 11:06:12 +0100 Subject: [PATCH 2/3] Fix for ghc 9.0 --- src/HieDb/Compat.hs | 6 ++++++ test/Test/Orphans.hs | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/HieDb/Compat.hs b/src/HieDb/Compat.hs index 4710eec..17ed38c 100644 --- a/src/HieDb/Compat.hs +++ b/src/HieDb/Compat.hs @@ -1,5 +1,6 @@ {-# LANGUAGE CPP, PatternSynonyms, ViewPatterns, TupleSections #-} +{-# OPTIONS_GHC -Wno-orphans #-} -- ghc 9.0 doesn't have Show instance for ModuleName module HieDb.Compat ( nodeInfo' , Unit @@ -216,3 +217,8 @@ fieldNameSpace_maybe _ = Nothing fieldName :: FastString -> NameSpace fieldName _ = varName #endif + +#if __GLASGOW_HASKELL__ < 902 +instance Show ModuleName where + show = moduleNameString +#endif diff --git a/test/Test/Orphans.hs b/test/Test/Orphans.hs index fbd0ca8..b34a0ac 100644 --- a/test/Test/Orphans.hs +++ b/test/Test/Orphans.hs @@ -1,13 +1,10 @@ -{-# LANGUAGE StandaloneDeriving, CPP #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE StandaloneDeriving #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Test.Orphans where import HieDb.Compat import HieDb.Types -#if __GLASGOW_HASKELL__ < 902 -instance Show ModuleName where show = moduleNameString -#endif instance Show OccName where show = occNameString instance Show Name where show n = From 4e61fcfd376f2d7e2e42ec33b62d6df2b5763fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Fri, 28 Jun 2024 06:23:18 +0200 Subject: [PATCH 3/3] Revert "Fix for ghc 9.0" This reverts commit 2882a97ef046711866957f1c13e8c6c5f320882f. --- src/HieDb/Compat.hs | 6 ------ test/Test/Orphans.hs | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/HieDb/Compat.hs b/src/HieDb/Compat.hs index 17ed38c..4710eec 100644 --- a/src/HieDb/Compat.hs +++ b/src/HieDb/Compat.hs @@ -1,6 +1,5 @@ {-# LANGUAGE CPP, PatternSynonyms, ViewPatterns, TupleSections #-} -{-# OPTIONS_GHC -Wno-orphans #-} -- ghc 9.0 doesn't have Show instance for ModuleName module HieDb.Compat ( nodeInfo' , Unit @@ -217,8 +216,3 @@ fieldNameSpace_maybe _ = Nothing fieldName :: FastString -> NameSpace fieldName _ = varName #endif - -#if __GLASGOW_HASKELL__ < 902 -instance Show ModuleName where - show = moduleNameString -#endif diff --git a/test/Test/Orphans.hs b/test/Test/Orphans.hs index b34a0ac..fbd0ca8 100644 --- a/test/Test/Orphans.hs +++ b/test/Test/Orphans.hs @@ -1,10 +1,13 @@ -{-# LANGUAGE StandaloneDeriving #-} -{-# OPTIONS_GHC -Wno-orphans #-} +{-# LANGUAGE StandaloneDeriving, CPP #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} module Test.Orphans where import HieDb.Compat import HieDb.Types +#if __GLASGOW_HASKELL__ < 902 +instance Show ModuleName where show = moduleNameString +#endif instance Show OccName where show = occNameString instance Show Name where show n =