title: Workaround for chained indexing Scala compiler error?
body: <p>Chained indexing in ND4S and Breeze produces a Scala compiler error:</p>
  
  <pre><code>var m = Nd4j.create(2, 3)
  var a = m(0, -&gt;)
  var b = a(0)
  var c = m(0, -&gt;)(0)
  </code></pre>
  
  <p>The first two work but the third produces:</p>
  
  <blockquote>
    <p>not enough arguments for method apply: (implicit ev: org.nd4s.NDArrayEvidence[org.nd4j.linalg.api.ndarray.INDArray,B], implicit ev2: scala.reflect.Manifest[B])org.nd4j.linalg.api.ndarray.INDArray in class RichINDArray.</p>
  </blockquote>
  
  <p>I tried with <code>(0, 0)</code> instead of <code>(0)</code> since it is still 2d, but that didn't matter. And many variations of extra parenthesis.</p>
  
  <p>Is this the Scala parser thinking it is some other construct or a bug in ND4S? Is there some workaround syntax that can make chaining work?</p>
  
  <p>EDIT:</p>
  
  <p>Under Breeze:</p>
  
  <pre><code>var m = DenseMatrix.zeros[Int](5,5)
  var a = m(0, ::)
  var b = a(0)
  var c = m(0, ::)(0)
  </code></pre>
  
  <p>a and b work but c produces this compiler error:</p>
  
  <blockquote>
    <p>type mismatch; found   : Int(0) required: breeze.linalg.support.CanSlice2[breeze.linalg.DenseMatrix[Int],Int,collection.immutable.::.type,?]</p>
  </blockquote>
  
  <p>Maybe this is parsing as curried function calls, or a macro expands in a way that doesn't work here. And while I guess a person never needs to chain indexing, since <code>m(0, 0)</code> works above and any indexing can be collapsed, is there some solution for the general case of tricking Scala in these situations?</p>
  
  <p>Also, chaining works with multidimensional arrays:</p>
  
  <pre><code>var n = Array.ofDim[Double](2, 3)
  var x = n(0)(0)
  </code></pre>