Difference between revisions of "SearchPath"

From HaskellWiki
Jump to navigation Jump to search
(initial content)
 
(+cat)
 
Line 1: Line 1:
  +
[[Category:Applications]]
= SearchPath =
 
 
SearchPath does '''automatic import chasing across the internet for haskell modules.'''
 
SearchPath does '''automatic import chasing across the internet for haskell modules.'''
   

Latest revision as of 11:38, 13 January 2007

SearchPath does automatic import chasing across the internet for haskell modules.

by Alex Jacobson

copyright (c) 2004-2006 HAppS LLC BSD Licensed

Requirements

  • Curl/wget
  • GHC

How to install

curl http://searchpath.org/searchpath/SearchPath.hs > SearchPath.hs
ghc --make SearchPath.hs -o sp

How to use

Wrap your call to your haskell compiler/interpreter with a call to searchpath. Intersperse --internet URL options with your other -i command line options. The program will look recursively find the import statements in any module you pass on the command line, look up those module names in the directories passed in the --internet option, and download the modules into subdirectories of the cache directory. It will then execute your compiler replacing the --internet options with -i options pointing to the corresponding subdirectory. For example:

searchpath ghc MyModule.hs OtherModule -isomeDir --internet localModules.map -iotherdir --internet https://searchpath.org/default.map -iotherDir2 -cache cache

Or:

runhugs SearchPath.hs ghc MyModule.hs OtherModule -isomeDir --internet localModules.map -iotherdir --internet https://searchpath.org/default.map -iotherDir2 -cache cache

will result in the download of all the modules it can find in each directory and execute:

ghc MyModule.hs OtherModule -isomeDir --icache/internet1 -iotherdir -icache/internet2 -iotherDir2

Mapfiles have the form:

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

Warning: If you rely on non-https URLs, you are at risk of getting owned by bad people.

How to improve

darcs get http://searchpath.org/searchpath
cd searchpath