disposable-0.2.0.0: Allows storing different resource-releasing actions together.

Safe HaskellNone
LanguageHaskell2010

Control.Disposable

Synopsis

Documentation

class Disposable a where Source #

A Disposable is something with some resources to release

Minimal complete definition

dispose

Methods

dispose :: a -> IO () Source #

data SomeDisposable where Source #

Allows storing Disposables in a heterogenous container

Constructors

DisposeNone :: SomeDisposable 
Dispose :: forall a. Disposable a => a -> SomeDisposable 
DisposeList :: forall a. Disposable a => [a] -> SomeDisposable 

class Disposing a where Source #

Allow generic deriving instances of things that can be made into SomeDisposable If a data type derives from Generic, and only contain instances of Disposable, then it can be made an instance of Disposing. data Callbacks { ... } deriving Generic instance Disposing Callbacks

class GDisposing f where Source #

Generics instance basically traverses the data tree and expects the values to be all instances of Disposable

Minimal complete definition

gDisposing