title: Haskell - exit a program with a specified error code
body: <p>In Haskell, is there a way to exit a program with a specified error code? The resources I've been reading typically point to the <code>error</code> function for exiting a program with an error, but it seems to always terminate the program with an error code of <code>1</code>. </p>
  
  <pre><code>[martin@localhost Haskell]$ cat error.hs
  main = do
      error "My English language error message"
  [martin@localhost Haskell]$ ghc error.hs
  [1 of 1] Compiling Main             ( error.hs, error.o )
  Linking error ...
  [martin@localhost Haskell]$ ./error 
  error: My English language error message
  [martin@localhost Haskell]$ echo $?
  1
  </code></pre>