Safe Haskell | Safe |
---|
- data Disposable where
- newDisposable :: IO () -> IO Disposable
- dispose :: Disposable -> IO ()
- data DisposableSet
- newDisposableSet :: IO DisposableSet
- addDisposable :: DisposableSet -> Disposable -> IO ()
- removeDisposable :: DisposableSet -> Disposable -> IO ()
- toDisposable :: DisposableSet -> IO Disposable
Documentation
data Disposable whereSource
Allows disposal of a resource by running an action in the monad m
.
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.