packages feed

ghc-typelits-natnormalise 0.7.1 → 0.7.2

raw patch · 3 files changed

+13/−4 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,8 @@ # Changelog for the [`ghc-typelits-natnormalise`](http://hackage.haskell.org/package/ghc-typelits-natnormalise) package +## 0.7.2 *March 9 2020*+* Fixes [#44](https://github.com/clash-lang/ghc-typelits-natnormalise/issues/44) infinite loop due to boxed equality+ ## 0.7.1 *February 6th 2020* * Add support for GHC 8.10.1-alpha2 * Fixes [#23](https://github.com/clash-lang/ghc-typelits-natnormalise/issues/23): Can't figure out `+` commutes in some contexts on GHC 8.6.3
ghc-typelits-natnormalise.cabal view
@@ -1,5 +1,5 @@ name:                ghc-typelits-natnormalise-version:             0.7.1+version:             0.7.2 synopsis:            GHC typechecker plugin for types of kind GHC.TypeLits.Nat description:   A type checker plugin for GHC that can solve /equalities/ and /inequalities/
src/GHC/TypeLits/Normalise.hs view
@@ -183,7 +183,8 @@ #if MIN_VERSION_ghc(8,6,0) import Plugins    (purePlugin) #endif-import PrelNames  (knownNatClassName)+import PrelNames  (hasKey, knownNatClassName)+import PrelNames  (eqTyConKey, heqTyConKey) import TcEvidence (EvTerm (..)) #if MIN_VERSION_ghc(8,6,0) import TcEvidence (evCast)@@ -192,7 +193,7 @@ import TcPluginM  (zonkCt) #endif import TcPluginM  (TcPluginM, tcPluginTrace, tcPluginIO)-import Type       (Kind, PredType, eqType, mkTyVarTy)+import Type       (Kind, PredType, eqType, mkTyVarTy, tyConAppTyCon_maybe) import TysWiredIn (typeNatKind)  import Coercion   (CoercionHole, Role (..), mkUnivCo)@@ -257,6 +258,11 @@ isEqPrimPred = isEqPred #endif +isEqPredClass :: PredType -> Bool+isEqPredClass ty = case tyConAppTyCon_maybe ty of+  Just tc -> tc `hasKey` eqTyConKey || tc `hasKey` heqTyConKey+  _ -> False+ -- | To use the plugin, add -- -- @@@ -392,7 +398,7 @@         , let ev = ctEvidence ct               prd = ctEvPred ev         , isGiven ev-        , not $ (\p -> isEqPred p || isEqPrimPred p) prd+        , not $ (\p -> isEqPred p || isEqPrimPred p || isEqPredClass p) prd         ]   in filter       (\(_, (prd, _, _)) ->