packages feed

derive 2.5.19 → 2.5.20

raw patch · 7 files changed

+18/−14 lines, 7 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Language.Haskell: dataDeclVarsStar :: DataDecl -> [String]

Files

CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Derive +2.5.20+    #5, fix regression with higher-kinded constructors becoming context 2.5.19     Support GHC 7.10 2.5.18
Data/Derive/DSL/Apply.hs view
@@ -35,7 +35,7 @@             ,out                 [ClassA (UnQual $ Ident c) [TyVar $ Ident v]                 | let seen = [x | TyVar (Ident x) <- universeBi $ concatMap ctorDeclFields $ dataCtors input]-                , v <- dataDeclVars input `intersect` seen+                , v <- dataDeclVarsStar input `intersect` seen                 , c <- ctx]             ,out $ UnQual $ Ident hd             ,out [TyParen $ foldl TyApp
Data/Derive/Data.hs view
@@ -152,4 +152,4 @@     where ctor = dataDeclCtors (snd d) !! fromInteger y  context :: FullDataDecl -> Context -> Context-context d _ = [ClassA (qname t) [tyVar x] | x <- dataDeclVars $ snd d, t <- ["Typeable","Data"]]+context d _ = [ClassA (qname t) [tyVar x] | x <- dataDeclVarsStar $ snd d, t <- ["Typeable","Data"]]
Data/DeriveTH.hs view
@@ -14,7 +14,6 @@ import Language.Haskell.TH.All as TH hiding (Derivation(..),toName) import Language.Haskell as HS import Language.Haskell.Convert-import Data.Generics   -- | Derive an instance of some class. @derive@ only derives instances@@ -35,17 +34,11 @@ -- for the type of the argument. deriveFromDec :: Derivation -> Dec -> Q [Dec] deriveFromDec d x = do-    x <- fmap unkind $ liftM normData $ expandData x+    x <- liftM normData $ expandData x     let unsup x = error $ "Derivation of " ++ derivationName d ++ " does not yet support Template Haskell, requires info for " ++ x     case derivationOp d (tyCon $ derivationName d) unsup $ toFullDataDecl x of         Left y -> runIO (putStrLn $ "Warning, couldn't derive: " ++ y) >> return []         Right v -> return $ convert v--unkind :: Dec -> Dec-unkind = everywhere (mkT f)-    where-        f (KindedTV x _) = PlainTV x-        f x = x  toFullDataDecl :: Dec -> FullDataDecl toFullDataDecl x = (ModuleName "Todo", convert x)
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2006-2014.+Copyright Neil Mitchell 2006-2015. All rights reserved.  Redistribution and use in source and binary forms, with or without
Language/Haskell.hs view
@@ -6,6 +6,7 @@ import Data.Generics.Uniplate.Data import Data.Data import Data.Char+import Data.Maybe   infix 1 ?@@ -257,7 +258,15 @@ dataDeclName (GDataDecl _ _ _ name _ _ _ _) = prettyPrint name  dataDeclVars :: DataDecl -> [String]-dataDeclVars (DataDecl _ _ _ _ vars _ _) = map prettyPrint vars+dataDeclVars (DataDecl _ _ _ _ vars _ _) = map f vars+    where f (KindedVar x _) = prettyPrint x+          f (UnkindedVar x) = prettyPrint x++dataDeclVarsStar :: DataDecl -> [String]+dataDeclVarsStar (DataDecl _ _ _ _ vars _ _) = mapMaybe f vars+    where f (UnkindedVar x) = Just $ prettyPrint x+          f (KindedVar x KindStar) = Just $ prettyPrint x+          f _ = Nothing  dataDeclArity :: DataDecl -> Int dataDeclArity = length . dataDeclVars
derive.cabal view
@@ -1,9 +1,9 @@ cabal-version:  >= 1.6 build-type:     Default name:           derive-version:        2.5.19+version:        2.5.20 build-type:     Simple-copyright:      Neil Mitchell 2006-2014+copyright:      Neil Mitchell 2006-2015 author:         Neil Mitchell <ndmitchell@gmail.com> maintainer:     Neil Mitchell <ndmitchell@gmail.com> homepage:       http://community.haskell.org/~ndm/derive/