-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move type class instances into implicit scope
- Loading branch information
1 parent
97dbfeb
commit 56d94da
Showing
35 changed files
with
965 additions
and
31 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
core/src/main/scala-2.12/cats/ScalaVersionSpecificInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cats | ||
|
||
import cats.data.ZipStream | ||
|
||
private[cats] trait ScalaVersionSpecificTraverseInstances { | ||
implicit def catsTraverseForStream: Traverse[Stream] = cats.instances.stream.catsStdInstancesForStream | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificShowInstances { | ||
implicit def catsShowForStream[A: Show]: Show[Stream[A]] = cats.instances.stream.catsStdShowForStream[A] | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificSemigroupalInstances { | ||
implicit def catsSemigroupalForStream: Semigroupal[Stream] = cats.instances.stream.catsStdInstancesForStream | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificMonoidKInstances { | ||
implicit def catsMonoidKForStream: MonoidK[Stream] = cats.instances.stream.catsStdInstancesForStream | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificParallelInstances { | ||
implicit def catsStdParallelForZipStream: Parallel.Aux[Stream, ZipStream] = | ||
cats.instances.stream.catsStdParallelForStreamZipStream | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificInvariantInstances { | ||
implicit def catsInstancesForStream: Monad[Stream] with Alternative[Stream] with CoflatMap[Stream] = | ||
cats.instances.stream.catsStdInstancesForStream | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificTraverseFilterInstances { | ||
implicit def catsTraverseFilterForStream: TraverseFilter[Stream] = | ||
cats.instances.stream.catsStdTraverseFilterForStream | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificAlignInstances |
81 changes: 81 additions & 0 deletions
81
core/src/main/scala-2.13+/cats/ScalaVersionSpecificInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package cats | ||
|
||
import cats.data.{ZipLazyList, ZipStream} | ||
import scala.collection.immutable.ArraySeq | ||
|
||
private[cats] trait ScalaVersionSpecificTraverseInstances { | ||
@deprecated("Use catsTraverseForLazyList", "3.0.0") | ||
implicit def catsTraverseForStream: Traverse[Stream] = cats.instances.stream.catsStdInstancesForStream | ||
|
||
implicit def catsTraverseForLazyList: Traverse[LazyList] = cats.instances.lazyList.catsStdInstancesForLazyList | ||
implicit def catsTraverseForArraySeq: Traverse[ArraySeq] = cats.instances.arraySeq.catsStdInstancesForArraySeq | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificShowInstances { | ||
@deprecated("Use catsShowForLazyList", "3.0.0") | ||
implicit def catsShowForStream[A: Show]: Show[Stream[A]] = cats.instances.stream.catsStdShowForStream[A] | ||
|
||
implicit def catsShowForLazyList[A: Show]: Show[LazyList[A]] = cats.instances.lazyList.catsStdShowForLazyList[A] | ||
implicit def catsShowForArraySeq[A: Show]: Show[ArraySeq[A]] = cats.instances.arraySeq.catsStdShowForArraySeq[A] | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificSemigroupalInstances { | ||
@deprecated("Use catsSemigroupalForLazyList", "3.0.0") | ||
implicit def catsSemigroupalForStream: Semigroupal[Stream] = cats.instances.stream.catsStdInstancesForStream | ||
|
||
implicit def catsSemigroupalForLazyList: Semigroupal[LazyList] = cats.instances.lazyList.catsStdInstancesForLazyList | ||
implicit def catsSemigroupalForArraySeq: Semigroupal[ArraySeq] = cats.instances.arraySeq.catsStdInstancesForArraySeq | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificMonoidKInstances { | ||
@deprecated("Use catsMonoidKForLazyList", "3.0.0") | ||
implicit def catsMonoidKForStream: MonoidK[Stream] = cats.instances.stream.catsStdInstancesForStream | ||
|
||
implicit def catsMonoidKForLazyList: MonoidK[LazyList] = cats.instances.lazyList.catsStdInstancesForLazyList | ||
implicit def catsMonoidKForArraySeq: MonoidK[ArraySeq] = cats.instances.arraySeq.catsStdInstancesForArraySeq | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificParallelInstances { | ||
@deprecated("Use catsParallelForLazyList", "3.0.0") | ||
implicit def catsStdParallelForZipStream: Parallel.Aux[Stream, ZipStream] = | ||
cats.instances.parallel.catsStdParallelForZipStream | ||
|
||
implicit def catsStdParallelForZipLazyList: Parallel.Aux[LazyList, ZipLazyList] = | ||
cats.instances.lazyList.catsStdParallelForLazyListZipLazyList | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificInvariantInstances { | ||
@deprecated("Use catsInstancesForLazyList", "3.0.0") | ||
implicit def catsInstancesForStream: Monad[Stream] with Alternative[Stream] with CoflatMap[Stream] = | ||
cats.instances.stream.catsStdInstancesForStream | ||
|
||
implicit def catsInstancesForLazyList: Monad[LazyList] with Alternative[LazyList] with CoflatMap[LazyList] = | ||
cats.instances.lazyList.catsStdInstancesForLazyList | ||
|
||
implicit def catsInstancesForArraySeq: Monad[ArraySeq] with Alternative[ArraySeq] with CoflatMap[ArraySeq] = | ||
cats.instances.arraySeq.catsStdInstancesForArraySeq | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificTraverseFilterInstances { | ||
@deprecated("Use catsTraverseFilterForLazyList", "3.0.0") | ||
implicit def catsTraverseFilterForStream: TraverseFilter[Stream] = | ||
cats.instances.stream.catsStdTraverseFilterForStream | ||
|
||
implicit def catsTraverseFilterForLazyList: TraverseFilter[LazyList] = | ||
cats.instances.lazyList.catsStdTraverseFilterForLazyList | ||
|
||
implicit def catsTraverseFilterForArraySeq: TraverseFilter[ArraySeq] = | ||
cats.instances.arraySeq.catsStdTraverseFilterForArraySeq | ||
} | ||
|
||
private[cats] trait ScalaVersionSpecificAlignInstances { | ||
@deprecated("Use catsTraverseFilterForLazyList", "3.0.0") | ||
implicit def catsAlignForStream: Align[Stream] = | ||
cats.instances.stream.catsStdInstancesForStream | ||
|
||
implicit def catsAlignForLazyList: Align[LazyList] = | ||
cats.instances.lazyList.catsStdInstancesForLazyList | ||
|
||
implicit def catsAlignForArraySeq: Align[ArraySeq] = | ||
cats.instances.arraySeq.catsStdInstancesForArraySeq | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.