polysemy-plugin 0.4.3.1 → 0.4.4.0
raw patch · 4 files changed
+39/−7 lines, 4 filesdep +hspec-discoverdep ~doctest
Dependencies added: hspec-discover
Dependency ranges changed: doctest
Files
- ChangeLog.md +4/−0
- polysemy-plugin.cabal +5/−5
- src/Polysemy/Plugin/Fundep.hs +21/−1
- src/Polysemy/Plugin/Fundep/Stuff.hs +9/−1
ChangeLog.md view
@@ -2,6 +2,10 @@ ## Unreleased +## 0.4.4.0 (2022-12-27)++* Support GHC 9.4+ ## 0.4.3.1 (2022-07-11) * Add a missing pattern match that was hit by a user.
polysemy-plugin.cabal view
@@ -1,11 +1,11 @@ cabal-version: 2.0 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.34.7. -- -- see: https://github.com/sol/hpack name: polysemy-plugin-version: 0.4.3.1+version: 0.4.4.0 synopsis: Disambiguate obvious uses of effects. description: Please see the README on GitHub at <https://github.com/polysemy-research/polysemy/tree/master/polysemy-plugin#readme> category: Polysemy@@ -89,6 +89,7 @@ Paths_polysemy_plugin Build_doctests autogen-modules:+ Paths_polysemy_plugin Build_doctests hs-source-dirs: test@@ -107,15 +108,14 @@ TypeFamilies UnicodeSyntax ghc-options: -threaded -rtsopts -with-rtsopts=-N -fplugin=Polysemy.Plugin- build-tool-depends:- hspec-discover:hspec-discover build-depends: base >=4.9 && <5 , containers >=0.5 && <0.7- , doctest >=0.16.0.1 && <0.19+ , doctest >=0.16.0.1 && <0.21 , ghc >=8.6.5 && <10 , ghc-tcplugins-extra >=0.3 && <0.5 , hspec >=2.6.0 && <3+ , hspec-discover , inspection-testing >=0.4.2 && <0.5 , polysemy >=1.3.0.0 , polysemy-plugin
src/Polysemy/Plugin/Fundep.hs view
@@ -54,7 +54,7 @@ #if __GLASGOW_HASKELL__ >= 900 import GHC.Builtin.Types.Prim (alphaTys)-import GHC.Plugins (idType, tyConClass_maybe, ppr, Outputable, sep, text, (<+>), parens)+import GHC.Plugins (idType, tyConClass_maybe, ppr, Outputable, sep, text, (<+>), parens, emptyUFM) import GHC.Tc.Types.Evidence import GHC.Tc.Plugin (TcPluginM, tcPluginIO) import GHC.Tc.Types@@ -95,6 +95,9 @@ <*> polysemyStuff , tcPluginSolve = solveFundep , tcPluginStop = const $ pure ()+#if __GLASGOW_HASKELL__ >= 904+ , tcPluginRewrite = \ _ -> emptyUFM+#endif } @@ -213,9 +216,15 @@ -> Type -> TcPluginM (Unification, Ct) mkWantedForce fc given = do+#if __GLASGOW_HASKELL__ >= 904+ ((ev, _), _) <- unsafeTcPluginTcM+ . runTcS+ $ newWantedEq (fcLoc fc) emptyRewriterSet Nominal wanted given+#else (ev, _) <- unsafeTcPluginTcM . runTcSDeriveds $ newWantedEq (fcLoc fc) Nominal wanted given+#endif pure ( Unification (OrdType wanted) (OrdType given) , CNonCanonical ev )@@ -308,12 +317,23 @@ :: ( IORef (S.Set Unification) , PolysemyStuff 'Things )+#if __GLASGOW_HASKELL__ >= 904+ -> EvBindsVar -> [Ct] -> [Ct]+ -> TcPluginM TcPluginSolveResult+#else -> [Ct]+ -> [Ct]+ -> [Ct] -> TcPluginM TcPluginResult+#endif solveFundep _ _ _ [] = pure $ TcPluginOk [] []+#if __GLASGOW_HASKELL__ >= 904+solveFundep (ref, stuff) _ given wanted = do+#else solveFundep (ref, stuff) given _ wanted = do+#endif let wanted_finds = getFindConstraints stuff wanted given_finds = getFindConstraints stuff given extra_wanted = getExtraEvidence stuff wanted
src/Polysemy/Plugin/Fundep/Stuff.hs view
@@ -20,6 +20,9 @@ import GHC.Tc.Plugin (getTopEnv) import GHC.Utils.Panic (pprPanic) import GHC.Driver.Env (hsc_units)+#if __GLASGOW_HASKELL__ >= 904+import GHC.Types.PkgQual (PkgQual(NoPkgQual))+#endif #else import GHC.Plugins (unitState) import GHC.Utils.Outputable(pprPanic)@@ -91,7 +94,12 @@ dflags #endif (mkModuleName "Polysemy")- Nothing of+#if __GLASGOW_HASKELL__ >= 904 + NoPkgQual+#else+ Nothing +#endif+ of LookupHidden _ _ -> error_msg LookupNotFound _ -> error_msg #if __GLASGOW_HASKELL__ >= 806