Skip to content

Commit 5b9f182

Browse files
committed
io-sim-por: inline some functions
1 parent 1931d8a commit 5b9f182

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

io-sim/src/Control/Monad/IOSimPOR/Internal.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,9 +1251,11 @@ execNewTVar nextVid !mbLabel x = do
12511251

12521252
execReadTVar :: TVar s a -> ST s a
12531253
execReadTVar TVar{tvarCurrent} = readSTRef tvarCurrent
1254+
{-# INLINE execReadTVar #-}
12541255

12551256
execWriteTVar :: TVar s a -> a -> ST s ()
12561257
execWriteTVar TVar{tvarCurrent} = writeSTRef tvarCurrent
1258+
{-# INLINE execWriteTVar #-}
12571259

12581260
saveTVar :: TVar s a -> ST s ()
12591261
saveTVar TVar{tvarCurrent, tvarUndo} = do
@@ -1268,12 +1270,14 @@ revertTVar TVar{tvarCurrent, tvarUndo} = do
12681270
(v:vs) <- readSTRef tvarUndo
12691271
writeSTRef tvarCurrent v
12701272
writeSTRef tvarUndo vs
1273+
{-# INLINE revertTVar #-}
12711274

12721275
commitTVar :: TVar s a -> ST s ()
12731276
commitTVar TVar{tvarUndo} = do
12741277
-- pop the undo stack, leaving the current value unchanged
12751278
(_:vs) <- readSTRef tvarUndo
12761279
writeSTRef tvarUndo vs
1280+
{-# INLINE commitTVar #-}
12771281

12781282
readTVarUndos :: TVar s a -> ST s [a]
12791283
readTVarUndos TVar{tvarUndo} = readSTRef tvarUndo

0 commit comments

Comments
 (0)