title: Scala - Safely get element from multidimensional array
body: <pre><code>val arr = Array.fill[String](6, 6)("dark")
  </code></pre>
  
  <p>Unsafe get:</p>
  
  <pre><code> arr(9)(9)
  &gt;java.lang.ArrayIndexOutOfBoundsException: 9
  </code></pre>
  
  <p>I use something like that (but ugly):</p>
  
  <pre><code>arr.lift(2).flatMap(_.lift(2))
  
  &gt;res0: Option[String] = Some(dark)
  </code></pre>
  
  <p>Is there better way?</p>