summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKingoftheHomeless <>2020-09-15 07:33:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-09-15 07:33:00 (GMT)
commit52a556171c567257369024f52dcd9012f4de3877 (patch)
treee33bd2c849b9aaacb7e2f16b62cff974ea06493f
parent6dc2b3e197a8df7b4dd8e751834ffa83df29e66d (diff)
version 0.2.5.1HEAD0.2.5.1master
-rw-r--r--ChangeLog.md7
-rw-r--r--polysemy-plugin.cabal10
-rw-r--r--src/Polysemy/Plugin.hs1
-rw-r--r--src/Polysemy/Plugin/Fundep.hs7
-rw-r--r--src/Polysemy/Plugin/Fundep/Unification.hs7
-rw-r--r--src/Polysemy/Plugin/Fundep/Utils.hs3
6 files changed, 25 insertions, 10 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index 5fdfe20..b932c69 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,7 +1,12 @@
# Changelog for polysemy-plugin
-## 0.2.5.0 (2020-10-14)
+## 0.2.5.1 (2020-09-15)
+
+- The plugin now works on GHC 8.10 (thanks to @googleson78)
+
+## 0.2.5.0 (2020-02-14)
+
- Updated the lower bounds to `polysemy-1.3.0.0` because of changes to
`polysemy` internals
- Updated the test suite to test against `polysemy-1.3.0.0`.
diff --git a/polysemy-plugin.cabal b/polysemy-plugin.cabal
index 7318b2c..001d92d 100644
--- a/polysemy-plugin.cabal
+++ b/polysemy-plugin.cabal
@@ -1,13 +1,13 @@
cabal-version: 1.24
--- This file has been generated from package.yaml by hpack version 0.31.2.
+-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
--- hash: 48094f708e51c9466f041c84159f98dd8116f8573bdf02908880f68e2d8ed787
+-- hash: 0f4635d86ee9b6424b575257afd4fc1a42b0ddbbf2270bdcb1a71b8e54f0226d
name: polysemy-plugin
-version: 0.2.5.0
+version: 0.2.5.1
synopsis: Disambiguate obvious uses of effects.
description: Please see the README on GitHub at <https://github.com/isovector/polysemy/tree/master/polysemy-plugin#readme>
category: Polysemy
@@ -55,7 +55,7 @@ library
base >=4.9 && <5
, containers >=0.5 && <0.7
, ghc >=8.4.4 && <9
- , ghc-tcplugins-extra >=0.3 && <0.4
+ , ghc-tcplugins-extra >=0.3 && <0.5
, polysemy >=1.3
, syb >=0.7 && <0.8
, transformers >=0.5.2.0 && <0.6
@@ -85,7 +85,7 @@ test-suite polysemy-plugin-test
, containers >=0.5 && <0.7
, doctest >=0.16.0.1 && <0.17
, ghc >=8.4.4 && <9
- , ghc-tcplugins-extra >=0.3 && <0.4
+ , ghc-tcplugins-extra >=0.3 && <0.5
, hspec >=2.6.0 && <3
, inspection-testing >=0.4.2 && <0.5
, polysemy >=1.3.0.0
diff --git a/src/Polysemy/Plugin.hs b/src/Polysemy/Plugin.hs
index c04423f..96c5119 100644
--- a/src/Polysemy/Plugin.hs
+++ b/src/Polysemy/Plugin.hs
@@ -64,6 +64,7 @@ module Polysemy.Plugin
import Polysemy.Plugin.Fundep
#if __GLASGOW_HASKELL__ >= 810
import Polysemy.Plugin.Phases
+import Data.Bool (bool)
#endif
import GhcPlugins
diff --git a/src/Polysemy/Plugin/Fundep.hs b/src/Polysemy/Plugin/Fundep.hs
index 4a90964..2e5ba84 100644
--- a/src/Polysemy/Plugin/Fundep.hs
+++ b/src/Polysemy/Plugin/Fundep.hs
@@ -1,5 +1,6 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE CPP #-}
------------------------------------------------------------------------------
-- The MIT License (MIT)
@@ -46,6 +47,9 @@ import Polysemy.Plugin.Fundep.Utils
import TcEvidence
import TcPluginM (TcPluginM, tcPluginIO)
import TcRnTypes
+#if __GLASGOW_HASKELL__ >= 810
+import Constraint
+#endif
import TcSMonad hiding (tcLookupClass)
import Type
@@ -195,7 +199,7 @@ exactlyOneWantedForR wanteds
-- work?
. fmap (second (/= 1))
. countLength
- $ fmap (OrdType . fcRow) wanteds
+ $ OrdType . fcRow <$> wanteds
solveFundep
@@ -237,4 +241,3 @@ solveFundep (ref, stuff) given _ wanted = do
tcPluginIO $ modifyIORef ref $ S.union $ S.fromList unifications
pure $ TcPluginOk (solveBogusError stuff wanted) new_wanteds
-
diff --git a/src/Polysemy/Plugin/Fundep/Unification.hs b/src/Polysemy/Plugin/Fundep/Unification.hs
index 5012ae1..e0613cd 100644
--- a/src/Polysemy/Plugin/Fundep/Unification.hs
+++ b/src/Polysemy/Plugin/Fundep/Unification.hs
@@ -1,9 +1,16 @@
+{-# LANGUAGE CPP #-}
+
module Polysemy.Plugin.Fundep.Unification where
import Data.Bool
import Data.Function (on)
import qualified Data.Set as S
+#if __GLASGOW_HASKELL__ >= 810
+import Constraint
+#else
import TcRnTypes
+#endif
+
import Type
diff --git a/src/Polysemy/Plugin/Fundep/Utils.hs b/src/Polysemy/Plugin/Fundep/Utils.hs
index 145b8c1..905e3cc 100644
--- a/src/Polysemy/Plugin/Fundep/Utils.hs
+++ b/src/Polysemy/Plugin/Fundep/Utils.hs
@@ -21,7 +21,7 @@ whenA
-> m a
-> m (z a)
whenA False _ = pure empty
-whenA True ma = fmap pure ma
+whenA True ma = pure <$> ma
------------------------------------------------------------------------------
@@ -30,4 +30,3 @@ countLength :: Eq a => [a] -> [(a, Int)]
countLength as =
let grouped = group as
in zipWith (curry $ bimap head length) grouped grouped
-