Skip to content

Commit

Permalink
minor style change
Browse files Browse the repository at this point in the history
  • Loading branch information
kailuowang authored Nov 20, 2017
1 parent fdc585d commit 6e42ea2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/Foldable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ import simulacrum.typeclass
}

def collectFirst[A, B](fa: F[A])(pf: PartialFunction[A, B]): Option[B] = {
//trick from TravsersableOnce
// trick from TravsersableOnce
val sentinel: Function1[A, Any] = new scala.runtime.AbstractFunction1[A, Any]{ def apply(a: A) = this }
foldRight(fa, Eval.now(Option.empty[B])) { (a, lb) =>
val x = pf.applyOrElse(a, sentinel)
Expand Down

0 comments on commit 6e42ea2

Please sign in to comment.