RxHaskell-0.2: Reactive Extensions for Haskell

Safe HaskellSafe

Disposable

Synopsis

Documentation

data Disposable whereSource

Allows disposal of a resource by running an action in the monad m.

Constructors

EmptyDisposable :: Disposable 

Instances

newDisposable :: IO () -> IO DisposableSource

Creates a disposable which runs the given action upon disposal.

dispose :: Disposable -> IO ()Source

Disposes a disposable.

data DisposableSet Source

A synchronized set of disposables.

newDisposableSet :: IO DisposableSetSource

Creates a set of disposables.

addDisposable :: DisposableSet -> Disposable -> IO ()Source

Adds a disposable to a set.

removeDisposable :: DisposableSet -> Disposable -> IO ()Source

Removes a disposable from a set.

toDisposable :: DisposableSet -> IO DisposableSource

Converts a set of disposables into a disposable. The constructed disposable will dispose of all disposables in the set.