mirror of
https://github.com/polysemy-research/polysemy.git
synced 2024-09-11 02:25:43 +03:00
polysemy-plugin: compatibility with ghc 9.8 (#483)
This commit is contained in:
parent
78925a6405
commit
ab8c12e96b
@ -143,7 +143,11 @@ instance Outputable FindConstraint where
|
|||||||
-- | Given a list of constraints, filter out the 'FindConstraint's.
|
-- | Given a list of constraints, filter out the 'FindConstraint's.
|
||||||
getFindConstraints :: PolysemyStuff 'Things -> [Ct] -> [FindConstraint]
|
getFindConstraints :: PolysemyStuff 'Things -> [Ct] -> [FindConstraint]
|
||||||
getFindConstraints (findClass -> cls) cts = do
|
getFindConstraints (findClass -> cls) cts = do
|
||||||
|
#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0)
|
||||||
|
cd@(CDictCan(DictCt{di_cls = cls', di_tys = [eff, r]})) <- cts
|
||||||
|
#else
|
||||||
cd@CDictCan{cc_class = cls', cc_tyargs = [eff, r]} <- cts
|
cd@CDictCan{cc_class = cls', cc_tyargs = [eff, r]} <- cts
|
||||||
|
#endif
|
||||||
guard $ cls == cls'
|
guard $ cls == cls'
|
||||||
pure $ FindConstraint
|
pure $ FindConstraint
|
||||||
{ fcLoc = ctLoc cd
|
{ fcLoc = ctLoc cd
|
||||||
@ -157,7 +161,11 @@ getFindConstraints (findClass -> cls) cts = do
|
|||||||
-- | Get evidence in scope that aren't the 'FindConstraint's.
|
-- | Get evidence in scope that aren't the 'FindConstraint's.
|
||||||
getExtraEvidence :: PolysemyStuff 'Things -> [Ct] -> [PredType]
|
getExtraEvidence :: PolysemyStuff 'Things -> [Ct] -> [PredType]
|
||||||
getExtraEvidence things cts = do
|
getExtraEvidence things cts = do
|
||||||
|
#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0)
|
||||||
|
CDictCan(DictCt{di_cls = cls, di_tys = as}) <- cts
|
||||||
|
#else
|
||||||
CDictCan{cc_class = cls, cc_tyargs = as} <- cts
|
CDictCan{cc_class = cls, cc_tyargs = as} <- cts
|
||||||
|
#endif
|
||||||
guard $ cls /= findClass things
|
guard $ cls /= findClass things
|
||||||
pure $ mkAppTys (mkTyConTy $ classTyCon cls) as
|
pure $ mkAppTys (mkTyConTy $ classTyCon cls) as
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user