getkyo / kyo

Toolkit for Scala Development
https://getkyo.io
Apache License 2.0
521 stars 44 forks source link

Improve API for using Abort.panic when there are no normal failures #689

Open steinybot opened 5 hours ago

steinybot commented 5 hours ago

If you just use Abort.panic to fatally abort something you end up with Abort[Nothing] which you have to then eliminate using Reducible.eliminate[Abort[Nothing]] which is a bit cumbersome. For example: https://github.com/getkyo/kyo/blob/a62912b34b064c8b860828fc5a8dcb553bbc76af/kyo-prelude/shared/src/test/scala/kyo/StreamTest.scala#L72-L77

steinybot commented 3 hours ago

I forgot to add the bigger issue with Abort[Nothing] is that you can't use Abort.run on it since you can't get a ClassTag[Nothing] or Tag[Nothing].