Skip to content

Commit

Permalink
avoid deprecated kind-porjector ? syntax. use *
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed May 9, 2020
1 parent 1754326 commit 17c1b9e
Show file tree
Hide file tree
Showing 166 changed files with 1,846 additions and 1,846 deletions.
8 changes: 4 additions & 4 deletions core/src/main/scala/scalaz/Adjunction.scala
Expand Up @@ -86,8 +86,8 @@ sealed abstract class AdjunctionInstances {
import std.tuple._
import std.function._

implicit def curryUncurryAdjunction[S]: (S, ?) -| (S => ?) =
new Adjunction[(S, ?), (S => ?)] {
implicit def curryUncurryAdjunction[S]: (S, *) -| (S => *) =
new Adjunction[(S, *), (S => *)] {
override def leftAdjunct[A, B](a: => A)(f: ((S, A)) => B): S => B = s => f((s, a))
override def rightAdjunct[A, B](a: (S, A))(f: A => S => B): B = f(a._2)(a._1)
}
Expand Down Expand Up @@ -116,8 +116,8 @@ sealed abstract class AdjunctionInstances {
override def rightAdjunct[A, B](a: () => A)(f: A => B): B = f(a())
}

implicit def writerReaderAdjunction[E]: Adjunction[Writer[E, ?], Reader[E, ?]] =
new Adjunction[Writer[E, ?], Reader[E, ?]] {
implicit def writerReaderAdjunction[E]: Adjunction[Writer[E, *], Reader[E, *]] =
new Adjunction[Writer[E, *], Reader[E, *]] {
override def leftAdjunct[A, B](a: => A)(f: Writer[E, A] => B): Reader[E, B] =
Reader(e => f(Writer(e, a)))
override def rightAdjunct[A, B](w: Writer[E, A])(f: A => Reader[E, B]): B = {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/scalaz/Arrow.scala
Expand Up @@ -15,8 +15,8 @@ trait Arrow[=>:[_, _]] extends Split[=>:] with Strong[=>:] with Category[=>:] {
/** Lift an ordinary function. */
def arr[A, B](f: A => B): A =>: B

override def covariantInstance[C]: Applicative[C =>: ?] =
new Applicative[C =>: ?] with SndCovariant[C] {
override def covariantInstance[C]: Applicative[C =>: *] =
new Applicative[C =>: *] with SndCovariant[C] {
def point[A](a: => A): C =>: A = arr(_ => a)
def ap[A, B](fa: => (C =>: A))(f: => (C =>: (A => B))): (C =>: B) = <<<(arr((y: (A => B, A)) => y._1(y._2)), combine(f, fa))
}
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/scala/scalaz/Bias.scala
@@ -1,13 +1,13 @@
package scalaz

private trait LeftFunctor[F[_,_], X] extends Functor[F[?, X]] {
private trait LeftFunctor[F[_,_], X] extends Functor[F[*, X]] {
implicit def F: Bifunctor[F]

override def map[A, C](fax: F[A, X])(f: A => C): F[C, X] =
F.bimap(fax)(f, identity)
}

private trait RightFunctor[F[_,_], X] extends Functor[F[X, ?]] {
private trait RightFunctor[F[_,_], X] extends Functor[F[X, *]] {
implicit def F: Bifunctor[F]

override def map[A, C](fax: F[X, A])(f: A => C): F[X, C] =
Expand All @@ -21,7 +21,7 @@ private trait UFunctor[F[_,_]] extends Functor[λ[α => F[α, α]]] {
F.bimap(fax)(f, f)
}

private trait LeftFoldable[F[_,_], X] extends Foldable[F[?, X]] {
private trait LeftFoldable[F[_,_], X] extends Foldable[F[*, X]] {
implicit def F: Bifoldable[F]

override def foldMap[A,B](fa: F[A, X])(f: A => B)(implicit B: Monoid[B]): B =
Expand All @@ -34,7 +34,7 @@ private trait LeftFoldable[F[_,_], X] extends Foldable[F[?, X]] {
F.bifoldLeft(fa, z)(f)((b, _) => b)
}

private trait RightFoldable[F[_,_], X] extends Foldable[F[X, ?]] {
private trait RightFoldable[F[_,_], X] extends Foldable[F[X, *]] {
implicit def F: Bifoldable[F]

override def foldMap[A,B](fa: F[X, A])(f: A => B)(implicit B: Monoid[B]): B =
Expand All @@ -60,15 +60,15 @@ private trait UFoldable[F[_,_]] extends Foldable[λ[α => F[α, α]]] {
F.bifoldLeft(fa, z)(f)(f)
}

private trait LeftTraverse[F[_,_], X] extends Traverse[F[?, X]]
private trait LeftTraverse[F[_,_], X] extends Traverse[F[*, X]]
with LeftFunctor[F, X] with LeftFoldable[F, X] {
implicit def F: Bitraverse[F]

def traverseImpl[G[_]:Applicative,A,B](fa: F[A, X])(f: A => G[B]): G[F[B, X]] =
F.bitraverseImpl(fa)(f, x => Applicative[G] point x)
}

private trait RightTraverse[F[_,_], X] extends Traverse[F[X, ?]]
private trait RightTraverse[F[_,_], X] extends Traverse[F[X, *]]
with RightFunctor[F, X] with RightFoldable[F, X] {
implicit def F: Bitraverse[F]

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/scalaz/Bifoldable.scala
Expand Up @@ -53,11 +53,11 @@ trait Bifoldable[F[_, _]] { self =>
bifoldLeft(fa, z)(Function.uncurried(f))(Function.uncurried(g))

/** Extract the Foldable on the first parameter. */
def leftFoldable[X]: Foldable[F[?, X]] =
def leftFoldable[X]: Foldable[F[*, X]] =
new LeftFoldable[F, X] {val F = self}

/** Extract the Foldable on the second parameter. */
def rightFoldable[X]: Foldable[F[X, ?]] =
def rightFoldable[X]: Foldable[F[X, *]] =
new RightFoldable[F, X] {val F = self}

/** Unify the foldable over both params. */
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/scalaz/Bifunctor.scala
Expand Up @@ -26,14 +26,14 @@ trait Bifunctor[F[_, _]] { self =>
}

/** Extract the Functor on the first param. */
def leftFunctor[X]: Functor[F[?, X]] =
def leftFunctor[X]: Functor[F[*, X]] =
new LeftFunctor[F, X] {val F = self}

def leftMap[A, B, C](fab: F[A, B])(f: A => C): F[C, B] =
bimap(fab)(f, z => z)

/** Extract the Functor on the second param. */
def rightFunctor[X]: Functor[F[X, ?]] =
def rightFunctor[X]: Functor[F[X, *]] =
new RightFunctor[F, X] {val F = self}

/** Unify the functor over both params. */
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/scala/scalaz/BijectionT.scala
Expand Up @@ -98,7 +98,7 @@ object BijectionT extends BijectionTInstances {
zipB[Endo, A, B]

def zipReaderB[T, A, B]: Bijection[(T => A, T => B), T => (A, B)] =
zipB[T => ?, A, B]
zipB[T => *, A, B]

def tuple3B[A, B, C]: Bijection[(A, B, C), (A, (B, C))] =
bijection({ case (a, b, c) => (a, (b, c)) }, { case (a, (b, c)) => (a, b, c) })
Expand All @@ -119,22 +119,22 @@ object BijectionT extends BijectionTInstances {


sealed abstract class BijectionTInstances0 {
implicit def bijectionTSplit[F[_], G[_]](implicit F0: Bind[F], G0: Bind[G]): Split[BijectionT[F, G, ?, ?]] =
implicit def bijectionTSplit[F[_], G[_]](implicit F0: Bind[F], G0: Bind[G]): Split[BijectionT[F, G, *, *]] =
new BijectionTSplit[F, G] {
implicit def F = F0
implicit def G = G0
}
}

sealed abstract class BijectionTInstances extends BijectionTInstances0 {
implicit def bijectionTCategory[F[_], G[_]](implicit F0: Monad[F], G0: Monad[G]): Category[BijectionT[F, G, ?, ?]] =
implicit def bijectionTCategory[F[_], G[_]](implicit F0: Monad[F], G0: Monad[G]): Category[BijectionT[F, G, *, *]] =
new BijectionTCategory[F, G] {
implicit def F = F0
implicit def G = G0
}
}

private trait BijectionTSplit[F[_], G[_]] extends Split[BijectionT[F, G, ?, ?]] {
private trait BijectionTSplit[F[_], G[_]] extends Split[BijectionT[F, G, *, *]] {
implicit def F: Bind[F]
implicit def G: Bind[G]

Expand All @@ -147,7 +147,7 @@ private trait BijectionTSplit[F[_], G[_]] extends Split[BijectionT[F, G, ?, ?]]
)
}

private trait BijectionTCategory[F[_], G[_]] extends Category[BijectionT[F, G, ?, ?]] with BijectionTSplit[F, G] {
private trait BijectionTCategory[F[_], G[_]] extends Category[BijectionT[F, G, *, *]] with BijectionTSplit[F, G] {
implicit def F: Monad[F]
implicit def G: Monad[G]

Expand Down
8 changes: 4 additions & 4 deletions core/src/main/scala/scalaz/Bitraverse.scala
Expand Up @@ -38,11 +38,11 @@ trait Bitraverse[F[_, _]] extends Bifunctor[F] with Bifoldable[F] { self =>
}

/** Extract the Traverse on the first param. */
def leftTraverse[X]: Traverse[F[?, X]] =
def leftTraverse[X]: Traverse[F[*, X]] =
new LeftTraverse[F, X] {val F = self}

/** Extract the Traverse on the second param. */
def rightTraverse[X]: Traverse[F[X, ?]] =
def rightTraverse[X]: Traverse[F[X, *]] =
new RightTraverse[F, X] {val F = self}

/** Unify the traverse over both params. */
Expand All @@ -57,8 +57,8 @@ trait Bitraverse[F[_, _]] extends Bifunctor[F] with Bifoldable[F] { self =>
def bitraversal[G[_]:Applicative]: Bitraversal[G] =
new Bitraversal[G]

def bitraversalS[S]: Bitraversal[State[S, ?]] =
new Bitraversal[State[S, ?]]()(StateT.stateMonad)
def bitraversalS[S]: Bitraversal[State[S, *]] =
new Bitraversal[State[S, *]]()(StateT.stateMonad)

def bitraverse[G[_]:Applicative,A,B,C,D](fa: F[A,B])(f: A => G[C])(g: B => G[D]): G[F[C, D]] =
bitraversal[G].run(fa)(f)(g)
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/scala/scalaz/Codensity.scala
Expand Up @@ -34,8 +34,8 @@ object Codensity extends CodensityInstances {
* [[scalaz.Applicative]] and [[scalaz.PlusEmpty]] for `F`, the
* [[scalaz.MonadPlus]] laws should hold.
*/
implicit def codensityMonadPlus[F[_]](implicit F: ApplicativePlus[F]): MonadPlus[Codensity[F, ?]] =
new CodensityMonad[F] with MonadPlus[Codensity[F, ?]] {
implicit def codensityMonadPlus[F[_]](implicit F: ApplicativePlus[F]): MonadPlus[Codensity[F, *]] =
new CodensityMonad[F] with MonadPlus[Codensity[F, *]] {
def empty[A] =
new Codensity[F, A] {
def apply[B](f: A => F[B]) = F.empty[B]
Expand All @@ -55,11 +55,11 @@ object Codensity extends CodensityInstances {
}

sealed abstract class CodensityInstances {
implicit def codensityMonad[F[_]]: Monad[Codensity[F, ?]] =
implicit def codensityMonad[F[_]]: Monad[Codensity[F, *]] =
new CodensityMonad[F]
}

private[scalaz] sealed class CodensityMonad[F[_]] extends Monad[Codensity[F, ?]] {
private[scalaz] sealed class CodensityMonad[F[_]] extends Monad[Codensity[F, *]] {
final def point[A](a: => A) = Codensity.pureCodensity(a)

override final def map[A, B](fa: Codensity[F, A])(f: A => B) =
Expand Down
40 changes: 20 additions & 20 deletions core/src/main/scala/scalaz/Cofree.scala
Expand Up @@ -151,33 +151,33 @@ sealed abstract class CofreeInstances5 extends CofreeInstances6 {

sealed abstract class CofreeInstances4 extends CofreeInstances5 {
/** low priority `Foldable1` instance */
implicit def cofreeFoldable[F[_]: Foldable]: Foldable1[Cofree[F, ?]] =
implicit def cofreeFoldable[F[_]: Foldable]: Foldable1[Cofree[F, *]] =
new CofreeFoldable[F]{
def F = implicitly
}
}

sealed abstract class CofreeInstances3 extends CofreeInstances4 {
/** low priority `Traverse1` instance */
implicit def cofreeTraverse[F[_]: Traverse]: Traverse1[Cofree[F, ?]] =
implicit def cofreeTraverse[F[_]: Traverse]: Traverse1[Cofree[F, *]] =
new CofreeTraverse[F]{
def F = implicitly
}

implicit def cofreeZipFunctor[F[_]: Functor]: Functor[CofreeZip[F, ?]] =
implicit def cofreeZipFunctor[F[_]: Functor]: Functor[CofreeZip[F, *]] =
new CofreeZipFunctor[F]{
def F = implicitly
}
}

sealed abstract class CofreeInstances2 extends CofreeInstances3 {
/** high priority `Foldable1` instance. more efficient */
implicit def cofreeFoldable1[F[_]: Foldable1]: Foldable1[Cofree[F, ?]] =
implicit def cofreeFoldable1[F[_]: Foldable1]: Foldable1[Cofree[F, *]] =
new CofreeFoldable1[F]{
def F = implicitly
}

implicit def cofreeBind[F[_]: Plus: Functor]: Bind[Cofree[F, ?]] =
implicit def cofreeBind[F[_]: Plus: Functor]: Bind[Cofree[F, *]] =
new CofreeBind[F]{
def F = implicitly
def G = implicitly
Expand All @@ -186,37 +186,37 @@ sealed abstract class CofreeInstances2 extends CofreeInstances3 {

sealed abstract class CofreeInstances1 extends CofreeInstances2 {
/** high priority `Traverse1` instance. more efficient */
implicit def cofreeTraverse1[F[_]: Traverse1]: Traverse1[Cofree[F, ?]] =
implicit def cofreeTraverse1[F[_]: Traverse1]: Traverse1[Cofree[F, *]] =
new CofreeTraverse1[F] {
def F = implicitly
}

implicit def cofreeZipApply[F[_]: Apply]: Apply[CofreeZip[F, ?]] =
implicit def cofreeZipApply[F[_]: Apply]: Apply[CofreeZip[F, *]] =
new CofreeZipApply[F]{
def F = implicitly
}
}

sealed abstract class CofreeInstances0 extends CofreeInstances1 {
implicit def cofreeZipApplicative[F[_]: Applicative]: Applicative[CofreeZip[F, ?]] =
implicit def cofreeZipApplicative[F[_]: Applicative]: Applicative[CofreeZip[F, *]] =
new CofreeZipApplicative[F]{
def F = implicitly
}

implicit def cofreeMonad[F[_]: PlusEmpty: Functor]: Monad[Cofree[F, ?]] =
implicit def cofreeMonad[F[_]: PlusEmpty: Functor]: Monad[Cofree[F, *]] =
new CofreeMonad[F]{
def F = implicitly
def G = implicitly
}
}

sealed abstract class CofreeInstances extends CofreeInstances0 {
implicit def cofreeComonad[S[_]: Functor]: Comonad[Cofree[S, ?]] = new CofreeComonad[S] {
implicit def cofreeComonad[S[_]: Functor]: Comonad[Cofree[S, *]] = new CofreeComonad[S] {
def F = implicitly
}
}

private trait CofreeComonad[S[_]] extends Comonad[Cofree[S, ?]] {
private trait CofreeComonad[S[_]] extends Comonad[Cofree[S, *]] {
implicit def F: Functor[S]

def copoint[A](p: Cofree[S, A]) = p.head
Expand All @@ -228,13 +228,13 @@ private trait CofreeComonad[S[_]] extends Comonad[Cofree[S, ?]] {
def cobind[A, B](fa: Cofree[S, A])(f: (Cofree[S, A]) => B) = fa extend f
}

private trait CofreeZipFunctor[F[_]] extends Functor[CofreeZip[F, ?]]{
private trait CofreeZipFunctor[F[_]] extends Functor[CofreeZip[F, *]]{
implicit def F: Functor[F]

override final def map[A, B](fa: CofreeZip[F, A])(f: A => B) = Tags.Zip(Tag unwrap fa map f)
}

private trait CofreeZipApply[F[_]] extends Apply[CofreeZip[F, ?]] with CofreeZipFunctor[F]{
private trait CofreeZipApply[F[_]] extends Apply[CofreeZip[F, *]] with CofreeZipFunctor[F]{
implicit def F: Apply[F]

override final def ap[A, B](fa: => CofreeZip[F, A])(f: => CofreeZip[F, A => B]): CofreeZip[F, B] =
Expand All @@ -247,13 +247,13 @@ private trait CofreeZipApply[F[_]] extends Apply[CofreeZip[F, ?]] with CofreeZip
)
}

private trait CofreeZipApplicative[F[_]] extends Applicative[CofreeZip[F, ?]] with CofreeZipApply[F]{
private trait CofreeZipApplicative[F[_]] extends Applicative[CofreeZip[F, *]] with CofreeZipApply[F]{
implicit def F: Applicative[F]

def point[A](a: => A) = Tags.Zip(Cofree.delay(a, F.point(Tag.unwrap[Cofree[F, A], Tags.Zip](point(a)))))
}

private trait CofreeBind[F[_]] extends Bind[Cofree[F, ?]] with CofreeComonad[F]{
private trait CofreeBind[F[_]] extends Bind[Cofree[F, *]] with CofreeComonad[F]{
implicit def F: Functor[F]
implicit def G: Plus[F]

Expand All @@ -263,13 +263,13 @@ private trait CofreeBind[F[_]] extends Bind[Cofree[F, ?]] with CofreeComonad[F]{
}
}

private trait CofreeMonad[F[_]] extends Monad[Cofree[F, ?]] with CofreeBind[F]{
private trait CofreeMonad[F[_]] extends Monad[Cofree[F, *]] with CofreeBind[F]{
implicit def G: PlusEmpty[F]

def point[A](a: => A): Cofree[F, A] = Cofree(a, G.empty)
}

private trait CofreeFoldable[F[_]] extends Foldable1[Cofree[F, ?]]{
private trait CofreeFoldable[F[_]] extends Foldable1[Cofree[F, *]]{
implicit def F: Foldable[F]

override final def foldMap[A, B](fa: Cofree[F, A])(f: A => B)(implicit M: Monoid[B]): B =
Expand Down Expand Up @@ -298,14 +298,14 @@ private trait CofreeFoldable[F[_]] extends Foldable1[Cofree[F, ?]]{
}
}

private trait CofreeFoldable1[F[_]] extends Foldable1[Cofree[F, ?]] with CofreeFoldable[F]{
private trait CofreeFoldable1[F[_]] extends Foldable1[Cofree[F, *]] with CofreeFoldable[F]{
implicit def F: Foldable1[F]

override final def foldMap1[A, B](fa: Cofree[F, A])(f: A => B)(implicit S: Semigroup[B]): B =
S.append(f(fa.head), F.foldMap1(fa.tail)(foldMap1(_)(f)))
}

private trait CofreeTraverse[F[_]] extends Traverse1[Cofree[F, ?]] with CofreeFoldable[F] with CofreeComonad[F]{
private trait CofreeTraverse[F[_]] extends Traverse1[Cofree[F, *]] with CofreeFoldable[F] with CofreeComonad[F]{
implicit def F: Traverse[F]

override final def traverseImpl[G[_], A, B](fa: Cofree[F,A])(f: A => G[B])(implicit G: Applicative[G]): G[Cofree[F,B]] =
Expand All @@ -317,7 +317,7 @@ private trait CofreeTraverse[F[_]] extends Traverse1[Cofree[F, ?]] with CofreeFo
tl => G.map(f(fa.head))(Cofree.apply(_, tl)))
}

private trait CofreeTraverse1[F[_]] extends Traverse1[Cofree[F, ?]] with CofreeTraverse[F] with CofreeFoldable1[F]{
private trait CofreeTraverse1[F[_]] extends Traverse1[Cofree[F, *]] with CofreeTraverse[F] with CofreeFoldable1[F]{
implicit def F: Traverse1[F]

override def traverse1Impl[G[_], A, B](fa: Cofree[F,A])(f: A => G[B])(implicit G: Apply[G]): G[Cofree[F,B]] =
Expand Down

0 comments on commit 17c1b9e

Please sign in to comment.