Skip to content

Commit

Permalink
Fix doc examples for Ior.map
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Heiber authored and travisbrown committed Feb 23, 2020
1 parent 1ede81e commit 3c1e41a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/main/scala/cats/data/Ior.scala
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,14 @@ sealed abstract class Ior[+A, +B] extends Product with Serializable {
* scala> import cats.data.Ior
* scala> import cats.implicits._
*
* scala> "abc".leftIor[Int].bimap(_.length, _ * 2)
* res0: Ior[Int, Int] = Left(3)
* scala> "abc".leftIor[Int].map(_ * 2)
* res0: Ior[String, Int] = Left(abc)
*
* scala> 123.rightIor[String].bimap(_.length, _ * 2)
* res1: Ior[Int, Int] = Right(246)
* scala> 123.rightIor[String].map(_ * 2)
* res1: Ior[String, Int] = Right(246)
*
* scala> Ior.Both("abc", 123).bimap(_.length, _ * 2)
* res2: Ior[Int, Int] = Both(3,246)
* scala> Ior.Both("abc", 123).map(_ * 2)
* res2: Ior[String, Int] = Both(abc,246)
* }}}
*/
final def map[D](f: B => D): A Ior D = bimap(identity, f)
Expand Down

0 comments on commit 3c1e41a

Please sign in to comment.