Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar
Commits
3d8d8912
Commit
3d8d8912
authored
2 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Generalize functions
Co-authored-by:
Jan Beinke
<
git@janbeinke.com
>
parent
0e2d936c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stm-ltd/src/Control/Concurrent/STM/Class.hs
+11
-11
11 additions, 11 deletions
stm-ltd/src/Control/Concurrent/STM/Class.hs
with
11 additions
and
11 deletions
stm-ltd/src/Control/Concurrent/STM/Class.hs
+
11
−
11
View file @
3d8d8912
...
...
@@ -183,12 +183,12 @@ class Monad m => MonadSTM' (r :: RetryMode) (t :: ThrowMode) m | m -> r, m -> t
type
MonadSTM
=
MonadSTM'
CanRetry
CanThrow
liftSTM
::
MonadSTM
m
=>
STM
a
->
m
a
liftSTM
fn
=
liftSTM'
(
unsafeLimit
STM
fn
)
liftSTM
fn
=
liftSTM'
(
STM
'
fn
)
{-# INLINABLE liftSTM #-}
instance
MonadSTM'
CanRetry
CanThrow
STM
where
liftSTM'
=
runSTM'
liftSTM'
(
STM'
f
)
=
f
{-# INLINE CONLIKE liftSTM' #-}
instance
MonadSTM'
r
t
(
STM'
r
t
)
where
...
...
@@ -212,17 +212,17 @@ instance (MonadSTM' r t m, Monoid w) => MonadSTM' r t (RWST rd w s m) where
{-# INLINABLE liftSTM' #-}
runSTM'
::
STM'
r
t
a
->
STM
a
runSTM'
(
STM'
f
n
)
=
f
n
{-# INLIN
E CONLIK
E runSTM' #-}
runSTM'
::
MonadSTM
m
=>
STM'
r
t
a
->
m
a
runSTM'
(
STM'
f
)
=
liftSTM
f
{-# INLIN
ABL
E runSTM' #-}
noRetry
::
STM'
NoRetry
t
a
->
STM'
r
t
a
noRetry
(
STM'
f
)
=
(
STM'
f
)
{-# INLIN
E CONLIK
E noRetry #-}
noRetry
::
MonadSTM'
r
t
m
=>
STM'
NoRetry
t
a
->
m
a
noRetry
=
unsafeLimitSTM
.
run
STM'
{-# INLIN
ABL
E noRetry #-}
noThrow
::
STM'
r
NoThrow
a
->
STM'
r
t
a
noThrow
(
STM'
f
)
=
(
STM'
f
)
{-# INLIN
E CONLIK
E noThrow #-}
noThrow
::
MonadSTM'
r
t
m
=>
STM'
r
NoThrow
a
->
m
a
noThrow
=
unsafeLimitSTM
.
run
STM'
{-# INLIN
ABL
E noThrow #-}
unsafeLimitSTM
::
(
MonadSTM'
r
t
m
)
=>
STM
a
->
m
a
...
...
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