The cabal run . command works if there’s no command line arguments. However, If the haskell program takes them, the running cabal command cabal run . does not work. So, I should go to the binary directory and run then the binary directly. Is there any shortcut to run with cabal command without going to the build directory to run it?
A helpful abbreviation, if you know you have only one executable in your project, you can also use cabal run exes -- <prog-args>.
The meta-target exes resolves to one executable in this case and runs it.
NB: these meta-targets exist for all kinds of components, e.g. tests, benchmarks, libs, all (for everything), etc…