title: Scala - initializing mutable Maps and exposing them as immutable
body: <p>Is there any "good" code pattern for a <code>Class</code> initializing and populating private mutable Maps, and then exposing them as immutable ones? Or should I just eternally regret my functional misconduct in such cases?</p>
  
  <p><em>In a certain Class, I am initializing some Maps as mutable ones</em>, as the logic for initializing them does not fit very naturally, in this one case, with a pure mutable creation approach. Or, I was just lazy to model it immutably.</p>
  
  <p>Now, I get Scala ugly code - after all the initialization computation, I copy-convert the mutable Maps into immutable ones (mostly through <code>.toMap</code>). This is already ugly as (1) the code has double the Maps and the double naming feels a bit off, and (2) the conversion lines look more involved than I'd hope for.</p>
  
  <p>Additionally (3), it is to my disliking that the type definitions of the resulting immutable Maps, can only reside at the bottom of the code now, as they can only be declared after the initialization computation (or, can they be defined <code>lazy</code> and move to the top? still not entirely elegant). </p>
  
  <p>Any way to elegantly wrap up around mutable Maps initialization code?</p>