packages feed

attempt 0.2.1 → 0.2.2

raw patch · 2 files changed

+15/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Attempt: attemptIO :: (Exception eIn, Exception eOut) => (eIn -> eOut) -> IO v -> IO (Attempt v)

Files

Data/Attempt.hs view
@@ -38,6 +38,8 @@     , successes     , failures     , partitionAttempts+      -- * Runtime exceptions+    , attemptIO       -- * Reexport the 'Failure' class     , module Control.Failure     ) where@@ -185,3 +187,15 @@  where   f a (l, r) = (E.toException a:l, r)   s a (l, r) = (l, a:r)++-- | Catches runtime (ie, IO) exceptions inserts them into an 'Attempt'.+--+-- Like 'handle', the first argument to this function must explicitly state the+-- type of its input.+attemptIO :: (E.Exception eIn, E.Exception eOut)+          => (eIn -> eOut)+          -> IO v+          -> IO (Attempt v)+attemptIO f =+      E.handle (return . Failure . f)+    . fmap Success
attempt.cabal view
@@ -1,5 +1,5 @@ name:            attempt-version:         0.2.1+version:         0.2.2 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman, Nicolas Pouillard