#710: library reorganisation
-----------------------------+----------------------------------------------
Reporter: simonmar | Owner:
Type: task | Status: new
Priority: normal | Milestone: 6.8
Component: libraries/base | Version: 6.4.1
Severity: normal | Resolution:
Keywords: | Os: Multiple
Difficulty: Unknown | Architecture: Multiple
-----------------------------+----------------------------------------------
Changes (by igloo):
* architecture: Unknown => Multiple
* milestone: => 6.8
* os: Unknown => Multiple
Comment:
I spent some time looking at this. There are a number of issues that need
to be resolved, or at least it would be better if they could be resolved
first:
* Problem using `--make` when compiling the base package ([ticket:
#909]).
* We'd lose the ability to do parallel module building within each
library ([ticket: #910]).
* Currently the implementations don't agree on what `Read` is, as the new
`ReadP` requires rank-2 or rank-n polymorphism. I am told Haskell' will
have one or the other, so this will come in time.
* The code used by default class definitions needs to be pretty low down
in the hierarchy, and in particular `fail s = error s` in the `Monad`
class pulls in the huge exception type. This might be simplified with an
extensible exception replacement?
* For the deps from common packages to impl-specific packages we
obviously need some sort of conditional support in Cabal.
* Standalone deriving declarations (separate from the data declaration)
make some things a lot easier. I think bringert has a working
implementation for GHC, but it only truly helps if it's in all impls;
something for Haskell'?
* It's unfortunate that we can't make imported and exported class
instances explicit, so the compiler won't be checking that we are giving
consistency across impls.
In what follows, I haven't given a huge amount of thought to names, but I
don't think there's any need to do so yet.
My conclusions were that ultimately something like this would be good
(with <impl> replaced with ghc, hugs, ...):
* `<impl>-prim` at the bottom; defines things like the `Int` type
(basically all the types and functions needed by the next layer.
* `base-types-classes` next, which just have class declarations but
probably no instances.
* `<impl>-base next`; This is where all GHC's instances with `I#`'s etc
would go.
* `base` on top of that, with anything that can't be forked off into
another package.
I also managed to fork off
* `array`
* `containers` (`Data.{FunctorM, Foldable, Graph, IntMap, IntSet, Map,
Set, Queue, Sequence, Tree, Traversable`)
* `bytestring`
* `printf`
and it also looked plausible that `io` and/or `concurrency` would also be
able to be pulled out, but by that point I had run into enough of the
issues above that I stopped working on it. The rest can be looked at in
more detail when we come to do this for real.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/710>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs