title: How to convert one map to another map in scala
body: <p>I have ane map that maps ids to integers. I need to create another map which will map ids to a particular type (interval) which has a tuple of integers.     </p>
  
  <pre class="lang-scala prettyprint-override"><code>val secondValue = 5
  input: Map[Identifier, Integer]
  val newInput: Map[Identifier, Interval] = input.map({
         case (x, d) =&gt; (x -&gt; Interval(d, secondValue))
  })
  </code></pre>
  
  <p>Interval is defined in a file and it is imported here. This code does not work as newInput is not changed. Can you guide me where I am doing wrong?</p>
  
  <p>The required type of input is Identifier -> Integer and newInput is Identifier -> [Integer, Integer], but I am getting Identifier -> Integer for both input and newInput.</p>