Skip to content

Commit

Permalink
Increase coverage by one line (woo)
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Jul 9, 2017
1 parent 9825ad7 commit bcf954d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions free/src/main/scala/cats/free/FreeApplicative.scala
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ object FreeApplicative {

// Internal helper function for foldMap, it folds only Pure and Lift nodes
private[free] def foldArg[F[_], G[_], A](node: FA[F, A], f: F ~> G)(implicit G: Applicative[G]): G[A] = {
node match {
case Pure(x) =>
G.pure(x)
case Lift(fa) =>
f(fa)
case _ => sys.error("\"impossible\", foldArg should be called on Pure or Lift nodes only")
if (node.isInstanceOf[Pure[F, A]]) {
val Pure(x) = node
G.pure(x)
} else {
val Lift(fa) = node
f(fa)
}
}

Expand Down

0 comments on commit bcf954d

Please sign in to comment.