managed 1.0.9 → 1.0.10
raw patch · 4 files changed
+23/−10 lines, 4 files
Files
- LICENSE +2/−2
- managed.cabal +7/−7
- src/Control/Monad/Managed.hs +12/−0
- src/Control/Monad/Managed/Safe.hs +2/−1
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2014 Gabriel Gonzalez+Copyright (c) 2014 Gabriella Gonzalez All rights reserved. Redistribution and use in source and binary forms, with or without modification,@@ -8,7 +8,7 @@ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.- * Neither the name of Gabriel Gonzalez nor the names of other contributors+ * Neither the name of Gabriella Gonzalez nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
managed.cabal view
@@ -1,12 +1,12 @@ Name: managed-Version: 1.0.9+Version: 1.0.10 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3 License-File: LICENSE-Copyright: 2014 Gabriel Gonzalez-Author: Gabriel Gonzalez-Maintainer: Gabriel439@gmail.com+Copyright: 2014 Gabriella Gonzalez+Author: Gabriella Gonzalez+Maintainer: GenuineGabriella@gmail.com Tested-With: GHC == 9.2.1 GHC == 9.0.1@@ -17,7 +17,7 @@ GHC == 8.2.2 GHC == 8.0.2 GHC == 7.10.3-Bug-Reports: https://github.com/Gabriel439/Haskell-Managed-Library/issues+Bug-Reports: https://github.com/Gabriella439/managed/issues Synopsis: A monad for managed values Description: In Haskell you very often acquire values using the @with...@ idiom using functions of type @(a -> IO r) -> IO r@. This idiom forms a@@ -37,12 +37,12 @@ Category: Control Source-Repository head Type: git- Location: https://github.com/Gabriel439/Haskell-Managed-Library+ Location: https://github.com/Gabriella439/managed Library Hs-Source-Dirs: src Build-Depends:- base >= 4.5 && < 5 ,+ base >= 4.8 && < 5 , transformers >= 0.2.0.0 && < 0.7 if !impl(ghc >= 8.0) Build-Depends:
src/Control/Monad/Managed.hs view
@@ -99,6 +99,7 @@ MonadManaged(..), managed, managed_,+ defer, with, runManaged, @@ -274,6 +275,17 @@ -- | Like 'managed' but for resource-less operations. managed_ :: MonadManaged m => (forall r. IO r -> IO r) -> m () managed_ f = managed $ \g -> f $ g ()++{-| Defer running an action until exit (via `runManaged`).++For example, the following code will print \"Hello\" followed by \"Goodbye\":++> runManaged $ do+> defer $ liftIO $ putStrLn "Goodbye"+> liftIO $ putStrLn "Hello"+-}+defer :: MonadManaged m => IO r -> m ()+defer m = managed_ (<* m) {-| Acquire a `Managed` value
src/Control/Monad/Managed/Safe.hs view
@@ -20,6 +20,7 @@ MonadManaged(..), managed, managed_,+ defer, runManaged, -- * Re-exports@@ -29,7 +30,7 @@ import Control.Monad.IO.Class (MonadIO(liftIO)) import Control.Monad.Managed- (Managed, MonadManaged(..), managed, managed_, runManaged)+ (Managed, MonadManaged(..), defer, managed, managed_, runManaged) {- $reexports "Control.Monad.IO.Class" re-exports 'MonadIO'