compdata-param 0.8.0.2 → 0.9
raw patch · 14 files changed
+15/−15 lines, 14 filesdep ~compdata
Dependency ranges changed: compdata
Files
- compdata-param.cabal +3/−3
- src/Data/Comp/Param/Derive/Equality.hs +1/−1
- src/Data/Comp/Param/Derive/Injections.hs +0/−0
- src/Data/Comp/Param/Derive/Ordering.hs +1/−1
- src/Data/Comp/Param/Derive/Projections.hs +0/−0
- src/Data/Comp/Param/Derive/Show.hs +1/−1
- src/Data/Comp/Param/Derive/SmartConstructors.hs +0/−0
- src/Data/Comp/Param/Multi/Derive/Equality.hs +1/−1
- src/Data/Comp/Param/Multi/Derive/Ordering.hs +1/−1
- src/Data/Comp/Param/Multi/Derive/Show.hs +1/−1
- src/Data/Comp/Param/Multi/Derive/SmartConstructors.hs +1/−1
- src/Data/Comp/Param/Multi/HDifunctor.hs +1/−1
- src/Data/Comp/Param/Multi/Ops.hs +3/−3
- src/Data/Comp/Param/Multi/Term.hs +1/−1
compdata-param.cabal view
@@ -1,5 +1,5 @@ Name: compdata-param-Version: 0.8.0.2+Version: 0.9 Synopsis: Parametric Compositional Data Types Description: @@ -89,7 +89,7 @@ Data.Comp.Param.Multi.Derive.Injections Data.Comp.Param.Multi.Derive.Projections - Build-Depends: base >= 4.7, base < 5, template-haskell, mtl, transformers, compdata >= 0.8 && < 0.10+ Build-Depends: base >= 4.7, base < 5, template-haskell, mtl, transformers, compdata >= 0.10 && < 0.11 hs-source-dirs: src ghc-options: -W @@ -98,7 +98,7 @@ Type: exitcode-stdio-1.0 Main-is: Tests.hs hs-source-dirs: testsuite/tests examples- Build-Depends: base >= 4.7, base < 5, template-haskell, mtl, transformers, compdata >= 0.8 && < 0.10, HUnit,+ Build-Depends: base >= 4.7, base < 5, template-haskell, mtl, transformers, compdata >= 0.10 && < 0.11, HUnit, test-framework, test-framework-hunit, containers, compdata-param source-repository head
src/Data/Comp/Param/Derive/Equality.hs view
@@ -49,7 +49,7 @@ else [clause [wildP,wildP] (normalB [|return False|]) []] eqDDecl <- funD 'eqD (map (eqDClause conArg coArg) constrs' ++ defC)- let context = map (\arg -> ClassP ''Eq [arg]) argNames+ let context = map (\arg -> mkClassP ''Eq [arg]) argNames return [InstanceD context classType [eqDDecl]] where eqDClause :: Name -> Name -> (Name,[Type]) -> ClauseQ eqDClause conArg coArg (constr, args) = do
src/Data/Comp/Param/Derive/Injections.hs view
src/Data/Comp/Param/Derive/Ordering.hs view
@@ -45,7 +45,7 @@ -- constrs' = [(X,[c]), (Y,[a,c]), (Z,[b -> c])] constrs' :: [(Name,[Type])] <- mapM normalConExp constrs compareDDecl <- funD 'compareD (compareDClauses conArg coArg constrs')- let context = map (\arg -> ClassP ''Ord [arg]) argNames+ let context = map (\arg -> mkClassP ''Ord [arg]) argNames return [InstanceD context classType [compareDDecl]] where compareDClauses :: Name -> Name -> [(Name,[Type])] -> [ClauseQ] compareDClauses _ _ [] = []
src/Data/Comp/Param/Derive/Projections.hs view
src/Data/Comp/Param/Derive/Show.hs view
@@ -56,7 +56,7 @@ -- constrs' = [(X,[c]), (Y,[a,c]), (Z,[b -> c])] constrs' :: [(Name,[Type])] <- mapM normalConExp constrs showDDecl <- funD 'showD (map (showDClause conArg coArg) constrs')- let context = map (\arg -> ClassP ''Show [arg]) argNames+ let context = map (\arg -> mkClassP ''Show [arg]) argNames return [InstanceD context classType [showDDecl]] where showDClause :: Name -> Name -> (Name,[Type]) -> ClauseQ showDClause conArg coArg (constr, args) = do
src/Data/Comp/Param/Derive/SmartConstructors.hs view
src/Data/Comp/Param/Multi/Derive/Equality.hs view
@@ -43,7 +43,7 @@ else [clause [wildP,wildP] (normalB [|return False|]) []] eqHDDecl <- funD 'eqHD (map (eqHDClause conArg coArg) constrs' ++ defC)- let context = map (\arg -> ClassP ''Eq [arg]) argNames+ let context = map (\arg -> mkClassP ''Eq [arg]) argNames return [InstanceD context classType [eqHDDecl]] where eqHDClause :: Name -> Name -> (Name,[Type]) -> ClauseQ eqHDClause conArg coArg (constr, args) = do
src/Data/Comp/Param/Multi/Derive/Ordering.hs view
@@ -44,7 +44,7 @@ let classType = AppT (ConT ''OrdHD) complType constrs' :: [(Name,[Type])] <- mapM normalConExp constrs compareHDDecl <- funD 'compareHD (compareHDClauses conArg coArg constrs')- let context = map (\arg -> ClassP ''Ord [arg]) argNames+ let context = map (\arg -> mkClassP ''Ord [arg]) argNames return [InstanceD context classType [compareHDDecl]] where compareHDClauses :: Name -> Name -> [(Name,[Type])] -> [ClauseQ] compareHDClauses _ _ [] = []
src/Data/Comp/Param/Multi/Derive/Show.hs view
@@ -51,7 +51,7 @@ let classType = AppT (ConT ''ShowHD) complType constrs' :: [(Name,[Type])] <- mapM normalConExp constrs showHDDecl <- funD 'showHD (map (showHDClause conArg coArg) constrs')- let context = map (\arg -> ClassP ''Show [arg]) argNames+ let context = map (\arg -> mkClassP ''Show [arg]) argNames return [InstanceD context classType [showHDDecl]] where showHDClause :: Name -> Name -> (Name,[Type]) -> ClauseQ showHDClause conArg coArg (constr, args) = do
src/Data/Comp/Param/Multi/Derive/SmartConstructors.hs view
@@ -36,7 +36,7 @@ liftM concat $ mapM (genSmartConstr (map tyVarBndrName targs) tname) cons where iTp iVar (ForallC _ cxt _) = -- Check if the GADT phantom type is constrained- case [y | EqualP x y <- cxt, x == VarT iVar] of+ case [y | Just (x, y) <- map isEqualP cxt, x == VarT iVar] of [] -> Nothing tp:_ -> Just tp iTp _ _ = Nothing
src/Data/Comp/Param/Multi/HDifunctor.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, Rank2Types,- TypeOperators, GADTs #-}+ TypeOperators, GADTs, IncoherentInstances #-} -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Param.Multi.HDifunctor
src/Data/Comp/Param/Multi/Ops.hs view
@@ -72,12 +72,12 @@ infixr 8 :*: -- |Formal product of signatures (higher-order difunctors).-data (f :*: g) a b = f a b :*: g a b+data (f :*: g) a b i = f a b i :*: g a b i -ffst :: (f :*: g) a b -> f a b+ffst :: (f :*: g) a b :-> f a b ffst (x :*: _) = x -fsnd :: (f :*: g) a b -> g a b +fsnd :: (f :*: g) a b :-> g a b fsnd (_ :*: x) = x
src/Data/Comp/Param/Multi/Term.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE EmptyDataDecls, GADTs, KindSignatures, Rank2Types,- MultiParamTypeClasses, TypeOperators, ScopedTypeVariables #-}+ MultiParamTypeClasses, TypeOperators, ScopedTypeVariables, IncoherentInstances #-} -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Param.Multi.Term