constraints-extras 0.3.0.1 → 0.3.0.2
raw patch · 5 files changed
+27/−13 lines, 5 filesdep ~basedep ~constraintsdep ~template-haskellPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, constraints, template-haskell
API changes (from Hackage documentation)
- Data.Constraint.Extras: argDict' :: forall f c g a. (Has' c f g) => f a -> Dict (c (g a))
+ Data.Constraint.Extras: argDict' :: forall f c g a. Has' c f g => f a -> Dict (c (g a))
- Data.Constraint.Extras: argDictV :: forall f c g v. (HasV c f g) => f v -> Dict (c (v g))
+ Data.Constraint.Extras: argDictV :: forall f c g v. HasV c f g => f v -> Dict (c (v g))
- Data.Constraint.Extras: has :: forall c f a r. (Has c f) => f a -> (c a => r) -> r
+ Data.Constraint.Extras: has :: forall c f a r. Has c f => f a -> (c a => r) -> r
- Data.Constraint.Extras: has' :: forall c g f a r. (Has' c f g) => f a -> (c (g a) => r) -> r
+ Data.Constraint.Extras: has' :: forall c g f a r. Has' c f g => f a -> (c (g a) => r) -> r
- Data.Constraint.Extras: hasV :: forall c g f v r. (HasV c f g) => f v -> (c (v g) => r) -> r
+ Data.Constraint.Extras: hasV :: forall c g f v r. HasV c f g => f v -> (c (v g) => r) -> r
- Data.Constraint.Extras: whichever :: forall c t a r. (ForallF c t) => (c (t a) => r) -> r
+ Data.Constraint.Extras: whichever :: forall c t a r. ForallF c t => (c (t a) => r) -> r
Files
- ChangeLog.md +4/−0
- README.lhs +1/−1
- README.md +1/−1
- constraints-extras.cabal +16/−7
- src/Data/Constraint/Extras/TH.hs +5/−4
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for constraints-extras +## 0.3.0.2 - 2019-09-30++* Update version bounds for GHC 8.8+ ## 0.3.0.1 - 2019-05-17 * Drop markdown-unlit in favor of using regular "Bird"-style LHS to avoid some cross-compilation problems
README.lhs view
@@ -1,4 +1,4 @@-constraints-extras+constraints-extras [](https://travis-ci.org/obsidiansystems/constraints-extras) ================== Example usage:
README.md view
@@ -1,4 +1,4 @@-constraints-extras+constraints-extras [](https://travis-ci.org/obsidiansystems/constraints-extras) ================== Example usage:
constraints-extras.cabal view
@@ -1,5 +1,5 @@ name: constraints-extras-version: 0.3.0.1+version: 0.3.0.2 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@@ -7,12 +7,19 @@ license-file: LICENSE author: Cale Gibbard, Ali Abrar maintainer: maintainer@obsidian.systems+homepage: https://github.com/obsidiansystems/constraints-extras+bug-reports: https://github.com/obsidiansystems/constraints-extras/issues copyright: Obsidian Systems LLC build-type: Simple-cabal-version: >=2.0+cabal-version: 2.0+tested-with:+ GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1 extra-source-files: README.md ChangeLog.md +flag build-readme+ default: True+ library exposed-modules: Data.Constraint.Extras , Data.Constraint.Extras.TH@@ -25,16 +32,18 @@ , TypeOperators , ConstraintKinds , TemplateHaskell- build-depends: base >=4.9 && <4.13- , constraints >= 0.9 && < 0.11- , template-haskell >=2.11 && <2.15+ build-depends: base >=4.9 && <4.14+ , constraints >= 0.9 && < 0.12+ , template-haskell >=2.11 && <2.16 hs-source-dirs: src default-language: Haskell2010 executable readme- build-depends: base >=4.9 && <4.13+ if !flag(build-readme)+ buildable: False+ build-depends: base >=4.9 && <4.14 , aeson- , constraints >= 0.9 && < 0.11+ , constraints >= 0.9 && < 0.12 , constraints-extras main-is: README.lhs ghc-options: -Wall -optL -q
src/Data/Constraint/Extras/TH.hs view
@@ -1,11 +1,11 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-}+ module Data.Constraint.Extras.TH (deriveArgDict, deriveArgDictV, gadtIndices) where -import Data.Constraint.Extras import Data.Constraint-import Data.Either+import Data.Constraint.Extras import Data.Maybe import Control.Monad import Language.Haskell.TH@@ -28,13 +28,14 @@ |] {-# DEPRECATED deriveArgDictV "Just use 'deriveArgDict'" #-}+deriveArgDictV :: Name -> Q [Dec] deriveArgDictV = deriveArgDict matches :: Name -> Name -> Name -> Q [Match] matches c n argDictName = do x <- newName "x" reify n >>= \case- TyConI (DataD _ _ _ _ cons _) -> fmap concat $ forM cons $ \case+ TyConI (DataD _ _ _ _ constrs _) -> fmap concat $ forM constrs $ \case GadtC [name] _ _ -> return $ [Match (RecP name []) (NormalB $ ConE 'Dict) []] ForallC _ _ (GadtC [name] bts (AppT _ (VarT b))) -> do@@ -75,7 +76,7 @@ gadtIndices :: Name -> Name -> Q [Either Type Type] gadtIndices c n = reify n >>= \case- TyConI (DataD _ _ _ _ cons _) -> fmap concat $ forM cons $ \case+ TyConI (DataD _ _ _ _ constrs _) -> fmap concat $ forM constrs $ \case GadtC _ _ (AppT _ typ) -> return [Right typ] ForallC _ _ (GadtC _ bts (AppT _ (VarT _))) -> fmap concat $ forM bts $ \case (_, AppT t (VarT _)) -> do