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

Safe HaskellNone
LanguageHaskell2010

Control.Disposable

Synopsis

Documentation

class Disposable a where #

A Disposable is something with some resources to release

Minimal complete definition

dispose

Methods

dispose :: a -> IO () #

Instances

data SomeDisposable where #

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 #

Allow generic deriving instances of things that can be made into SomeDisposable If a data type derives from Generic, and only contain instances of Disposing, then it can also be made an instance of Disposing. Eg. @ import Glazier.React as R import GHCJS.Foreign.Callback as J import GHC.Generics as G

data Plan = Plan { _component :: R.ReactComponent , _onRender :: J.Callback (J.JSVal -> IO J.JSVal) ... } deriving G.Generic instance Disposing Plan @

class GDisposing f where #

Generic instance basically traverses the data type structure and expects the values to be all instances of Disposing

Minimal complete definition

gDisposing

Methods

gDisposing :: f p -> DList SomeDisposable #

Instances

GDisposing (U1 *) # 
Disposing c => GDisposing (K1 * i c) # 

Methods

gDisposing :: K1 * i c p -> DList SomeDisposable #

(GDisposing f, GDisposing g) => GDisposing ((:+:) * f g) # 

Methods

gDisposing :: (* :+: f) g p -> DList SomeDisposable #

(GDisposing f, GDisposing g) => GDisposing ((:*:) * f g) # 

Methods

gDisposing :: (* :*: f) g p -> DList SomeDisposable #

GDisposing f => GDisposing (M1 * i t f) # 

Methods

gDisposing :: M1 * i t f p -> DList SomeDisposable #