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?
Asked
Active
Viewed 5,252 times
10
1 Answers
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
-
1can I pass --ghc-options -O2 to stack build? or only to cabal? – Apr 29 '16 at 07:41
-
3@OskarK. Why not check out [Stack's documentation](http://docs.haskellstack.org/en/stable/GUIDE/#flags-and-ghc-options)? – Jan Gerlinger Apr 29 '16 at 14:20