library reorganisation

This mailing list seems to be an appropriate place to discuss: http://cvs.haskell.org/trac/ghc/ticket/710 Rather than keep adding comments to the ticket, I'll continue the discussion here. I don't suggest changing the module name of Text.Html. Ross suggests moving it to the network package - I'm abivalent about that. A completely separate package (html) would be fine by me. In reply to maeder: yes the package boundaries do reflect implementation dependencies. I don't think this is a big problem. In theory we could rename /everything/ in base to be PackageBase.* and then re-export the actual interfaces from a bunch of separate packages, but that doesn't really buy much, and it's a lot of work. Having said that, I'm open to arguments for extracting Data.Array.* into a separate package. I almost suggested removing Text.Printf, but it seems too small to put in a package of its own and I don't know where else to put it :-) If we had a separate 'text' package it could go there, maybe with Text.PrettyPrint? Cheers, Simon

On 02.03 12:22, Simon Marlow wrote:
I don't suggest changing the module name of Text.Html. Ross suggests moving it to the network package - I'm abivalent about that. A completely separate package (html) would be fine by me.
I think that we should have one package that implements the real networking (sockets, name resolving etc) and a separate package that manages various network related data formats. Having Network.HTML but Text.XML.* seems quite illogical.
In reply to maeder: yes the package boundaries do reflect implementation dependencies. I don't think this is a big problem. In theory we could rename /everything/ in base to be PackageBase.* and then re-export the actual interfaces from a bunch of separate packages, but that doesn't really buy much, and it's a lot of work.
I think it would be nice to have implementation dependent code (GHC.*) and implementation independent code in separate packages. Currently there is no way to know whether a Cabal package depending on base wants Data.List or GHC.Something. - Einar Karttunen

Einar Karttunen wrote:
I think it would be nice to have implementation dependent code (GHC.*) and implementation independent code in separate packages. Currently there is no way to know whether a Cabal package depending on base wants Data.List or GHC.Something.
Right, base shouldn't expose anything from GHC.*, and we should have a separate package that does provide these interfaces. However, I don't think this is at all easy to arrange. The lowest package would then be 'ghc', with 'base' on top (it can't be the other way around, because 'base' is implemented using 'ghc'). Furthermore, 'ghc' would contain a lot of implementation independent parts, simply because a lot of GHC.* modules use things like Data.List. And there are recursive dependencies between GHC.* and other implementation-indepenent modules. This doesn't look terribly practical, I'm afraid. I just had an interesting idea though: if a package could re-expose modules from a dependent package, then we could provide a new view of the base package with the GHC.* modules hidden. This is tantalising, because it seems easy to implement... I must think about this some more. Cheers, Simon

On Fri, Mar 03, 2006 at 11:46:30AM +0000, Simon Marlow wrote:
I just had an interesting idea though: if a package could re-expose modules from a dependent package, then we could provide a new view of the base package with the GHC.* modules hidden. This is tantalising, because it seems easy to implement... I must think about this some more.
FWIW, this is what I plan to allow in jhc for just that reason. (it would also allow the reexporting module to be re-optimized with a smaller world assumption, with the caveat being possible code duplication for programs that use Jhc.* directly) although jhc libraries and ghc packages arn't quite the same, they are pretty similar in most user-visible ways. John -- John Meacham - ⑆repetae.net⑆john⑈

Simon Marlow
I almost suggested removing Text.Printf, but it seems too small to put in a package of its own and I don't know where else to put it :-)
Is there some "ideal" package size? If one module is too small, but the current size of the base package is too large...
I don't suggest changing the module name of Text.Html. Ross suggests moving it to the network package - I'm abivalent about that. A completely separate package (html) would be fine by me. ... If we had a separate 'text' package it could go there, maybe with Text.PrettyPrint?
A separate 'text' package seems like a useful concept, to accumulate various textual file formats and text-processing libraries. How about it initially contains these: Text.Html Text.Regex Text.PrettyPrint.* Text.ParserCombinators.* Text.Printf Regards, Malcolm

Malcolm Wallace wrote:
Simon Marlow
wrote: I almost suggested removing Text.Printf, but it seems too small to put in a package of its own and I don't know where else to put it :-)
Is there some "ideal" package size? If one module is too small, but the current size of the base package is too large...
Heh. Good question. Packages are the unit of versioning, distribution, licensing, and a few other things. Given this, you put the boundaries where they are most useful: if you want to version and upgrade a set of modules as a unit, then it makes sense to make them a package. If a set of modules is under a particular license, then they have to be packaged separately from modules under different licenses. There are a bunch of practical issues to deal with too, though. Too many tiny packages would get confusing. Huge packages take a long time (and a lot of memory) to compile, and generate huge library files, which take a long time to link against. Recursive module dependencies determine boundaries to some extent, because packages can't be mutually recursive. So by "too large" I mean too large mainly for practical reasons, any by "too small" I mean that the unit doesn't really merit having a package all to itself, because it wouldn't be useful.
A separate 'text' package seems like a useful concept, to accumulate various textual file formats and text-processing libraries. How about it initially contains these:
Text.Html Text.Regex Text.PrettyPrint.* Text.ParserCombinators.* Text.Printf
Sounds good. I was wondering about putting Text.Regex into a separate regex package. Text.ParserCombinators.ReadP is required to be in base at the moment, BTW. Cheers, Simon
participants (4)
-
Einar Karttunen
-
John Meacham
-
Malcolm Wallace
-
Simon Marlow