title: Conditional Compilation in Haskell submodule
body: <p>I'm trying to have a submodule in my program compile conditionally to switch small parts of the code between release builds and development builds.</p>
  
  <p>Currently I'm attempting to use <a href="http://hackage.haskell.org/package/cpphs-1.17/src/docs" rel="noreferrer">cpphs</a> however when I change the flags passed into GHC to define a variable and change an ifdef statement stack won't recompile those files. </p>
  
  <p>For example, I've got a port number that I want to switch based on which target I have built. The code I have defining this number looks like this.</p>
  
  <pre><code>#ifdef StableRelease 
    port = 12345
  #else 
    port = 54321 
  #endif
  </code></pre>
  
  <p>the stable build has the following options in its cabal file </p>
  
  <pre><code>ghc-options: -threaded -rtsopts -with-rtsopts=-N -pgmP cpphs -optP "-DStableRelease"
  </code></pre>
  
  <p>When I run <code>stack build</code> though it doesn't seem to actually pre-process the code above.
  Does anyone have experience with cpphs or another preprocessing solution? </p>