Skip to content

Commit

Permalink
precise-side-effects: Change atomicallyC type argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
queezle42 committed Nov 21, 2023
1 parent dfaed57 commit 796c1ae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions precise-side-effects/src/Control/Concurrent/STM/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,13 @@ instance (Monad (t m), MonadTrans t, MonadSTMcBase m) => MonadSTMcBase (t m) whe


type MonadSTMc :: RetryKind -> [Type] -> (Type -> Type) -> Constraint
type MonadSTMc canRetry exceptions m = (If (canRetry == Retry) (MonadRetry m) (() :: Constraint), MonadSTMcBase m, ThrowForAll exceptions m, ThrowForAll exceptions (STMc canRetry exceptions))
type MonadSTMc canRetry exceptions m =
(
If (canRetry == Retry) (MonadRetry m) (() :: Constraint),
MonadSTMcBase m,
ThrowForAll exceptions m,
ThrowForAll exceptions (STMc canRetry exceptions)
)


liftSTMc ::
Expand Down Expand Up @@ -348,7 +354,10 @@ orElseNothing fx = unsafeLiftSTM (STM.orElse (Just <$> runSTMc fx) (pure Nothing
{-# INLINABLE orElseNothing #-}


atomicallyC :: MonadIO m => STMc canRetry exceptions a -> m a
atomicallyC ::
forall canRetry exceptions m a.
MonadIO m =>
STMc canRetry exceptions a -> m a
atomicallyC = liftIO . STM.atomically . runSTMc
{-# INLINABLE atomicallyC #-}

Expand Down

0 comments on commit 796c1ae

Please sign in to comment.