title: How to solve type mismatch when compiler finds Serializable instead of the match type?
body: <p>I have have the following parser to parse arithmetic expressions containing Float and RDD :</p>
  
  <pre><code> import scalaz._
   import Scalaz._
  
   def term2: Parser[List[\/[Float, RDD[(Int,Array[Float])]]]] = rep(factor2)
   def factor2: Parser[\/[Float, RDD[(Int,Array[Float])]]] = pathxml | num
   def pathxml: Parser[ RDD[(Int,Array[Float])]] = pathIdent ^^ { s =&gt; pathToRDD(s)} //pathToRDD is a function that gets the path in string and create an RDD from the file inside that path and pathIdent parse to see whether the input string is a path or not
   def num: Parser[\/[Float, RDD[(Int,Array[Float])]]] = floatingPointNumber ^^ (n =&gt; n.left[RDD[(Int,Array[Float])]].toFloat)
  </code></pre>
  
  <p>Getting the following error:</p>
  
  <pre><code>  [error]  type mismatch;   
    [error]  found   : ParseExp.this.Parser[Serializable]
    [error]  required: ParseExp.this.Parser[scalaz.\/[Float,org.apache.spark.rdd.RDD[(Int, Array[Float])]]]
    [error]   def factor2: Parser[\/[Float, RDD[(Int,Array[Float])]]] = pathxml | num
    [error]                                                                     ^
  </code></pre>
  
  <p>I am new in Scala and don/t know how I can solve this error</p>