title: Using Map on a list of tuples and print it as flat string in Erlang
body: <p>I have a list of tuples: </p>
  
  <pre><code>X = [{"alpha","beta"},{"gamma","theta"}].
  </code></pre>
  
  <p>I want to print X as a flat string using, <code>io_lib:format("~s", [X])</code> in the following format:</p>
  
  <pre><code>[{"x":"alpha", "y":"beta"}, {"x":"gamma", "y":"theta"}]
  </code></pre>
  
  <p>How do I achieve this? I started using Map to do transform the list. But I was not able to print it as a string...(gave an unbound variable error on X).</p>