From 517dceaa81a142b12586f38ca86da6fbd3bd7982 Mon Sep 17 00:00:00 2001 From: Raymond Tay Date: Sun, 29 Oct 2017 09:57:22 +0800 Subject: [PATCH] This is probably safer. --- core/src/main/scala/cats/data/Cokleisli.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/cats/data/Cokleisli.scala b/core/src/main/scala/cats/data/Cokleisli.scala index b311ed64d9..51310795a8 100644 --- a/core/src/main/scala/cats/data/Cokleisli.scala +++ b/core/src/main/scala/cats/data/Cokleisli.scala @@ -16,7 +16,7 @@ final case class Cokleisli[F[_], A, B](run: F[A] => B) { self => * {{{ * scala> import cats._, data._ * scala> val f = Cokleisli((xs: NonEmptyList[Int]) => xs.reverse.head) - * scala> def before(x: String) = x.toInt + * scala> def before(x: Double) = x.toInt * scala> def after(x: Int) = x.toString * scala> f.dimap(before)(after).run(NonEmptyList.of("1","2")) * res0: String = 2 @@ -30,7 +30,7 @@ final case class Cokleisli[F[_], A, B](run: F[A] => B) { self => * {{{ * scala> import cats._, data._, implicits._ * scala> val f = Cokleisli((xs: NonEmptyList[Int]) => xs.reverse.head) - * scala> def before(x: String) = x.toInt + * scala> def before(x: Double) = x.toInt * scala> def after(x: Int) = x.toString * scala> f.lmap(before).rmap(after).run(NonEmptyList.of("1","2")) * res0: String = 2