Re: [Haskell-cafe] Fwd: typehash patch for base >= 4 && < 4.4

2010-12-02 Thread Malcolm Wallace
I sent a patch to fix this to the maintainer for the typehash  
package (Lennart Augustsson) on the 16th of November, but haven't  
heard anything back - it is possible that he doesn't read the e-mail  
address I sent it to, or is no longer interested in maintaining  
typehash.


Lennart applied your patch and uploaded a new version a couple of days  
ago.


Regards,
Malcolm


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Fwd: typehash patch for base >= 4 && < 4.4

2010-11-29 Thread Andrew Miller

Hi all,

Typehash 1.4.0.0, the latest version of typehash in hackage, has a cabal 
constraint base < 4, making it difficult to use with packages that only 
support newer base versions.


I sent a patch to fix this to the maintainer for the typehash package 
(Lennart Augustsson) on the 16th of November, but haven't heard anything 
back - it is possible that he doesn't read the e-mail address I sent it 
to, or is no longer interested in maintaining typehash.


Does anyone who would be willing to know Lennart in person to confirm 
this? Failing this, does anyone want to be maintainer for the typehash 
package? If I don't hear any better ideas, I could simply upload a 
version 1.4.0.1 with my split base patch applied, and the maintainer 
changed to "haskell-cafe@haskell.org".


Best wishes,
Andrew

 Original Message 
Subject: typehash patch for base >= 4 && < 4.4
Date: Tue, 16 Nov 2010 17:55:13 +1300
From: Andrew Miller 
To: lenn...@augustsson.net

diff -rbud typehash-1.4.0.0/src/Data/TypeHash.hs
typehash-1.4.0.1/src/Data/TypeHash.hs
--- typehash-1.4.0.0/src/Data/TypeHash.hs   2009-10-06 03:43:44.0
+1300
+++ typehash-1.4.0.1/src/Data/TypeHash.hs   2010-11-16 17:43:51.917333177
+1300
@@ -44,7 +44,7 @@

  data Type
  = Name { typeName :: String }-- Abstract type, or
recursive reference
-| Data { typeName :: String, constrs :: [Constructor] }
+| Data { typeName :: String, dconstrs :: [Constructor] }
  deriving (Eq, Ord, Show, Typeable, Data)
  type Constructor = (String, [Field])
  type Field = (String, Type)  -- a unique number is used for missing
field names
@@ -54,7 +54,7 @@
  let tn = show $ fullTypeOf x
  in  case dataTypeRep $ dataTypeOf x of
  AlgRep cs | tn `notElem` tns ->
- Data { typeName = tn, constrs = map (gConstr (tn:tns) x) cs }
+ Data { typeName = tn, dconstrs = map (gConstr (tn:tns) x) cs }
  _ -> Name { typeName = tn } -- Use type name for truly
abstract types and recursive types.

  gConstr :: (Data a) => [String] -> a -> Constr -> (String, [Field])
Only in typehash-1.4.0.1/src/Data: TypeHash.hs~
diff -rbud typehash-1.4.0.0/typehash.cabal typehash-1.4.0.1/typehash.cabal
--- typehash-1.4.0.0/typehash.cabal 2009-10-06 03:43:44.0 +1300
+++ typehash-1.4.0.1/typehash.cabal 2010-11-16 17:40:55.496953710 +1300
@@ -1,5 +1,6 @@
  Name: typehash
-Version:   1.4.0.0
+Cabal-Version:  >= 1.2
+Version:   1.4.0.1
  License:  BSD3
  Author:   Lennart Augustsson
  Maintainer:   Lennart Augustsson
@@ -10,6 +11,18 @@
  Description:  Produce a hash for a type that is unique for that type.
The hash takes both actual type names and type structure into 
account.
This is useful for checking the type of persisted values.
-Hs-Source-Dirs: src
-Build-Depends: base < 4, mtl, bytestring, pureMD5, binary
-Exposed-modules:   Data.TypeHash
+
+Flag base4
+Description: Use base-4.*
+Default:True
+
+Library
+  Hs-Source-Dirs: src
+  Build-Depends: mtl, bytestring, pureMD5, binary
+  If flag(base4)
+Build-Depends:
+  base >= 4 && < 4.4,
+  syb < 0.3
+  else
+Build-Depends: base < 4
+  Exposed-modules: Data.TypeHash

Only in typehash-1.4.0.1: dist
diff -rbud typehash-1.4.0.0/src/Data/TypeHash.hs typehash-1.4.0.1/src/Data/TypeHash.hs
--- typehash-1.4.0.0/src/Data/TypeHash.hs	2009-10-06 03:43:44.0 +1300
+++ typehash-1.4.0.1/src/Data/TypeHash.hs	2010-11-16 17:43:51.917333177 +1300
@@ -44,7 +44,7 @@
 
 data Type
 = Name { typeName :: String }-- Abstract type, or recursive reference
-| Data { typeName :: String, constrs :: [Constructor] }
+| Data { typeName :: String, dconstrs :: [Constructor] }
 deriving (Eq, Ord, Show, Typeable, Data)
 type Constructor = (String, [Field])
 type Field = (String, Type)  -- a unique number is used for missing field names
@@ -54,7 +54,7 @@
 let tn = show $ fullTypeOf x
 in  case dataTypeRep $ dataTypeOf x of
 AlgRep cs | tn `notElem` tns ->
- Data { typeName = tn, constrs = map (gConstr (tn:tns) x) cs }
+ Data { typeName = tn, dconstrs = map (gConstr (tn:tns) x) cs }
 _ -> Name { typeName = tn } -- Use type name for truly abstract types and recursive types.
 
 gConstr :: (Data a) => [String] -> a -> Constr -> (String, [Field])
Only in typehash-1.4.0.1/src/Data: TypeHash.hs~
diff -rbud typehash-1.4.0.0/typehash.cabal typehash-1.4.0.1/typehash.cabal
--- typehash-1.4.0.0/typehash.cabal	2009-10-06 03:43:44.0 +1300
+++ typehash-1.4.0.1/typehash.cabal	2010-11-16 17:40:55.496953710 +1300
@@ -1,5 +1,6 @@
 Name:		typehash
-Version:	1.4.0.0
+Cabal-Version:  >= 1.2
+Version:	1.4.0.1
 License:	BSD3
 Author:		Lennart Augustsson
 Maintainer:	Lennart Augustsson
@@ -10,6 +11,18 @@
 Description:	Produce a hash for a type that is unique for that type.
 		The hash takes both actual type names and type structure