Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** An extractor that allows to pattern match streams with `#::`.
- */
- object #:: {
- def unapply[A](xs: Stream[A]): Option[(A, Stream[A])] =
- if (xs.isEmpty) None
- else Some((xs.head, xs.tail))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement