base package

Joachim Breitner mail at joachim-breitner.de
Fri Feb 22 19:52:00 CET 2013


Hi,

another status report about my base-splitting experiment:

The list of packages has grown to

 * base-pure: Basic stuff without `IO`, `Foreign` or floating point 
   arithmetic. 
 * base-st: The `ST` monad, uses base-pure.
 * base-array: Arrays, uses base-st.
 * base-float: Floating point types, uses base-array internally.
 * base-io: The `IO` monad, uses base-st.
 * base-concurrent: Currently just `MVar`, uses base-io.
 * base-foreign: Everything related to `Foreign`, uses base-io and 
   base-float (for the `Storable` instances for `Double` and `Float`).

Of the (exactly!) 200 modules in base, 83 have not yet been sorted into
these or other packages:

Control/Concurrent.hs
Control/Concurrent/Chan.hs
Control/Concurrent/QSem.hs
Control/Concurrent/QSemN.hs
Control/Concurrent/SampleVar.hs
Control/Exception.hs
Control/Exception/Base.hs
Control/Monad/Instances.hs
Data/Data.hs
Data/Dynamic.hs
Data/Fixed.hs
Data/HashTable.hs
Data/Unique.hs
Data/Version.hs
Debug/Trace.hs
GHC/Conc.lhs
GHC/Conc/IO.hs
GHC/Conc/Signal.hs
GHC/Conc/Sync.lhs
GHC/Conc/Windows.hs
GHC/ConsoleHandler.hs
GHC/Constants.hs
GHC/Desugar.hs
GHC/Environment.hs
GHC/Event.hs
GHC/Event/Array.hs
GHC/Event/Clock.hsc
GHC/Event/Control.hs
GHC/Event/EPoll.hsc
GHC/Event/IntMap.hs
GHC/Event/Internal.hs
GHC/Event/KQueue.hsc
GHC/Event/Manager.hs
GHC/Event/PSQ.hs
GHC/Event/Poll.hsc
GHC/Event/Thread.hs
GHC/Event/Unique.hs
GHC/Exts.hs
GHC/GHCi.hs
GHC/Generics.hs
GHC/Handle.hs
GHC/IO.hs-boot
GHC/IO/Device.hs
GHC/IO/Exception.hs
GHC/IO/Exception.hs-boot
GHC/IO/FD.hs
GHC/IO/Handle.hs
GHC/IO/Handle.hs-boot
GHC/IO/Handle/FD.hs
GHC/IO/Handle/FD.hs-boot
GHC/IO/Handle/Internals.hs
GHC/IO/Handle/Text.hs
GHC/IO/Handle/Types.hs
GHC/IO/IOMode.hs
GHC/IOArray.hs
GHC/IOBase.hs
GHC/IP.hs
GHC/PArr.hs
GHC/Pack.lhs
GHC/Stack.hsc
GHC/Stats.hsc
GHC/TopHandler.lhs
GHC/TypeLits.hs
GHC/Windows.hs
NHC/PosixTypes.hsc
NHC/SizedTypes.hs
Numeric.hs
Prelude.hs
System/CPUTime.hsc
System/Console/GetOpt.hs
System/Environment.hs
System/Environment/ExecutablePath.hsc
System/Exit.hs
System/IO.hs
System/IO/Error.hs
System/Info.hs
System/Mem.hs
System/Mem/StableName.hs
System/Mem/Weak.hs
System/Posix/Types.hs
System/Timeout.hs
Text/Printf.hs

Inspired by a similar graph by Herbert Valerio Riedel, I tried to
visualize the current state and came up with this:
https://github.com/nomeata/packages-base/blob/base-split/graph.pdf?raw=true

It is not completely accurate due to Prelude not included in
-ddump-minimal-imports (but that shouldn’t matter as most interesting
functions of the Prelude are in base-pure). The script to
generate the dot file from *.imports is included in the branch at
https://github.com/nomeata/packages-base/tree/base-split


Next I’d need to see how entangled the system-close stuff is (File IO,
concurrency, GHC.Event.*).


Of course with too much splitting one runs in the Bane of the Orphaned
Instances – neither should base-foreign require base-float nor the other
way around, but "Storable Double" needs to be define somewhere... And
the same question will arise if Data.Date should go to a package of its
own.


Also, I notice that there is an issue with “internal” modules (mostly
GHC.something) that should not be part of some stable API, but needed to
implement packages further down. Should they just not be considered part
of the “public” (and PVP-relevant) API? Or should there be two packages,
e.g. base-pure-internal and base-pure, where the latter re-exports those
modules that are meant for public consumption?


So, what is the general opinion? Is this a way worth pursuing? Or are we
fine with the huge base and I can do different things again ;-)?

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/20130222/46d29b63/attachment.pgp>


More information about the Glasgow-haskell-users mailing list