scala-library-next
scala-library-next copied to clipboard
Unboxed Option
It keeps coming up, and we still don't have it. Even if we have to have Option and UOption in the stdlib at the same time, I think it's probably better than people using null all the time over concerns about the overhead cost of Option. As has been noted by @sjrd a lot of times, null cannot be equivalent to Option due to its lack of parametricity (I think?).
And Seb has already written the implementation too!
We can also give it easy (implicit?) conversions to and from "normal" Options.
For reference, this is my implementation: https://github.com/sjrd/scala-unboxed-option
oops, sorry for not linking it
@sjrd I assume you're okay with licensing your implementation to Lightbend/EPFL under Apache 2?
What would be the migration story? Do we want to eventually keep both options? @sjrd do you have download stats for your implementation?
Sure, I can relicense it under Apache 2.
Download stats are not useful: the library has 3 methods or so, so it's not even usable as is. Nobody would actually use as such. I wrote it as a proof of concept.
motivated in part by discussions on https://contributors.scala-lang.org/t/elvis-operator-for-explicit-nulls/4639