constraints-extras 0.3.2.0 → 0.3.2.1
raw patch · 5 files changed
+22/−7 lines, 5 filesdep ~basedep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, template-haskell
API changes (from Hackage documentation)
Files
- ChangeLog.md +6/−2
- README.lhs +1/−0
- README.md +1/−0
- constraints-extras.cabal +4/−4
- src/Data/Constraint/Extras/TH.hs +10/−1
ChangeLog.md view
@@ -1,10 +1,14 @@ # Revision history for constraints-extras -## 0.3.2.0+## 0.3.2.1 - 2021-12-17 +* Support GHC 9.2++## 0.3.2.0 - 2021-10-28+ * Provide `ArgDict` instances for sums of functors. -## 0.3.1.0+## 0.3.1.0 - 2021-03-24 * Allow deriving instances with `deriveArgDict` for data and newtype family instances by supplying the name of one of its constructors * Support GHC 9.0.1
README.lhs view
@@ -13,6 +13,7 @@ > {-# LANGUAGE TemplateHaskell #-} > {-# LANGUAGE TypeApplications #-} > {-# LANGUAGE TypeFamilies #-}+> {-# LANGUAGE FlexibleContexts #-} > {-# LANGUAGE FlexibleInstances #-} > {-# LANGUAGE MultiParamTypeClasses #-} > {-# LANGUAGE UndecidableInstances #-}
README.md view
@@ -13,6 +13,7 @@ > {-# LANGUAGE TemplateHaskell #-} > {-# LANGUAGE TypeApplications #-} > {-# LANGUAGE TypeFamilies #-}+> {-# LANGUAGE FlexibleContexts #-} > {-# LANGUAGE FlexibleInstances #-} > {-# LANGUAGE MultiParamTypeClasses #-} > {-# LANGUAGE UndecidableInstances #-}
constraints-extras.cabal view
@@ -1,5 +1,5 @@ name: constraints-extras-version: 0.3.2.0+version: 0.3.2.1 synopsis: Utility package for constraints description: Convenience functions and TH for working with constraints. See <https://github.com/obsidiansystems/constraints-extras/blob/develop/README.md README.md> for example usage. category: Constraints@@ -13,7 +13,7 @@ build-type: Simple cabal-version: 2.0 tested-with:- GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.1 || ==9.0.1+ GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.1 || ==9.0.1 || ==9.2.1 extra-source-files: README.md ChangeLog.md @@ -32,9 +32,9 @@ , TypeOperators , ConstraintKinds , TemplateHaskell- build-depends: base >=4.9 && <4.16+ build-depends: base >=4.9 && <4.17 , constraints >= 0.9 && < 0.14- , template-haskell >=2.11 && <2.18+ , template-haskell >=2.11 && <2.19 hs-source-dirs: src default-language: Haskell2010
src/Data/Constraint/Extras/TH.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-}@@ -52,10 +53,18 @@ Nothing -> WildP : rest done Just _ -> VarP v : rest True pat = foldr patf (const []) ps False- in [Match (ConP name pat) (NormalB $ AppE (VarE argDictName) (VarE v)) []]+ in [Match (conPCompat name pat) (NormalB $ AppE (VarE argDictName) (VarE v)) []] ForallC _ _ (GadtC [name] _ _) -> return $ [Match (RecP name []) (NormalB $ ConE 'Dict) []] a -> error $ "deriveArgDict matches: Unmatched 'Dec': " ++ show a++conPCompat :: Name -> [Pat] -> Pat+conPCompat name =+ ConP+ name+#if MIN_VERSION_template_haskell(2, 18, 0)+ []+#endif kindArity :: Kind -> Int kindArity = \case