Turning on assertions while compiling with Haskell's stack build system -


i using stack 9.0 haskell build system project.

i've noticed when compile haskell project stack, assertions switched off. contrast while doing "normal" ghc builds @ command-line, assertions turned on default unless explicitly switched off -fignore-asserts flag (link).

for instance simple main function fails throw assertion error

import control.exception.base  main :: io () main = assert (1==2) $ print "hello world!" 

how edit .cabal file of project turn on assertions? inside .cabal file see following ghc options

 ghc-options: -threaded -rtsopts -with-rtsopts=-n 

which strange because assertions have not been explicitly turned off within list.

edit:

i have version 1.1.2 x86_64 hpack-0.14.0 after running stack --version. in particular, using stack lts 9.0 ghc 8.0.2

try passing in --fast flag, disable optimizations (via --ghc-options -o0) , allow assertions run.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -