Skip to content

Commit

Permalink
Fix for ghc 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrcek committed Feb 15, 2024
1 parent af3cd7e commit 3727367
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/HieDb/Compat.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -216,3 +217,8 @@ fieldNameSpace_maybe _ = Nothing
fieldName :: FastString -> NameSpace
fieldName _ = varName
#endif

#if __GLASGOW_HASKELL__ < 902
instance Show ModuleName where
show = moduleNameString
#endif
7 changes: 2 additions & 5 deletions test/Test/Orphans.hs
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down

0 comments on commit 3727367

Please sign in to comment.