Skip to content

Commit

Permalink
Add labelMVar to the strict MVar library
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Oct 15, 2024
1 parent fc24459 commit 105b589
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions io-classes/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

* Added `threadLabel` to `MonadThread`
* Added `MonadLabelledMVar` class.
* Added `labelMVar` to `Control.Concurrent.Class.MonadMVar.Strict`

### 1.7.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module Control.Concurrent.Class.MonadMVar.Strict
, modifyMVarMasked_
, modifyMVarMasked
, tryReadMVar
, labelMVar
-- * Re-exports
, MonadMVar
) where
Expand Down Expand Up @@ -62,6 +63,9 @@ toLazyMVar = mvar
fromLazyMVar :: Lazy.MVar m a -> StrictMVar m a
fromLazyMVar = StrictMVar

labelMVar :: MonadLabelledMVar m => StrictMVar m a -> String -> m ()
labelMVar (StrictMVar m) = Lazy.labelMVar m

newEmptyMVar :: MonadMVar m => m (StrictMVar m a)
newEmptyMVar = fromLazyMVar <$> Lazy.newEmptyMVar

Expand Down

0 comments on commit 105b589

Please sign in to comment.