Control.Concurrent.Chan.Lifted

lifted-base-0.2.3.12: lifted IO operations from the base library

Copyright | Liyang HU Bas van Dijk
License | BSD-style
Maintainer | Bas van Dijk <v.dijk.bas@gmail.com>
Stability | experimental
Safe Haskell | Safe
Language | Haskell98

Control.Concurrent.Chan.Lifted

Description

This is a wrapped version of Control.Concurrent.Chan with types generalised from `IO` to all monads in `MonadBase`.

`unGetChan` and `isEmptyChan` are deprecated in `base`, therefore they are not included here. Use `TVar` instead.

Synopsis

- data Chan a
- newChan :: MonadBase IO m => m (Chan a)
- writeChan :: MonadBase IO m => Chan a -> a -> m ()
- readChan :: MonadBase IO m => Chan a -> m a
- dupChan :: MonadBase IO m => Chan a -> m (Chan a)
- getChanContents :: MonadBase IO m => Chan a -> m [a]
- writeList2Chan :: MonadBase IO m => Chan a -> [a] -> m ()

# Documentation

data Chan a #

`Chan` is an abstract type representing an unbounded FIFO channel.

#### Instances

Instances details

Eq (Chan a) | Since: base-4.4.0.0
Instance details Defined in Control.Concurrent.Chan Methods (==) :: Chan a -> Chan a -> Bool # (/=) :: Chan a -> Chan a -> Bool #

newChan :: MonadBase IO m => m (Chan a) #

Generalized version of `newChan`.

writeChan :: MonadBase IO m => Chan a -> a -> m () #

Generalized version of `writeChan`.

readChan :: MonadBase IO m => Chan a -> m a #

Generalized version of `readChan`.

dupChan :: MonadBase IO m => Chan a -> m (Chan a) #

Generalized version of `dupChan`.

getChanContents :: MonadBase IO m => Chan a -> m [a] #

Generalized version of `getChanContents`.

writeList2Chan :: MonadBase IO m => Chan a -> [a] -> m () #

Generalized version of `writeList2Chan`.