Skip to content

Commit 25b559c

Browse files
committed
fix imports to work with GHC 8.10
Also ended up taking out the conditional imports to support GHC 7.10, since with the rearranged GHC APΙ imports it definitely wouldn't anymore. If I identified the point where the changes happend between 8.0 and 8.10, could probably maintain support for all versions in between.
1 parent 4218b52 commit 25b559c

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

src/TypeNatSolver.hs

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ module TypeNatSolver (plugin) where
44

55
import Type ( Type, Kind, TyVar, eqType
66
, getTyVar_maybe, isNumLitTy, splitTyConApp_maybe
7-
, getEqPredTys, mkTyConApp, mkNumLitTy
8-
#if __GLASGOW_HASKELL__ <= 710
9-
, mkEqPred
10-
#else
11-
, mkPrimEqPred
12-
#endif
13-
, typeKind, classifyPredType, PredTree(..), EqRel(..)
14-
, getTyVar_maybe, getEqPredTys_maybe
7+
, mkTyConApp, mkNumLitTy
8+
, typeKind
9+
, getTyVar_maybe
10+
)
11+
import Predicate ( getEqPredTys, getEqPredTys_maybe
12+
, mkPrimEqPred, classifyPredType
13+
, Pred(..), EqRel(..)
1514
)
1615
import TyCon ( TyCon )
1716
import TcEvidence ( EvTerm(..) )
@@ -21,10 +20,10 @@ import OccName ( occNameString )
2120
import Var ( tyVarName )
2221
import TcPluginM ( TcPluginM, tcPluginIO, tcPluginTrace )
2322
import TcRnMonad ( TcPlugin(..), TcPluginResult(..)
24-
, Ct(..), CtEvidence(..), CtLoc, ctLoc, ctPred
25-
, mkNonCanonical, isTouchableTcM, unsafeTcPluginTcM
26-
)
27-
import TcRnTypes ( isDerivedCt )
23+
, isTouchableTcM, unsafeTcPluginTcM )
24+
import Constraint ( Ct(..), CtEvidence(..), CtLoc, ctLoc, ctPred
25+
, mkNonCanonical, isDerivedCt
26+
)
2827
import Plugins ( CommandLineOption, defaultPlugin, Plugin(..) )
2928

3029
import TcTypeNats ( typeNatAddTyCon
@@ -33,14 +32,10 @@ import TcTypeNats ( typeNatAddTyCon
3332
, typeNatLeqTyCon
3433
)
3534
import TysWiredIn ( typeNatKindCon
36-
#if __GLASGOW_HASKELL__ <= 710
37-
, promotedBoolTyCon
38-
#else
3935
, boolTyCon
40-
#endif
4136
, promotedFalseDataCon, promotedTrueDataCon
4237
)
43-
import TrieMap ( TypeMap, emptyTypeMap, lookupTypeMap, extendTypeMap )
38+
import CoreMap ( TypeMap, emptyTypeMap, lookupTypeMap, extendTypeMap )
4439

4540
import Outputable
4641

@@ -59,14 +54,6 @@ import qualified SimpleSMT as SMT
5954

6055
import GHC.TcPluginM.Extra (newGiven, newDerived, evByFiat)
6156

62-
-- Forward compatibility with GHC 8.0 (some names changed):
63-
#if __GLASGOW_HASKELL__ > 710
64-
promotedBoolTyCon :: TyCon
65-
promotedBoolTyCon = boolTyCon
66-
mkEqPred :: Type -> Type -> Type
67-
mkEqPred = mkPrimEqPred
68-
#endif
69-
7057
plugin :: Plugin
7158
plugin = defaultPlugin { tcPlugin = Just . thePlugin }
7259

@@ -586,7 +573,6 @@ type NewVarDecls = Map String (Type,Ty)
586573

587574
instance Monad ImportM where
588575
return a = Imp (\s -> (a, s, Map.empty))
589-
fail err = panic err
590576
Imp m >>= k = Imp (\s -> let (a,s1,ds1) = m s
591577
Imp m1 = k a
592578
(b,s2,ds2) = m1 s1

0 commit comments

Comments
 (0)