Run Haskell source files as shell scripts
To run a Haskell source file as a shell script, add one of the following blocks to the top of your source file:
With runhaskell
: 1
With cabal
: 1
With stack
: 2
Then, mark the script as executable: chmod u+x example.hs