For simple programs with no dependencies, simply create a .hs file, compile and run it with ghc:

ghc main.hs && ./main

For more complete programs I use Stack.

Initialize Stack (creates a new directory, use --bare to use the current directory).

stack new myapp

Add any dependencies to package.yaml under the “dependencies” section.

Place source files in app directory and then

stack build --file-watch

Execute the binary with

$(stack path --local-install-root)/bin/filename-exe