Closed treeowl closed 1 year ago
I document that Ticket
s should never be forced. The alternative, which I've brought up before, is to define Ticket
as a datatype instead of a newtype. In that case, it's important to do the opposite and make sure functions are all strict in tickets so they get unboxed and don't cause delays and thereby CAS failures. Either way, users have to be careful.
I really don't like Ticket
being a newtype. I'm going to close this and see if anyone is interested in the datatype approach.
Use
lazy
instead ofunsafeCoerce#
to block up the optimizer. This should be much more robust under optimization as well as less prone to human error.Remove the utterly bogus
Eq
instance for tickets.Don't force tickets when checking pointer equality for them; while forcing usually makes sense for pointer equality, forcing tickets really never makes sense. And in the context where we do this, the values are all in normal form anyway.
Add strictness annotations to get rid of warnings.
Use
coerce
instead ofunsafeCoerce#
to change primop types to use tickets.Document that tickets should never be forced.
Fixes #5