Skip to content

Commit

Permalink
Do not use Either syntax in monad loops
Browse files Browse the repository at this point in the history
  • Loading branch information
drbild committed Aug 30, 2017
1 parent 14e1695 commit 9a31560
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/main/scala/cats/Monad.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cats

import simulacrum.typeclass
import syntax.either._

/**
* Monad.
*
Expand Down Expand Up @@ -30,7 +30,7 @@ import syntax.either._
Left(G.combineK(xs, G.pure(bv)))
}
},
ifFalse = pure(xs.asRight[G[A]])
ifFalse = pure(Right(xs))
))
}

Expand Down Expand Up @@ -80,8 +80,8 @@ import syntax.either._
flatMap(f) { i =>
tailRecM(i) { a =>
if (p(a))
map(f)(_.asLeft[A])
else pure(a.asRight[A])
map(f)(Left(_))
else pure(Right(a))
}
}
}
Expand All @@ -94,8 +94,8 @@ import syntax.either._
flatMap(f) { i =>
tailRecM(i) { a =>
if (p(a))
pure(a.asRight[A])
else map(f)(_.asLeft[A])
pure(Right(a))
else map(f)(Left(_))
}
}
}
Expand Down

0 comments on commit 9a31560

Please sign in to comment.