Qustions about hierarchaly library conventions

Simon Marlow simonmar@microsoft.com
Thu, 5 Jun 2003 09:31:26 +0100


=20
> I have a qustion about a convention when writing a hierarchal library.
>=20
> Lets say I have a library
>=20
> 	A.B.C
>=20
> with modules
>=20
> 	A.B.C
> 	     C1.hs
> 	     C2.hs
> 	     C3.hs
>=20
> Is there a convention (official or not) as to when there is a parent
> module (in the example above, C.hs) that imports and re-exports the
> various sub-modules?

There are some suggestions here (see "Module naming conventions"):

http://www.haskell.org/hierarchical-modules/libraries/layout.html

Further ideas for fleshing this out are welcome.

> For example, in the standard libraries, there is a Foreign module that
> re-exports most of Foreign.*.  But there isn't a=20
> System.Posix; you have
> to import the System.Posix.Signal and System.Posix.Types individually.

There is a System.Posix.  It's in the 'unix' package, but you don't have
to say anything to get it:

Prelude> System.Posix.epochTime >>=3D print
Loading package unix ... linking ... done.
1054801650

Having the documentation separated into packages is perhaps the
confusing thing here - System.Posix.Signals and System.Posix.Types are
in the base package, whereas the rest of System.Posix is in the unix
package. =20

Cheers,
	Simon