Deprecate/remove `INothing`?
To follow suit with https://github.com/typelevel/fs2/pull/2870.
@bpholt had an excellent minimization in https://github.com/typelevel/feral/pull/52#issuecomment-974246880 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 https://github.com/typelevel/feral/issues/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 forINothing. We can't do this withNothing. https://github.com/typelevel/feral/blob/81d1997372d5156ff2e74f9df357a43dcfd8d00f/lambda/shared/src/main/scala-3/feral/lambda/INothing.scala#L27-L28 -
This compile test no longer compiles, which may mean trouble for inference when using
Kleisli-based tracing. https://github.com/typelevel/feral/blob/81d1997372d5156ff2e74f9df357a43dcfd8d00f/lambda/shared/src/test/scala/feral/lambda/TracedHandlerSuite.scala#L39type 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.
So apparently there is this:
- https://github.com/circe/circe/pull/1598
Reviving that PR seems like the best way to solve our implicit scope problems in the long-term.
Edit: nice, an issue as well.
- https://github.com/circe/circe/issues/1519
Hmm, tried reviving the Circe PR in https://github.com/armanbilge/circe/commit/3973601d85684aaa474f9f130e98fe66dca0ddf7 but it doesn't seem to work actually 😕
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.