| Copyright | (C) 2014-2017 Merijn Verstraaten |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Merijn Verstraaten <merijn@inconsistent.nl> |
| Stability | experimental |
| Portability | haha |
| Safe Haskell | Safe |
| Language | Haskell2010 |
BroadcastChan.Throw
Description
Re-export of Broadcast that replaces
BroadcastChan.writeBChan and
BroadcastChan.readBChan with versions that throw an
exception, rather than returning results that the user has to inspect to
check for success.
- data BChanError
- readBChan :: BroadcastChan Out a -> IO a
- writeBChan :: BroadcastChan In a -> a -> IO ()
- module BroadcastChan
Documentation
data BChanError Source #
Exception type for BroadcastChan operations.
Constructors
| WriteFailed | Attempted to write to closed |
| ReadFailed | Attempted to read from an empty closed |
Instances
readBChan :: BroadcastChan Out a -> IO a Source #
Like readBChan, but throws a ReadFailed exception when
reading from a closed and empty BroadcastChan.
writeBChan :: BroadcastChan In a -> a -> IO () Source #
Like writeBChan, but throws a WriteFailed exception when
writing to closed BroadcastChan.
module BroadcastChan