using haskell as a shell language

Hal Daume hdaume@ISI.EDU
Tue, 6 Nov 2001 00:48:12 GMT


Hi,

As we all know well, we can write scripts like:

#!/usr/bin/perl -w
print "foo"



and whatnot.  i'd like to be able to write something like:


#!/usr/local/ghc/bin/ghc
main = do putStrLn "foo"



and whatnot, even if I have to explicitely say something like:

#!/usr/local/ghc/bin/ghc
module Main(main) where
main = do putStrLn "foo"



it doesn't really matter.  but i'd like to be able to write something
like this, chmod +x it and be able to execute it, interpreted.

i have *no* idea what the semantics of #!... is in shell scripts, so i
don't know if it's easy or hard to hack something like this together,
but if anyone has any pointer (or if anyone's done something like this
before), please please please let me know.

thanks!

 - hal

-- 
Hal Daume III

 "Computer science is no more about computers    | hdaume@isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume