-
Notifications
You must be signed in to change notification settings - Fork 21
Implement Chan
, QSem
and QSemN
#211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
getChanContents ch = do | ||
x <- readChan ch | ||
xs <- getChanContents ch | ||
return (x:xs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work without unsafeInterleaveIO
? Could you add some tests?
writeChan = IO.writeChan | ||
readChan = IO.readChan | ||
dupChan = IO.dupChan | ||
getChanContents = IO.getChanContents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getChanContents = IO.getChanContents | |
getChanContents = IO.getChanContents | |
writeList2Chan = IO.writeList2Chan |
@@ -2,6 +2,7 @@ | |||
|
|||
## next version | |||
|
|||
- Implements `MonadChan`, `MonadQSem` and `MonadQSemN` instances. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Implements `MonadChan`, `MonadQSem` and `MonadQSemN` instances. | |
- Added `MonadChan`, `MonadQSem` and `MonadQSemN` type classes and their instances. |
putMVar m r') | ||
signalQSem (QSem m) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add some space between definitions
putMVar m r') | |
signalQSem (QSem m) = | |
putMVar m r') | |
signalQSem (QSem m) = |
unit <- modifyMVar m $ \(i,a1,a2) -> loop (sz0 + i) a1 a2 | ||
|
||
evaluate unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit <- modifyMVar m $ \(i,a1,a2) -> loop (sz0 + i) a1 a2 | |
evaluate unit | |
unit <- modifyMVar m $ \(i,a1,a2) -> loop (sz0 + i) a1 a2 | |
evaluate unit |
@@ -6,6 +6,7 @@ | |||
|
|||
### Breaking changes | |||
|
|||
- Added `MonadChan`, `MonadQSem` and `MonadQSemN` classes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Added `MonadChan`, `MonadQSem` and `MonadQSemN` classes. | |
* Added `MonadChan`, `MonadQSem` and `MonadQSemN` classes. |
😁
I am planning to release |
Closes #128