Skip to content

ghci exit codes and `-e` flag inconsistent

Summary

ghci behaves inconsistently when an -e flag's command fails. Where "abort" means "stop executing and return 1": on 8.6.4, ghci -e blah will abort, :l blah will abort, but :l Blah or :t Blah does not abort.

Steps to reproduce

As above.

Expected behavior

It should be consistent: either never abort on error (which is what interactive mode is like), or always abort on error. I use ghci -e to test that certain things can be loaded, so I'd prefer to always abort. This is similar to how shells work, except they (bash, zsh) default to never abort, but can be switched to always abort with a -e flag.

Environment

  • GHC version used: 8.6.4
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information