Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
stm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
stm
Commits
a48ddb86
Commit
a48ddb86
authored
2 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Simplify writeTMVar
parent
d4da9d83
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Control/Concurrent/STM/TMVar.hs
+3
-1
3 additions, 1 deletion
Control/Concurrent/STM/TMVar.hs
with
3 additions
and
1 deletion
Control/Concurrent/STM/TMVar.hs
+
3
−
1
View file @
a48ddb86
...
...
@@ -151,8 +151,10 @@ swapTMVar (TMVar t) new = do
-- | Non-blocking write of a new value to a 'TMVar'
-- Puts if empty. Replaces if populated.
--
-- @since 2.5.1
writeTMVar
::
TMVar
a
->
a
->
STM
()
writeTMVar
t
new
=
tryTak
eT
M
Var
t
>>
putTMVar
t
new
writeTMVar
(
TMVar
t
)
new
=
writ
eTVar
t
(
Jus
t
new
)
-- |Check whether a given 'TMVar' is empty.
isEmptyTMVar
::
TMVar
a
->
STM
Bool
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment