title: Haskell: getting the static type of an expression
body: <p>I'm looking for a function that does what the GHCi :type command does.</p>
  
  <p>Ideally, it would have a signature something like</p>
  
  <pre><code>getStaticType :: a -&gt; String
  
  a = getStaticType (1+2)
  -- a = "(Num t) =&gt; t"
  
  b = getStaticType zipWith
  -- b = "(a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]"
  </code></pre>
  
  <p>(Note: this has nothing to do with Data.Dynamic.  I just want the static type inferred from the compiler.  In fact the function wouldn't need a runtime implementation at all, as all calls to it could be inlined as constants at compile time.  I'm assuming it exists somewhere, since GHCi can do it)</p>