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

Deprecate/remove INothing? #191

Open
armanbilge opened this issue Apr 4, 2022 · 3 comments
Open

Deprecate/remove INothing? #191

armanbilge opened this issue Apr 4, 2022 · 3 comments
Labels
question Further information is requested

Comments

@armanbilge
Copy link
Member

armanbilge commented Apr 4, 2022

To follow suit with typelevel/fs2#2870.

@bpholt had an excellent minimization in #52 (comment) demonstrating why we needed INothing instead of Nothing. Unfortunately, subsequent refactors made it no longer applicable and I was unable to find another one, tracked in #73.

I took a quick try at replacing INothing with Nothing. So far I encountered two issues:

  • To get the Encoder[INothing] into implicit scope on Scala 3, we put it inside a companion object for INothing. We can't do this with Nothing.

    type INothing <: Nothing
    object INothing {

  • This compile test no longer compiles, which may mean trouble for inference when using Kleisli-based tracing.

    TracedHandler(ioEntryPoint, Kleisli[IO, Span[IO], Option[INothing]](???))

    type mismatch;
     found   : cats.data.Kleisli[cats.effect.IO,natchez.Span[cats.effect.IO],Option[Nothing]]
     required: cats.data.Kleisli[[+A]cats.effect.IO[A],natchez.Span[[+A]cats.effect.IO[A]],Option[Result]]
    Note: Option[Nothing] <: Option[Result], but class Kleisli is invariant in type B.
    You may wish to define B as +B instead.
    

    Update: the broken compile test is only broken on Scala 2, Scala 3 seems okay.

@armanbilge armanbilge added the question Further information is requested label Apr 4, 2022
@armanbilge armanbilge added this to the 0.1.0 milestone May 20, 2022
@armanbilge
Copy link
Member Author

armanbilge commented May 22, 2022

So apparently there is this:

Reviving that PR seems like the best way to solve our implicit scope problems in the long-term.

Edit: nice, an issue as well.

@armanbilge
Copy link
Member Author

Hmm, tried reviving the Circe PR in armanbilge/circe@3973601 but it doesn't seem to work actually 😕

@armanbilge armanbilge removed this from the v0.1.0 milestone Jul 21, 2022
@armanbilge
Copy link
Member Author

I took another try at the Circe PR this afternoon. It works in Scala 3 but some form of INothing is needed for Scala 2.13. I guess we're stuck with it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant