Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support (in theory) GHC 9.6 #55

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

chrisdone
Copy link
Owner

@juhp I'm not sure why Control.Monad is needed -- I'd prefer to just add an explicit import. Let me know if there's a specific name that isn't available anymore.

I'll need more time than a 5 min fix to upgrade my CI from GHC 9.4.8 to 9.6, so in the interim I don't mind throwing a CPP on there for the newer versions.

@chrisdone chrisdone merged commit fbf2cd0 into main Oct 28, 2024
1 check passed
@chrisdone chrisdone deleted the cd/2024-10-28-support-ghc-9-6 branch October 28, 2024 08:54
@juhp
Copy link

juhp commented Oct 28, 2024

Thanks

Anyway this is what I prepared before realising you already committed:

modified   src/Hell.hs
@@ -12,6 +12,7 @@
 {-# LANGUAGE GADTs, PolyKinds, TupleSections, StandaloneDeriving, Rank2Types, FlexibleContexts #-}
 {-# LANGUAGE ViewPatterns, LambdaCase, ScopedTypeVariables, PatternSynonyms, TemplateHaskell #-}
 {-# LANGUAGE OverloadedRecordDot, OverloadedStrings, MultiWayIf, DeriveFunctor, DeriveFoldable, DeriveTraversable, TypeOperators, UndecidableInstances, TypeFamilies, AllowAmbiguousTypes, MultiParamTypeClasses, FlexibleInstances, ExtendedDefaultRules #-}
+{-# LANGUAGE CPP #-}
 
 module Main (main) where
 
@@ -66,7 +67,9 @@ import qualified Options.Applicative as Options
 import Data.Traversable
 import Data.Bifunctor
 import System.Process.Typed as Process
-import Control.Monad
+#if MIN_VERSION_base(4,18,0)
+import Control.Monad (foldM, when)
+#endif
 import Control.Monad.State.Strict
 import Control.Monad.Reader
 import System.Environment
@@ -76,7 +79,10 @@ import Data.Vector (Vector)
 import Data.Aeson (Value)
 import Data.Text (Text)
 import Data.ByteString (ByteString)
-import GHC.Types hiding (List)
+import GHC.Types
+#if MIN_VERSION_ghc_prim(0,10,0)
+  hiding (List)
+#endif
 import GHC.TypeLits
 import Type.Reflection (SomeTypeRep(..), TypeRep, typeRepKind, typeRep, pattern TypeRep)

I think yours works - will try later, though conditioning on the library versions might be more precise.

It is fairly easy to test locally: stack --resolver lts-22 install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants