SearchPath

S. Alexander Jacobson alex at alexjacobson.com
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:

   HAppS      http://happs.org
   *.*.HaXml  http://www.cs.york.ac.uk/fp/darcs/HaXml/src

So, any module that starts with HAppS can be found at HAppS.org.  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 
transformation:

   HAppS.ACID -> http://happs.org/HAppS/Acid.(hs|lhs)
   Text.XML.HaXml.Escape -> http://www.cs.york.ac.uk/fp/darcs/HaXml/src/Text/XML/HaXml/Escape.(hs|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 
modules.

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?

-Alex-

______________________________________________________________
S. Alexander Jacobson tel:917-770-6565 http://alexjacobson.com













> "S. Alexander Jacobson" <alex at alexjacobson.com> 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 http://www.scannedinavian.org/~lemmih/hackage/
>
> with dependencies here:
> http://www.scannedinavian.org/~lemmih/packages/
>
> peace,
>
>  isaac
>
> ** CRM114 Whitelisted by: ijones at syntaxpolice.org **
>



More information about the Libraries mailing list