Heirarchical name space allocation

Adrian Hey ahey at iee.org
Fri Apr 2 07:24:31 EST 2004


On Wednesday 31 Mar 2004 5:02 pm, Sven Panne wrote:
> Adrian Hey wrote:
> > Maybe if we call what I've produced Multimedia.SDL.Core, though since
> > it actually includes SDL_image and SDL_ttf also, maybe I should split
> > these out to produce..
> > 	Multimedia.SDL.Core
> > 	Multimedia.SDL.Image
> > 	Multimedia.SDL.TTF
> > so anybody who felt inclined to write a binding for one of the many
> > SDL extension libraries could use Multimedia.SDL.<whatever>
> > (Or maybe my "Core" binding should still be just Multimedia.SDL?)
>
> "Core" is not very descriptive IMHO, what about staying close to the
> structure of the SDL library documentation (e.g. http://sdldoc.csn.ul.ie/):
>
>     Multimedia.SDL.General
>     Multimedia.SDL.Video
>     Multimedia.SDL.Window
>     Multimedia.SDL.Events
>     ...

What I'm proposing to do is 3 separate packages..
	Multimedia.SDL(.Core perhaps)
	Multimedia.SDL.Image
	Multimedia.SDL.TTF
..because I think it would be nice to have 1:1 correspondance between
Haskell packages and SDL packages (SDL,SDL_image,SDL_ttf). This makes
dependencies clear and means Haskellers won't have to install SDL stuff
they don't need. I think the only real issue is should the core
(I.E. the SDL binding) actually have a .Core suffix?

Let's say it didn't. In the Multimedia directory I have..
	* A directory called SDL
	* A single Haskell source file called SDL.hs which wraps the API
          defined in the various Haskell source files in the SDL directory.

Within the SDL directory the naming of individual source files does indeed
follow the SDL documentation, as you suggest (well up to a point anyway).
But these are all *.hs files that are part of a single library (package).

The naming convention above identifies distinct SDL related libraries (which 
will also have corresponding directories and *.hs files of course, but that's 
not relevant here AFAICS). The point is that the API's of Multimedia.SDL.Image
and Multimedia.SDL.TTF are not exported by Multimedia.SDL, as some might 
expect. Maybe having an explicit .Core suffix would be clearer. (Though we
have a similar situation with Foreign and Foreign.C for example, so I guess 
it's not really an issue).

Regards
--
Adrian Hey




More information about the Libraries mailing list