Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All the
unsafeCoerce
tricks to try to block up inlining are quite unreliable, especially these days. We can get much more reliable results by makingTicket
a datatype, and usinglazy
when peeking into it. Do that.Remove the
Eq Ticket
instance. It was never sensible or lawful.Add strictness annotations to suppress warnings.
Add a
peekTicketA
function to extract the value from a ticket in anApplicative
context, so we can unbox the ticket even if the value within will be used lazily.Make
atomicModifyIORefCAS
andatomicModifyIORefCAS_
strictness as consistent as possible in the fall-back case where we useatomicModifyIORef
. As I wrote it, the code is only as strict as it should be forbase >= 4.13
/GHC >= 8.8.1
. The previous promise never to install a thunk in theIORef
simply can't be kept in the fall-back case; adjust the documentation to match reality.Fixes #5.
Fixes #69.