title: Compile-time assertions with GHC Haskell?
body: <p>Coming from C++, I'm used to be able to build simple forms of compile-time assertions, where I could emit warnings or errors during compilation if some simple conditions (e.g. over simple algebraic expressions) weren't met via use of template meta-programming and/or <code>cpp(1)</code></p>
  
  <p>For instance, if I wanted to make sure my program compiles only when <code>Int</code> has at least a certain <code>minBound</code>/<code>maxBound</code> range or alternatively, if a loss-free (as in reversible) conversion from <code>Int64</code> to <code>Int</code> is possible with the current compilation target. Is this possible with some GHC Haskell extension? My first guess would have been to use TH. Are there other GHC facilities that could be exploited to this end?</p>