The runhs script interpreter


Runhs is a tiny Haskell #! 'interpreter' for source scripts. That is, if your source file starts with #!/path/to/runhs, you can execute it directly from your shell prompt.

Underneath, it uses hmake to build a temporary copy of the program with your default Haskell compiler, then executes it. The temporary copy is cached, so later executions will be faster if the script remains unchanged.

Usage

The basic option summary is:

    Usage: runhs [-e] file [args...]
The -e option does nothing - it it purely for compatibility with the shell. The source file can have a .hs or .lhs extension, or no extension at all. Further args are passed to the script program itself.

The recommended usage of runhs is to place a line like

    #!/usr/local/bin/runhs
at the beginning of your source script, also giving the file execute permission. You can then run the source file directly by typing ./filename in the shell.

The latest updates to this software are available on the WWW from http://www.haskell.org/hmake/ ( http://www.cs.york.ac.uk/fp/hmake/)

Information last updated: 17th May 2005
York Functional Programming Group
Malcolm.Wallace@cs.york.ac.uk