dependent-sum-template 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+13/−20 lines, 3 filesdep ~template-haskellPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: template-haskell
API changes (from Hackage documentation)
- Data.GADT.Compare.TH: compare' :: forall k a1 (a2 :: k) (b :: k). Ord a1 => a1 -> a1 -> GComparing a2 b ()
+ Data.GADT.Compare.TH: compare' :: forall {k} {a} {a :: k} {b :: k}. Ord a => a -> a -> GComparing a b ()
- Data.GADT.Compare.TH: runGComparing :: forall k (a :: k) (b :: k). GComparing a b (GOrdering a b) -> GOrdering a b
+ Data.GADT.Compare.TH: runGComparing :: forall {k} {a :: k} {b :: k}. GComparing a b (GOrdering a b) -> GOrdering a b
Files
- ChangeLog.md +7/−1
- dependent-sum-template.cabal +3/−1
- src/Data/GADT/TH/Internal.hs +3/−18
ChangeLog.md view
@@ -1,10 +1,16 @@ # Revision history for dependent-sum-template +## 0.2.0.1 - 2023-12-06++* Add back support for GHC 9.2 and 9.4.++ We were able to work around [the bug in `reifyInstances`](https://gitlab.haskell.org/ghc/ghc/-/issues/23743) by using a data family instead of a type family.+ ## 0.2.0.0 - 2023-08-01 * Recover compatibility with template-haskell 2.18, which was lost in 0.1.2.0 * deriveGShow will generate code that uses Show instances for every argument to a constructor, apart from those of the type that it is generating an instance for.-* Drop support for GHC 9.2 and 9.4 due to [a bug in reifyInstances](https://gitlab.haskell.org/ghc/ghc/-/issues/23743)+* Drop support for GHC 9.2 and 9.4 due to [a bug in `reifyInstances`](https://gitlab.haskell.org/ghc/ghc/-/issues/23743) ## 0.1.2.0 - 2023-07-11
dependent-sum-template.cabal view
@@ -1,5 +1,5 @@ name: dependent-sum-template-version: 0.2.0.0+version: 0.2.0.1 stability: experimental cabal-version: >= 1.10@@ -19,6 +19,8 @@ GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2,+ GHC == 9.2.5,+ GHC == 9.4.5, GHC == 9.6.1 extra-source-files: ChangeLog.md
src/Data/GADT/TH/Internal.hs view
@@ -6,14 +6,12 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}-{-# LANGUAGE DataKinds #-} -- | Shared functions for dependent-sum-template module Data.GADT.TH.Internal where import Control.Monad import Control.Monad.Writer-import qualified Data.Kind import Data.List (foldl', drop) import Data.Maybe import Data.Map (Map)@@ -36,8 +34,8 @@ in (h, x : reversedParams) _ -> (headOfType t, []) --- Do not export this type family, it must remain empty. It's used as a way to trick GHC into not unifying certain type variables.-type family Skolem :: k -> k+-- Do not export this data family, it must remain empty. It's used as a way to trick GHC into not unifying certain type variables.+data family Skolem :: k -> k skolemize :: Set Name -> Type -> Type skolemize rigids t = case t of@@ -52,21 +50,8 @@ ParensT t -> ParensT (skolemize rigids t) _ -> t -reifyInstancesBroken :: Q Bool-reifyInstancesBroken = do- a <- newName "a"- ins <- reifyInstancesWithRigids' (Set.singleton a) ''Show [VarT a]- pure $ not $ null ins--reifyInstancesWithRigids' :: Set Name -> Name -> [Type] -> Q [InstanceDec]-reifyInstancesWithRigids' rigids cls tys = reifyInstances cls (map (skolemize rigids) tys)- reifyInstancesWithRigids :: Set Name -> Name -> [Type] -> Q [InstanceDec]-reifyInstancesWithRigids rigids cls tys = do- isBroken <- reifyInstancesBroken- if isBroken- then fail "Unsupported GHC version: 'reifyInstances' in this version of GHC returns instances when we expect an empty list. See https://gitlab.haskell.org/ghc/ghc/-/issues/23743"- else reifyInstancesWithRigids' rigids cls tys+reifyInstancesWithRigids rigids cls tys = reifyInstances cls (map (skolemize rigids) tys) -- | Determine the type variables which occur freely in a type. freeTypeVariables :: Type -> Set Name