I am learning Hakyll a library in Haskell. I need to run
ghc --make site.hs
However, I instlled ghc with Stack so I can no longer run ghc
but instead stack ghc
$ stack ghc --make site.hs
Invalid option `--make'
How am I supposed to compile my site.hs
??
Stack is interpreting your --make
as being an option to Stack, not to the GHC subcommand. In order to tell Stack "I'm done giving you options, the rest is for the subcommand," you can use a --
, e.g.:
stack ghc -- --make site.hs
the chain of command you are looking for is
> stack build
> stack exec -- mysite
assuming your cabal file looks like
...
executable mysite
main-is: site.hs
hs-source-dirs: app
...
if you want to just try running the file without compilation you can use
> stack runghc app/site.hs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With