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
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 to rebuild as your code changes.
Execute the binary with
stack run myapp