Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Parallel instances for EitherT and OptionT into implicit scope #3033

Merged
merged 4 commits into from
Sep 7, 2019

Conversation

travisbrown
Copy link
Contributor

Fixes #3032. Now the following works:

scala> import cats.{Id, Parallel}, cats.instances.list._, cats.instances.string._
import cats.{Id, Parallel}
import cats.instances.list._
import cats.instances.string._

scala> type EI[A] = cats.data.EitherT[Id, String, A]
defined type alias EI

scala> implicitly[Parallel[EI]]
res0: cats.Parallel[EI] = cats.data.EitherTInstances$$anon$7@3f7c7017

scala> type EL[A] = cats.data.EitherT[List, String, A]
defined type alias EL

scala> implicitly[Parallel[EL]]
res1: cats.Parallel[EL] = cats.data.EitherTInstances1$$anon$15@1124d0e8

scala> type OI[A] = cats.data.OptionT[Id, A]
defined type alias OI

scala> implicitly[Parallel[OI]]
res2: cats.Parallel[OI] = cats.data.OptionTInstances$$anon$8@3e5db9dc

This should have no changes for existing code that doesn't refer to the two cats.instances.parallel instances by name (I've made them package-private, not just deprecated them). It doesn't break binary compatibility.

@codecov-io
Copy link

codecov-io commented Sep 7, 2019

Codecov Report

Merging #3033 into master will decrease coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3033      +/-   ##
==========================================
- Coverage   93.56%   93.43%   -0.14%     
==========================================
  Files         368      368              
  Lines        6949     6975      +26     
  Branches      195      187       -8     
==========================================
+ Hits         6502     6517      +15     
- Misses        447      458      +11
Impacted Files Coverage Δ
core/src/main/scala/cats/instances/parallel.scala 0% <ø> (-100%) ⬇️
core/src/main/scala/cats/data/EitherT.scala 98.18% <100%> (+0.25%) ⬆️
core/src/main/scala/cats/data/OptionT.scala 95.65% <100%> (+0.23%) ⬆️
testkit/src/main/scala/cats/tests/Helpers.scala 96% <0%> (-4%) ⬇️
...cala/cats/kernel/instances/FunctionInstances.scala 96.96% <0%> (-3.04%) ⬇️
core/src/main/scala/cats/Parallel.scala 84.37% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 802940c...2dfc1e0. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallel instances for EitherT and OptionT aren't in implicit scope
5 participants