title: Scala: Option, Some and the ArrowAssoc operator
body: <p>I am trying to analyze the following piece of Scala code:</p>
  
  <pre><code>import java.nio.file._
  import scala.Some
  
  abstract class MyCustomDirectoryIterator[T](path:Path,someNumber:Int, anotherNum:Int) extends Iterator[T] {
  
  def getCustomIterator(myPath:Path):Option[(DirectoryStream[Path],
                                                   Iterator[Path])] = try {
    //we get the directory stream        
     val str = Files.newDirectoryStream(myPath)
      //then we get the iterator out of the stream
      val iter = str.iterator()
      Some((str -&gt; iter))
    } catch {
      case de:DirectoryIteratorException =&gt;
        printstacktrace(de.getMessage)
        None
  
    }
  </code></pre>
  
  <hr>
  
  <p>How do I interpert this piece of code: <code>Some((str -&gt; iter))</code>
  Yes, it is returning a value of type: </p>
  
  <pre><code>Option[(DirectoryStream[Path], Iterator[Path])]
  </code></pre>
  
  <p>The -> operator is, to the best of my understanding, ArrowAssoc from the scala.Predef package.</p>
  
  <pre><code>implicit final class ArrowAssoc[A] extends AnyVal
  </code></pre>
  
  <p>But I still do not understand what the -> thing is doing to give me a return value of type: </p>
  
  <pre><code>Option[(DirectoryStream[Path], Iterator[Path])]
  </code></pre>
  
  <p>Can the Scala experts out here throw more light on this? Is there any way to write the "Some(..)" thing in a more readable way? I do understand the role played by Some, though.</p>