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

Take extends Product with Serializable #909

Merged
merged 1 commit into from May 28, 2019

Conversation

barambani
Copy link
Contributor

This makes the inference a bit more accurate. In scenarios like the following

scala> import scalaz.zio.stream.{Take, ZStream}
<console>:11: warning: Unused import
       import scalaz.zio.stream.{Take, ZStream}
                                 ^
<console>:11: warning: Unused import
       import scalaz.zio.stream.{Take, ZStream}
                                       ^
import scalaz.zio.stream.{Take, ZStream}

scala> (ZStream.range(1, 10) map Take.Value.apply) ++ ZStream.succeed(Take.End)
res0: scalaz.zio.stream.ZStream[Any,Nothing,Product with Serializable with scalaz.zio.stream.Take[Nothing,Int]] = scalaz.zio.stream.ZStream$$anon$1@332829f8

Product with Serializable with scalaz.zio.stream.Take[Nothing,Int] is inferred for Take[Nothing, Int]. After the change it becomes

scala> import scalaz.zio.stream.{Take, ZStream}
<console>:11: warning: Unused import
       import scalaz.zio.stream.{Take, ZStream}
                                 ^
<console>:11: warning: Unused import
       import scalaz.zio.stream.{Take, ZStream}
                                       ^
import scalaz.zio.stream.{Take, ZStream}

scala> (ZStream.range(1, 10) map Take.Value.apply) ++ ZStream.succeed(Take.End)
res0: scalaz.zio.stream.ZStream[Any,Nothing,scalaz.zio.stream.Take[Nothing,Int]] = scalaz.zio.stream.ZStream$$anon$1@9b8469f

notice scalaz.zio.stream.ZStream[Any,Nothing,scalaz.zio.stream.Take[Nothing,Int]].
Anyway feel free to close the PR if this is not a priority.

@jdegoes
Copy link
Member

jdegoes commented May 28, 2019

@barambani Type inference is always a priority. 😄 Thank you! 🙏

@jdegoes jdegoes merged commit 4493ad6 into zio:master May 28, 2019
@barambani barambani deleted the take-product-serial branch May 29, 2019 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants