cvs commit: hugs98 Makefile RPM.mk hugs98/libraries/tools convert_libraries

ross 2006/09/05 03:04:28 PDT Modified files: . Makefile RPM.mk libraries/tools convert_libraries Log: drop HaXml (no longer builds) Revision Changes Path 1.80 +1 -3 hugs98/Makefile 1.53 +0 -1 hugs98/RPM.mk 1.44 +1 -1 hugs98/libraries/tools/convert_libraries

On Tue, Sep 05, 2006 at 11:35:03AM +0100, Malcolm Wallace wrote:
Ross Paterson
wrote: Modified files: . Makefile RPM.mk libraries/tools convert_libraries Log: drop HaXml (no longer builds)
In what way does HaXml fail to build for Hugs? Is it easily fixable?
There's the use of the cpp symbol VERSION, fixable by adding cc-options: -DVERSION="1.16" or putting the definition in an include file, and there's the famous Data.FiniteMap.

HaXml (no longer builds)
In what way does HaXml fail to build for Hugs? Is it easily fixable?
... and there's the famous Data.FiniteMap.
So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base? Regards, Malcolm

On Tue, Sep 05, 2006 at 12:12:00PM +0100, Malcolm Wallace wrote:
HaXml (no longer builds)
In what way does HaXml fail to build for Hugs? Is it easily fixable?
... and there's the famous Data.FiniteMap.
So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base?
I'd rather see HaXml updated to use Data.Map, perhaps with a compatibility layer for older GHCs.

On Tue, 2006-09-05 at 12:19 +0100, Ross Paterson wrote:
On Tue, Sep 05, 2006 at 12:12:00PM +0100, Malcolm Wallace wrote:
HaXml (no longer builds)
In what way does HaXml fail to build for Hugs? Is it easily fixable?
... and there's the famous Data.FiniteMap.
So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base?
I'd rather see HaXml updated to use Data.Map, perhaps with a compatibility layer for older GHCs.
Using a compatibility layer is not that easy at the moment. There is a feature which will likely go into some upcoming version of Cabal that will make it easier to depend on different packages (eg a compat-finitemap) depending on what packages versions we are building against. For example you'd put something like the following in the .cabal file: configuration: package(base >= 2.0) build-depends: compat-finitemap However since this feature is not available yet it's rather hard to add a compatibility layer. Generating the .cabal file is a no-no. Duncan

On Tue, Sep 05, 2006 at 02:21:31PM +0200, Duncan Coutts wrote:
On Tue, 2006-09-05 at 12:19 +0100, Ross Paterson wrote:
On Tue, Sep 05, 2006 at 12:12:00PM +0100, Malcolm Wallace wrote:
So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base?
I'd rather see HaXml updated to use Data.Map, perhaps with a compatibility layer for older GHCs.
Using a compatibility layer is not that easy at the moment.
It's not that hard. Cabal itself does it for several packages, including Data.Map.

Duncan Coutts wrote:
On Tue, 2006-09-05 at 12:19 +0100, Ross Paterson wrote:
On Tue, Sep 05, 2006 at 12:12:00PM +0100, Malcolm Wallace wrote:
HaXml (no longer builds)
In what way does HaXml fail to build for Hugs? Is it easily fixable?
... and there's the famous Data.FiniteMap.
So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base?
I'd rather see HaXml updated to use Data.Map, perhaps with a compatibility layer for older GHCs.
Using a compatibility layer is not that easy at the moment. There is a feature which will likely go into some upcoming version of Cabal that will make it easier to depend on different packages (eg a compat-finitemap) depending on what packages versions we are building against. For example you'd put something like the following in the .cabal file:
configuration: package(base >= 2.0) build-depends: compat-finitemap
However since this feature is not available yet it's rather hard to add a compatibility layer. Generating the .cabal file is a no-no.
No problem - compat-finitemap can provide Compat.Data.Map with a Data.Map-like interface, which it implements either in terms of Data.Map or Data.FiniteMap. Then you *unconditionally* depend on compat-finitemap, and use Compat.Data.Map everywhere. Later, when you're ready to drop support for GHC 6.2.x, you drop the dependency on compat-finitemap and change every import Compat.Data.Map to Data.Map. Alternatively, compat-finitemap can provide a FiniteMap-like interface. This puts off the inevitable refactoring of the code to use the Data.Map-like interface until a later date. Cheers, Simon

So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base?
I'd rather see HaXml updated to use Data.Map, perhaps with a compatibility layer for older GHCs.
OK, I've looked more closely at all uses of Data.FiniteMap in HaXml, and they are far from critical, so have reverted them to using simpler lookup structures. As far as I can tell, none of my other software now depends on FiniteMap either, so I withdraw the threat to resuscitate it. (Sorry Duncan!) Regards, Malcolm

On Tue, Sep 05, 2006 at 02:13:33PM +0100, Malcolm Wallace wrote:
So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base?
I'd rather see HaXml updated to use Data.Map, perhaps with a compatibility layer for older GHCs.
OK, I've looked more closely at all uses of Data.FiniteMap in HaXml, and they are far from critical, so have reverted them to using simpler lookup structures.
Why not do it the other way round: #if __GLASGOW_HASKELL__ >= 604 || __NHC__ >= 118 || defined(__HUGS__) -- Data.Map, if it is available import Prelude hiding (lookup) import Data.Map (Map, lookup, fromList) #else -- otherwise, a very simple and inefficient implementation of a finite map type Map k a = [(k,a)] fromList :: [(k,a)] -> Map k a fromList = id -- Prelude.lookup :: k -> Map k a -> Maybe a #endif

Ross Paterson
Why not do it the other way round:
#if __GLASGOW_HASKELL__ >= 604 || __NHC__ >= 118 || defined(__HUGS__) -- Data.Map, if it is available import Prelude hiding (lookup) import Data.Map (Map, lookup, fromList) #else
Fair enough. Like I say, these lookup structures are not critical. For many simple XML documents, ordinary lists might actually be faster for lookups, despite their worse asymptotic complexity... Does this mean you can re-instate HaXml as a package built by default with Hugs? Regards, Malcolm

On Tue, Sep 05, 2006 at 02:59:21PM +0100, Malcolm Wallace wrote:
Fair enough. Like I say, these lookup structures are not critical. For many simple XML documents, ordinary lists might actually be faster for lookups, despite their worse asymptotic complexity...
Does this mean you can re-instate HaXml as a package built by default with Hugs?
Done, though only in the kitchen sink version. Since the May 2006 release the minimal version has had only the base, haskell98 and Cabal packages.

On Tue, 2006-09-05 at 12:12 +0100, Malcolm Wallace wrote:
HaXml (no longer builds)
In what way does HaXml fail to build for Hugs? Is it easily fixable?
... and there's the famous Data.FiniteMap.
So does anyone have any objections if I go ahead and commit the replacement (compatibility) implementation of Data.FiniteMap to the main repository for packages/base?
I certainly would not object. It should still be marked deprecated of course, producing suitable warnings. As I said before, I'm happy for it to die by the time of GHC 6.8. Duncan
participants (4)
-
Duncan Coutts
-
Malcolm Wallace
-
Ross Paterson
-
Simon Marlow