Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Disposable a where
- data SomeDisposable where
- DisposeNone :: SomeDisposable
- Dispose :: forall a. Disposable a => a -> SomeDisposable
- DisposeList :: forall a. Disposable a => [a] -> SomeDisposable
- class Disposing a where
- class GDisposing f where
Documentation
class Disposable a where Source #
A Disposable
is something with some resources to release
data SomeDisposable where Source #
Allows storing Disposable
s in a heterogenous container
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
disposing :: a -> SomeDisposable Source #
disposing :: (Generic a, GDisposing (Rep a)) => a -> SomeDisposable Source #
class GDisposing f where Source #
Generics instance basically traverses the data tree
and expects the values to be all instances of Disposable
gDisposing :: f p -> DList SomeDisposable Source #
GDisposing U1 Source # | |
Disposing c => GDisposing (K1 i c) Source # | |
(GDisposing f, GDisposing g) => GDisposing ((:+:) f g) Source # | |
(GDisposing f, GDisposing g) => GDisposing ((:*:) f g) Source # | |
GDisposing f => GDisposing (M1 i t f) Source # | |