disposable 0.2.0.0 → 0.2.0.1
raw patch · 2 files changed
+3/−6 lines, 2 filesdep +ghcjs-base-stubPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependencies added: ghcjs-base-stub
API changes (from Hackage documentation)
+ Control.Disposable: instance Control.Disposable.Disposable (GHCJS.Foreign.Callback.Internal.Callback a)
+ Control.Disposable: instance Control.Disposable.Disposing (GHCJS.Foreign.Callback.Internal.Callback a)
Files
- disposable.cabal +3/−1
- src/Control/Disposable.hs +0/−5
disposable.cabal view
@@ -1,5 +1,5 @@ name: disposable-version: 0.2.0.0+version: 0.2.0.1 synopsis: Allows storing different resource-releasing actions together. description: SomeDisposable aloows storing different resource releasing actions togther in a container. This library is useful for queueing up GHCJS.Foreign.Callback together to be released@@ -24,6 +24,8 @@ default-language: Haskell2010 if impl(ghcjs) build-depends: ghcjs-base+ if !impl(ghcjs)+ build-depends: ghcjs-base-stub >= 0.1.0.2 && < 1 source-repository head type: git
src/Control/Disposable.hs view
@@ -13,10 +13,7 @@ import Data.Foldable import Data.Semigroup import qualified GHC.Generics as G--#ifdef __GHCJS__ import qualified GHCJS.Foreign.Callback as J-#endif -- | A 'Disposable' is something with some resources to release class Disposable a where@@ -43,13 +40,11 @@ default disposing :: (G.Generic a, GDisposing (G.Rep a)) => a -> SomeDisposable disposing x = DisposeList . D.toList . gDisposing $ G.from x -#ifdef __GHCJS__ instance Disposable (J.Callback a) where dispose = J.releaseCallback instance Disposing (J.Callback a) where disposing = Dispose-#endif -- | Generics instance basically traverses the data tree -- and expects the values to be all instances of 'Disposable'