[GHC] #1338: base package breakup
GHC
trac at galois.com
Tue Aug 25 10:50:41 EDT 2009
#1338: base package breakup
---------------------------------+------------------------------------------
Reporter: simonmar | Owner:
Type: task | Status: new
Priority: normal | Milestone: 6.12 branch
Component: libraries/base | Version: 6.6.1
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by mokus):
Would it be possible to implement at least as much of this splitting as is
needed to remove all "unsafe" operations from base? I would very much
like to be able to use packages as a 'unit of analysis' for a relatively
simple library I'm working on that attempts to maintain a package database
of "safe" packages (verified not to perform any "dangerous" IO outside the
IO type, for example).
Unfortunately, as it stands now the analysis is polluted from the start
due to base's inclusion of unsafePerformIO, unsafeCoerce, unsafeSTToIO,
the ability to define custom Typeable instances, large parts of the whole
GHC subtree, and possibly other surprises. If these could be removed from
base, it would make things much simpler. At present I am using a "base-
safe" wrapper that uses the PackageImports extension (thanks for that by
the way, it's great!) to export a subset of the base library, but it would
be much cleaner to have base itself be "pure" so that all cabal packages
using it (and build-type Simple and only "safe" language extensions) could
be automatically ruled "pure" as well.
Plus, doesn't it just give you lots of warm fuzzies to think of Haskell's
base library as pure? Or to put it differently, doesn't it just give you
the screaming heebie-jeebies that unsafePerformIO is in base at all? ;)
If proliferation of small packages is a concern, perhaps the split could
be implemented by renaming the existing base to, say, "base-unsafe", and
providing smaller interface wrapper packages using PackageImports as,
e.g., base, st, unsafe-io, unsafe-st, foreign, and so on. I don't know
whether that actually solves whatever the concern is over small packages,
but it would at least allow the interface to be broken up without
requiring as much effort as a full disentanglement of all the module
dependencies.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1338#comment:29>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list