Skip to content

Commit

Permalink
Merge pull request #3848 from typelevel/topic/no-qmark
Browse files Browse the repository at this point in the history
  • Loading branch information
larsrh authored Apr 1, 2021
2 parents 191aaf1 + 8f55a3f commit e0784fc
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala-2.13+/cats/evidence/AsSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cats.evidence
private[evidence] trait AsSupport {
@inline implicit def asFromPredef[A, B](implicit ev: A <:< B): A As B = {
// we need F to be covariant, and the type lambda loses that
// if we write As[A, ?]
// if we write As[A, *]
type F[+Z] = As[A, Z]
ev.substituteCo[F](As.refl[A])
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/mdoc/datatypes/const.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ trait Traverse[F[_]] extends Foldable[F] {
def traverse[G[_] : Applicative, A, X](fa: F[A])(f: A => G[X]): G[F[X]]

def foldMap[A, B : Monoid](fa: F[A])(f: A => B): B = {
val const: Const[B, F[Nothing]] = traverse[Const[B, ?], A, Nothing](fa)(a => Const(f(a)))
val const: Const[B, F[Nothing]] = traverse[Const[B, *], A, Nothing](fa)(a => Const(f(a)))
const.getConst
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/mdoc/datatypes/either.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ and leave the right one free.
```scala mdoc:silent
import cats.Monad

implicit def eitherMonad[Err]: Monad[Either[Err, ?]] =
new Monad[Either[Err, ?]] {
implicit def eitherMonad[Err]: Monad[Either[Err, *]] =
new Monad[Either[Err, *]] {
def flatMap[A, B](fa: Either[Err, A])(f: A => Either[Err, B]): Either[Err, B] =
fa.flatMap(f)

Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/mdoc/datatypes/freemonad.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,17 @@ In order to take advantage of monadic composition we use smart constructors to l

```scala mdoc:silent
class Interacts[F[_]](implicit I: InjectK[Interact, F]) {
def tell(msg: String): Free[F, Unit] = Free.inject[Interact, F](Tell(msg))
def ask(prompt: String): Free[F, String] = Free.inject[Interact, F](Ask(prompt))
def tell(msg: String): Free[F, Unit] = Free.liftInject[F](Tell(msg))
def ask(prompt: String): Free[F, String] = Free.liftInject[F](Ask(prompt))
}

object Interacts {
implicit def interacts[F[_]](implicit I: InjectK[Interact, F]): Interacts[F] = new Interacts[F]
}

class DataSource[F[_]](implicit I: InjectK[DataOp, F]) {
def addCat(a: String): Free[F, Unit] = Free.inject[DataOp, F](AddCat(a))
def getAllCats: Free[F, List[String]] = Free.inject[DataOp, F](GetAllCats())
def addCat(a: String): Free[F, Unit] = Free.liftInject[F](AddCat(a))
def getAllCats: Free[F, List[String]] = Free.liftInject[F](GetAllCats())
}

object DataSource {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/mdoc/datatypes/kleisli.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ import cats.implicits._

// We can define a FlatMap instance for Kleisli if the F[_] we chose has a FlatMap instance
// Note the input type and F are fixed, with the output type left free
implicit def kleisliFlatMap[F[_], Z](implicit F: FlatMap[F]): FlatMap[Kleisli[F, Z, ?]] =
new FlatMap[Kleisli[F, Z, ?]] {
implicit def kleisliFlatMap[F[_], Z](implicit F: FlatMap[F]): FlatMap[Kleisli[F, Z, *]] =
new FlatMap[Kleisli[F, Z, *]] {
def flatMap[A, B](fa: Kleisli[F, Z, A])(f: A => Kleisli[F, Z, B]): Kleisli[F, Z, B] =
Kleisli(z => fa.run(z).flatMap(a => f(a).run(z)))

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/mdoc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ nl.traverse(even)

## <a id="applicative-monad-transformers" href="#applicative-monad-transformers">Where are `Applicative`s for monad transformers?</a>

An `Applicative` instance for `OptionT[F, ?]`/`EitherT[F, E, ?]`, built without a corresponding `Monad` instance for `F`, would be unlawful, so it's not included. See [the guidelines](https://typelevel.org/cats/guidelines.html#applicative-monad-transformers) for a more detailed explanation.
An `Applicative` instance for `OptionT[F, *]`/`EitherT[F, E, *]`, built without a corresponding `Monad` instance for `F`, would be unlawful, so it's not included. See [the guidelines](https://typelevel.org/cats/guidelines.html#applicative-monad-transformers) for a more detailed explanation.

As an alternative, using `.toNested` on the monad transformer is recommended, although its `ap` will still be inconsistent with the Monad instance's.`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SyntaxSerializationSuite extends CatsSuite {
)

checkAll(
"Tuple3ParallelOps[Either[String, ?], Boolean, Int, Long]",
"Tuple3ParallelOps[Either[String, *], Boolean, Int, Long]",
SerializableTests.serializable(
cats.syntax.all.catsSyntaxTuple3Parallel(("a".asLeft[Boolean], "b".asLeft[Int], "c".asLeft[Long]))
)
Expand Down

0 comments on commit e0784fc

Please sign in to comment.