10

I wonder, isn't there a way to compile a Haskell project in release mode with Stack? There's no nothing related to "release" in stack --help. How can I compile it in Release mode then?

1 Answers1

16

There is no such thing as "release mode". Perhaps you want to enable more optimization? In that case, pass in --ghc-options -O2. Alternatively, add -O2 to ghc-options: in your cabal file. Then, you can use stack build --fast to override this with -O0 which will build faster but optimize less.

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
mgsloan
  • 3,245
  • 21
  • 20