S. Alexander Jacobson alex at
Tue May 17 14:32:22 EDT 2005

On Tue, 17 May 2005, Isaac Jones wrote:
> You'd just need a way to map module names to package names / versions.

Actually, that's the easy part.  For example, right now my test map 
file is:


So, any module that starts with HAppS can be found at  And 
any module with HaXml at the third level of hierarchy can be found in 
the York HaXml darcs repository. e.g. it does this sort of 

   HAppS.ACID ->|lhs)
   Text.XML.HaXml.Escape ->|lhs)

Once if finds a module, SearchPath downloads it, put it a directory 
for that map file, and add that directory to the module search path.

However, right now it only knows how to find modules in directories. 
It would be nice if the URL could point to a Package file rather than 
a base directory and SearchPath knew how to detect whether it is 
already installed, install it if not, and import chase all its 

It would be even nicer if the URL could point to Cabal files and 
SearchPath knew from the Cabal files what else it needed to download 
to build the package so that the package author can use the URL of a 
cabal file in a repository and doesn't need to bother dealing with 
producing tarballs for each version.

I just don't know Cabal well enough to implement this stuff.  Does 
this make sense?


S. Alexander Jacobson tel:917-770-6565

> "S. Alexander Jacobson" <alex at> writes:
> (snip)
>> Right now SearchPath only supports module directory base URLs in map
>> files.  I'd love for it to support automatic download and build for
>> Cabal file and package URLs as well. I just don't know how to do
>> it. Perhaps you guys can help on this?
> You'd just need a way to map module names to package names / versions.
> One thing you could do is add that kind of lookup to hackage's XML-RPC
> interface, shouldn't be too hard.  Then you can query hackage "what
> package does this module belong to?"; it'll return a list of package
> identifiers (meaning package names / versions) and you' could pick
> among them, download, unpack, and install.
> I'd be fine with adding this to the xml-rpc interface if you want.
> Hopefully Lemmih will speak up if he thinks that's a really bad idea.
> Hackage can be gotten here:
> darcs get
> with dependencies here:
> peace,
>  isaac
> ** CRM114 Whitelisted by: ijones at **

More information about the Libraries mailing list