[Git][haskell-team/DHG_packages][master] haskell-derive: patch for new derive
Gianfranco Costamagna
gitlab at salsa.debian.org
Mon Jun 25 10:51:54 BST 2018
Gianfranco Costamagna pushed to branch master at Debian Haskell Group / DHG_packages
Commits:
ed1e8335 by Gianfranco Costamagna at 2018-06-25T11:51:00+02:00
haskell-derive: patch for new derive
- - - - -
5 changed files:
- p/haskell-derive/debian/changelog
- p/haskell-derive/debian/control
- + p/haskell-derive/debian/files
- + p/haskell-derive/debian/patches/7e3ed185e1bd97ce02bc146e7abc3d78d76da2e2.patch
- p/haskell-derive/debian/patches/series
Changes:
=====================================
p/haskell-derive/debian/changelog
=====================================
--- a/p/haskell-derive/debian/changelog
+++ b/p/haskell-derive/debian/changelog
@@ -1,8 +1,13 @@
-haskell-derive (2.6.3-3) UNRELEASED; urgency=medium
+haskell-derive (2.6.3-3) unstable; urgency=medium
+ [ Clint Adams ]
* Set Rules-Requires-Root to no.
- -- Clint Adams <clint at debian.org> Sun, 06 May 2018 22:09:33 -0400
+ [ Gianfranco Costamagna ]
+ * debian/patches/7e3ed185e1bd97ce02bc146e7abc3d78d76da2e2.patch:
+ - upstream patch for new derive (Closes: #895876).
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org> Mon, 25 Jun 2018 11:41:10 +0200
haskell-derive (2.6.3-2) unstable; urgency=medium
=====================================
p/haskell-derive/debian/control
=====================================
--- a/p/haskell-derive/debian/control
+++ b/p/haskell-derive/debian/control
@@ -9,8 +9,8 @@ Build-Depends:
ghc (>= 8),
ghc-prof,
haskell-devscripts (>= 0.13),
- libghc-src-exts-dev (>= 1.18),
- libghc-src-exts-dev (<< 1.20),
+ libghc-src-exts-dev (>= 1.20),
+ libghc-src-exts-dev (<< 1.21),
libghc-src-exts-prof,
libghc-syb-dev,
libghc-syb-prof,
=====================================
p/haskell-derive/debian/files
=====================================
--- /dev/null
+++ b/p/haskell-derive/debian/files
@@ -0,0 +1 @@
+haskell-derive_2.6.3-3_source.buildinfo haskell optional
=====================================
p/haskell-derive/debian/patches/7e3ed185e1bd97ce02bc146e7abc3d78d76da2e2.patch
=====================================
--- /dev/null
+++ b/p/haskell-derive/debian/patches/7e3ed185e1bd97ce02bc146e7abc3d78d76da2e2.patch
@@ -0,0 +1,138 @@
+## Description: add some description
+## Origin/Author: add some origin or author
+## Bug: bug URL
+From 7e3ed185e1bd97ce02bc146e7abc3d78d76da2e2 Mon Sep 17 00:00:00 2001
+From: Igor Pashev <pashev.igor at gmail.com>
+Date: Fri, 15 Jun 2018 21:31:43 +0200
+Subject: [PATCH] Rewrite for haskell-src-exts == 1.20.*
+
+Ref. "Deriving Strategies"
+at https://github.com/haskell-suite/haskell-src-exts/commit/e478378fab3cde02cd0d88898caac021423973f3
+---
+ derive.cabal | 2 +-
+ src/Data/Derive/DSL/HSE.hs | 4 ++--
+ src/Data/Derive/UniplateDirect.hs | 4 ++--
+ src/Derive/Derivation.hs | 10 ++++++----
+ src/Derive/Test.hs | 2 +-
+ src/Language/Haskell/Convert.hs | 4 ++--
+ 6 files changed, 14 insertions(+), 12 deletions(-)
+
+diff --git a/derive.cabal b/derive.cabal
+index 011c030..951b836 100644
+--- a/derive.cabal
++++ b/derive.cabal
+@@ -38,7 +38,7 @@ library
+ base == 4.*,
+ filepath, syb, template-haskell, containers, pretty,
+ directory, process, bytestring,
+- haskell-src-exts >= 1.18 && < 1.20,
++ haskell-src-exts == 1.20.*,
+ transformers >= 0.2,
+ uniplate >= 1.5 && < 1.7
+
+diff --git a/src/Data/Derive/DSL/HSE.hs b/src/Data/Derive/DSL/HSE.hs
+index 28f8fbf..0acd170 100644
+--- a/src/Data/Derive/DSL/HSE.hs
++++ b/src/Data/Derive/DSL/HSE.hs
+@@ -23,7 +23,7 @@ list = Input "List" 1 [Ctor "Nil" 0 0, Ctor "Cons" 1 2]
+
+ -- data Sample a = First | Second a a | Third a
+ sample :: Input
+-sample = DataDecl () (DataType ()) Nothing (DHApp () (DHead () $ name "Sample") (tyVarBind "a")) ctrs Nothing
++sample = DataDecl () (DataType ()) Nothing (DHApp () (DHead () $ name "Sample") (tyVarBind "a")) ctrs []
+ where
+ ctrs = [ctr "First" 0, ctr "Second" 2, ctr "Third" 1]
+ ctr s i = QualConDecl () Nothing Nothing $ ConDecl () (name s) $ replicate i $ tyVar "a"
+@@ -90,7 +90,7 @@ fromOutput (OList xs) = res
+ f [] = fromConstr $ readCon dat "[]"
+ f (x:xs) = fromConstrB (g x (f xs `asTypeOf` res)) $ readCon dat "(:)"
+ dat = dataTypeOf res
+-
++
+ g :: (Data a, Data b) => Output -> a -> b
+ g x xs = r2 where r2 = if typeOf r2 == typeOf xs then coerce xs else fromOutput x
+
+diff --git a/src/Data/Derive/UniplateDirect.hs b/src/Data/Derive/UniplateDirect.hs
+index fb152ba..215aeeb 100644
+--- a/src/Data/Derive/UniplateDirect.hs
++++ b/src/Data/Derive/UniplateDirect.hs
+@@ -224,10 +224,10 @@ knownCtors = map (fromParseResult . fmap clearAnn . parseDecl)
+
+ listCtor = DataDecl () (DataType ()) Nothing (DHApp () (DHead () $ Ident () "[]") (UnkindedVar () $ Ident () "a"))
+ [QualConDecl () Nothing Nothing $ ConDecl () (Ident () "[]") []
+- ,QualConDecl () Nothing Nothing $ ConDecl () (Ident () "(:)") [tyVar "a", TyList () $ tyVar "a"]] Nothing
++ ,QualConDecl () Nothing Nothing $ ConDecl () (Ident () "(:)") [tyVar "a", TyList () $ tyVar "a"]] []
+
+ tupleDefn :: Int -> Decl ()
+-tupleDefn n = DataDecl () (DataType ()) Nothing dhead [QualConDecl () Nothing Nothing $ ConDecl () (Ident () s) (map tyVar vars)] Nothing
++tupleDefn n = DataDecl () (DataType ()) Nothing dhead [QualConDecl () Nothing Nothing $ ConDecl () (Ident () s) (map tyVar vars)] []
+ where s = "(" ++ replicate (n - 1) ',' ++ ")"
+ vars = ['v':show i | i <- [1..n]]
+ dhead = foldr (flip (DHApp ())) (DHead () $ Ident () s) (map (UnkindedVar () . Ident ()) vars)
+diff --git a/src/Derive/Derivation.hs b/src/Derive/Derivation.hs
+index fd4dad7..6807ee1 100644
+--- a/src/Derive/Derivation.hs
++++ b/src/Derive/Derivation.hs
+@@ -31,15 +31,17 @@ wantDeriveAnnotation real mine = moduleDerives mine \\ moduleDerives real
+
+
+ moduleDerives :: Module () -> [Type ()]
+-moduleDerives = concatMap f . moduleDecls
++moduleDerives = concatMap f . moduleDecls
+ where
+ f (DataDecl _ _ _ (fromDeclHead -> (name, vars)) _ deriv) = g name vars deriv
+ f (GDataDecl _ _ _ (fromDeclHead -> (name, vars)) _ _ deriv) = g name vars deriv
+- f (DerivDecl _ _ (fromIParen -> IRule _ _ _ (fromInstHead -> (name, args)))) = [TyCon () name `tyApps` args]
++ f (DerivDecl _ _ _ (fromIParen -> IRule _ _ _ (fromInstHead -> (name, args)))) = [TyCon () name `tyApps` args]
+ f _ = []
+
+- g name vars deriv = [TyCon () a `tyApps` (b:bs) | IRule _ _ _ (fromInstHead -> (a,bs)) <- map fromIParen $ maybe [] (\(Deriving _ xs) -> xs) deriv]
++ g name vars deriv = [TyCon () a `tyApps` (b:bs) | IRule _ _ _ (fromInstHead -> (a,bs)) <- map fromIParen $ f deriv]
+ where b = TyCon () (UnQual () name) `tyApps` map (tyVar . prettyPrint) vars
++ f [Deriving _ _ xs] = xs
++ f _ = []
+
+
+ ---------------------------------------------------------------------
+@@ -85,7 +87,7 @@ writeDerive :: FilePath -> ModuleName () -> [Flag] -> [String] -> IO ()
+ writeDerive file modu flags xs = do
+ -- force the output first, ensure that we don't crash half way through
+ () <- length (concat xs) `seq` return ()
+-
++
+ let append = Append `elem` flags
+ let output = [x | Output x <- flags]
+
+diff --git a/src/Derive/Test.hs b/src/Derive/Test.hs
+index 794f71d..e8bf2c0 100644
+--- a/src/Derive/Test.hs
++++ b/src/Derive/Test.hs
+@@ -34,7 +34,7 @@ listType = DataDecl () (DataType ()) Nothing (DHApp () (DHead () (Ident () "[]")
+ ,QualConDecl () Nothing Nothing (ConDecl () (Ident () "Cons")
+ [TyVar () (Ident () "a")
+ ,TyApp () (TyCon () (UnQual () (Ident () "List"))) (TyVar () (Ident () "a"))])]
+- Nothing
++ []
+
+
+ -- test each derivation
+diff --git a/src/Language/Haskell/Convert.hs b/src/Language/Haskell/Convert.hs
+index 3724555..6438669 100644
+--- a/src/Language/Haskell/Convert.hs
++++ b/src/Language/Haskell/Convert.hs
+@@ -44,13 +44,13 @@ instance Convert TH.Dec (HS.Decl ()) where
+ NewtypeD cxt n vs _ con ds -> f (NewType ()) cxt n vs [con] ds
+ where
+ f :: DataOrNew () -> Cxt -> TH.Name -> [TyVarBndr] -> [Con] -> unused -> HS.Decl ()
+- f t cxt n vs con _ = DataDecl () t (Just $ c cxt) (dh (c n) (c vs)) (c con) Nothing
++ f t cxt n vs con _ = DataDecl () t (Just $ c cxt) (dh (c n) (c vs)) (c con) []
+ #else
+ DataD cxt n vs con ds -> f (DataType ()) cxt n vs con ds
+ NewtypeD cxt n vs con ds -> f (NewType ()) cxt n vs [con] ds
+ where
+ f :: DataOrNew () -> Cxt -> TH.Name -> [TyVarBndr] -> [Con] -> [TH.Name] -> HS.Decl ()
+- f t cxt n vs con ds = DataDecl () t (Just $ c cxt) (dh (c n) (c vs)) (c con) Nothing
++ f t cxt n vs con ds = DataDecl () t (Just $ c cxt) (dh (c n) (c vs)) (c con) []
+ #endif
+
+ dh name [] = DHead () name
=====================================
p/haskell-derive/debian/patches/series
=====================================
--- a/p/haskell-derive/debian/patches/series
+++ b/p/haskell-derive/debian/patches/series
@@ -1 +1,2 @@
man-page.diff
+7e3ed185e1bd97ce02bc146e7abc3d78d76da2e2.patch
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/commit/ed1e83356fcfa0d7fc0213aa82d1b02d655173ad
--
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/commit/ed1e83356fcfa0d7fc0213aa82d1b02d655173ad
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20180625/f4d66365/attachment-0001.html>
More information about the Pkg-haskell-commits
mailing list