-
Look at the scaladoc for Option#zip.
(Option[A])([B]GenIterable[B] => Option[(A, B)]
-
Look at the Option.scala source.
> grep zip | wc -l
0
-
WTF?
-
Expand the arrow on the
Option#zipscaladoc.
"This member is added by an implicit conversion from Option[A] to Iterable[A] performed by method option2Iterable in scala.Option. "
-
Well uh ... so er scaladoc invokes implicit functions at documentation time? YOLO I guess.
-
Look at the scaladoc for IterableLike#zip.
(IterableLike[A])([B]GenIterable[B] => Iterable[(A, B)])
-
So
zipreturnsIterable[(A, B)]but ummmOption#zipscaladoc says it returnsOption[(A, B)]. Which is it?
scala> Some(7) zip Some('a')
res0: Iterable[(Int, Char)] = List((7,a))
-
OK so it returns a
Listwith anIterablereference. -
MAKES SENSE.