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

ghc main.hs && ./main

For bigger programs I use Stack.

Initialize Stack (this 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