From 5fe48374cb1c23cb1b968caf62dd3eb3127217c8 Mon Sep 17 00:00:00 2001 From: Csongor Kiss Date: Sat, 20 Aug 2016 16:59:11 +0100 Subject: [PATCH] Remove references to Monad from CoflatMap doc The doc for `coflatMap` states that the value is in a Monadic context, which can be confusing, because: - there is no Monad constraint on the context (the example being a Monad is incidental) - it is *more likely* to be a Comonad --- core/src/main/scala/cats/CoflatMap.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/main/scala/cats/CoflatMap.scala b/core/src/main/scala/cats/CoflatMap.scala index 3f3bd4e1e2..7df1e6266b 100644 --- a/core/src/main/scala/cats/CoflatMap.scala +++ b/core/src/main/scala/cats/CoflatMap.scala @@ -11,15 +11,14 @@ import simulacrum.typeclass /** * `coflatMap` is the dual of `flatMap` on `FlatMap`. It applies - * a value in a Monadic context to a function that takes a value + * a value in a context to a function that takes a value * in a context and returns a normal value. * * Example: * {{{ * scala> import cats.implicits._ - * scala> import cats.Monad * scala> import cats.CoflatMap - * scala> val fa = Monad[Option].pure(3) + * scala> val fa = Some(3) * scala> def f(a: Option[Int]): Int = a match { * | case Some(x) => 2 * x * | case None => 0 } @@ -36,9 +35,8 @@ import simulacrum.typeclass * Example: * {{{ * scala> import cats.implicits._ - * scala> import cats.Monad * scala> import cats.CoflatMap - * scala> val fa = Monad[Option].pure(3) + * scala> val fa = Some(3) * fa: Option[Int] = Some(3) * scala> CoflatMap[Option].coflatten(fa) * res0: Option[Option[Int]] = Some(Some(3))