Usage

All you need in order to use HsUnix is the hsunix-config script. The simplest way to compile some Haskell shell script script.hs is to type ghc -o script script.hs `hsunix-config`.

The more general way is to set up a directory for Haskell shell scripts with a Makefile. See An Example Makefile for Your Hakell Scripts for an example of how to do this.

The hsunix-config script

This script is meant to be used inside backticks in another command, like “ghc -c -o script.o script.hs `hsunix-config –-cflags`”.

hsunix-config --cflags will output the flags for the GHC compiler which are needed to compile programs which use HsUnix.

hsunix-config --libs will output the flags for the linking stage which are needed to link programs which use HsUnix.

hsunix-config will output both. This is useful when compiling and linking directly, without an intermediate .o file.