Skip to content

Commit

Permalink
Make writeTVar more strict
Browse files Browse the repository at this point in the history
It needs to evaluate the argument to WHNF before passing it to
`checkInvariant`.
  • Loading branch information
coot committed Aug 4, 2023
1 parent c3fb129 commit fbac1c5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ readTVarIO :: MonadSTM m => StrictTVar m a -> m a
readTVarIO = Strict.readTVarIO . tvar

writeTVar :: (MonadSTM m, HasCallStack) => StrictTVar m a -> a -> STM m ()
writeTVar v a =
writeTVar v !a =
checkInvariant (invariant v a) $
Strict.writeTVar (tvar v) a

Expand Down

0 comments on commit fbac1c5

Please sign in to comment.