title: Generate a function using Template Haskell
body: <p>Is it possible to define a function using Template Haskell? For example </p>
  
  <pre><code>convertStringToValue :: String -&gt; Int
  convertStringToValue "three" = 3
  convertStringToValue "four" = 4
  </code></pre>
  
  <p>I also have a <code>Map [Char] Int</code>.</p>
  
  <pre><code>fromList [("five",5),("six",6)]
  </code></pre>
  
  <p>How can I add functions </p>
  
  <pre><code>convertStringToValue "six" = 6
  convertStringToValue "five" = 5
  </code></pre>
  
  <p>at compile time using Template Haskell and the <code>Map</code>? It appears quite silly to use Template Haskell for this purpose but I would like to know nevertheless. </p>