File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
strict-stm/src/Control/Concurrent/Class/MonadSTM/Strict Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module Control.Concurrent.Class.MonadSTM.Strict.TBQueue
11
11
, LazyTBQueue
12
12
, toLazyTBQueue
13
13
, fromLazyTBQueue
14
+ , castStrictTBQueue
14
15
, newTBQueue
15
16
, newTBQueueIO
16
17
, readTBQueue
@@ -45,6 +46,10 @@ newtype StrictTBQueue m a = StrictTBQueue { toLazyTBQueue :: LazyTBQueue m a }
45
46
fromLazyTBQueue :: LazyTBQueue m a -> StrictTBQueue m a
46
47
fromLazyTBQueue = StrictTBQueue
47
48
49
+ castStrictTBQueue :: LazyTBQueue m ~ LazyTBQueue n
50
+ => StrictTBQueue m a -> StrictTBQueue n a
51
+ castStrictTBQueue (StrictTBQueue var) = StrictTBQueue var
52
+
48
53
labelTBQueue :: MonadLabelledSTM m => StrictTBQueue m a -> String -> STM m ()
49
54
labelTBQueue (StrictTBQueue queue) = Lazy. labelTBQueue queue
50
55
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module Control.Concurrent.Class.MonadSTM.Strict.TChan
11
11
, LazyTChan
12
12
, toLazyTChan
13
13
, fromLazyTChan
14
+ , castStrictTChan
14
15
, newTChan
15
16
, newBroadcastTChan
16
17
, writeTChan
@@ -36,6 +37,10 @@ newtype StrictTChan m a = StrictTChan { toLazyTChan :: LazyTChan m a }
36
37
fromLazyTChan :: LazyTChan m a -> StrictTChan m a
37
38
fromLazyTChan = StrictTChan
38
39
40
+ castStrictTChan :: LazyTChan m ~ LazyTChan n
41
+ => StrictTChan m a -> StrictTChan n a
42
+ castStrictTChan (StrictTChan var) = StrictTChan var
43
+
39
44
newTChan :: MonadSTM m => STM m (StrictTChan m a )
40
45
newTChan = StrictTChan <$> Lazy. newTChan
41
46
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ module Control.Concurrent.Class.MonadSTM.Strict.TQueue
12
12
, LazyTQueue
13
13
, toLazyTQueue
14
14
, fromLazyTQueue
15
+ , castStrictTQueue
15
16
, newTQueue
16
17
, newTQueueIO
17
18
, readTQueue
@@ -42,6 +43,10 @@ newtype StrictTQueue m a = StrictTQueue { toLazyTQueue :: LazyTQueue m a }
42
43
fromLazyTQueue :: LazyTQueue m a -> StrictTQueue m a
43
44
fromLazyTQueue = StrictTQueue
44
45
46
+ castStrictTQueue :: LazyTQueue m ~ LazyTQueue n
47
+ => StrictTQueue m a -> StrictTQueue n a
48
+ castStrictTQueue (StrictTQueue var) = StrictTQueue var
49
+
45
50
labelTQueue :: MonadLabelledSTM m => StrictTQueue m a -> String -> STM m ()
46
51
labelTQueue (StrictTQueue queue) = Lazy. labelTQueue queue
47
52
You can’t perform that action at this time.
0 commit comments