title: How to get the type as a String in Haskell?
body: <p>Let's say I have a type MyType defined in module My.Module. I want to have the String "My.Module.MyType" (or something like that). If I just type the String directly, I might have a typo, and if the module or type name changes, I'd like to know at compile time.</p>
  
  <p>Ah, there appears there might be confusion about what I'm asking. Please look at the question carefully. Given the code:</p>
  
  <pre><code>module My.Module
  type MyType = Int
  data MyType2 = MyConstructor2 Int
  main = do
    putStrLn $ theMagic MyType
    putStrLn $ theMagic MyType2
  </code></pre>
  
  <p>The output I want is:</p>
  
  <pre><code>My.Module.MyType
  My.Module.MyType2
  </code></pre>
  
  <p>I'm looking for the type name, not the type definition. typeOf would output Int and such, that's not what I want.</p>