base package (Was: GHC 7.8 release?)
Joachim Breitner
mail at joachim-breitner.de
Thu Feb 14 15:48:51 CET 2013
Hi,
Am Donnerstag, den 14.02.2013, 02:21 +0000 schrieb Ian Lynagh:
> On Wed, Feb 13, 2013 at 07:32:06PM +0100, Joachim Breitner wrote:
> >
> > I have started a wikipage with the list of all modules from base,
> for a
> > first round of shuffling, grouping and brainstorming:
> >
> > http://hackage.haskell.org/trac/ghc/wiki/SplitBase
>
> Great, thanks for taking the lead on this!
lets see how far that leads goes...
Yesterday, I experimented a bit with base’s code, first beginning with
as few modules as possible and adding what’s required; then starting
with the whole thing and trying to remove e.g. IO.
But clearly it is not easy:
1. Int requires throw DivideByZero; Monad requires error. That
pulls in Exceptions.
2. Exceptions require Typeable.
3. Typeable is implemented with GHC.Fingerprint.
4. GHC.Fingerprint is implemented with Foreign and IO.
5. Foreign clearly needs Int and the like.
so it is not clear how to pull out a pure base without IO and Foreign.
Are there any good tricks how to break these interdependencies?
Maybe it is possible to have a pure base without the Monad class and
without some of the operations on Int that throw exceptions, but that
wold hardly be useable.
There are other issues, some avoidable (such as the hard-coded base:Num
constraint on literals); I collected a list on
http://hackage.haskell.org/trac/ghc/wiki/SplitBase
Maybe the proper is to reverse the whole approach: Leave base as it is,
and then build re-exporting smaller packages (e.g. a base-pure) on top
of it. The advantage is:
* No need to rewrite the tightly intertwined base.
* Libraries still have the option to have tighter dependencies.
* Base can evolve with lots of breaking changes, as long as they
do not affect the API by the smaller packages.
* Development of this collection can happen outside the GHC tree.
* Alternative implementations for (some of) these packages can be
created, if the reason why they could not be moved out of base
is one of implementation, not of API
How does that sound?
Greetings,
Joachim
--
Joachim "nomeata" Breitner
Debian Developer
nomeata at debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
JID: nomeata at joachim-breitner.de | http://people.debian.org/~nomeata
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20130214/b7b64c9d/attachment.pgp>
More information about the Glasgow-haskell-users
mailing list