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 0d16bb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion strict-checked-vars/strict-checked-vars.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: strict-checked-vars
version: 0.1.0.2
version: 0.1.0.3
synopsis:
Strict MVars and TVars with invariant checking for IO and IOSim

Expand Down

0 comments on commit 0d16bb3

Please sign in to comment.