control-monad-attempt 0.0.0 → 0.0.1
raw patch · 2 files changed
+26/−3 lines, 2 filesdep ~attemptPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: attempt
API changes (from Hackage documentation)
+ Control.Monad.Attempt: attemptT :: (Monad m) => (forall e. (Exception e) => e -> b) -> (a -> b) -> AttemptT m a -> m b
+ Control.Monad.Attempt: attemptTIO :: (Exception eIn, Exception eOut) => (eIn -> eOut) -> IO v -> AttemptT IO v
Files
- Control/Monad/Attempt.hs +23/−0
- control-monad-attempt.cabal +3/−3
Control/Monad/Attempt.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE Rank2Types #-} --------------------------------------------------------- -- -- Module : Control.Monad.Attempt@@ -17,6 +18,8 @@ module Control.Monad.Attempt ( AttemptT (..) , evalAttemptT+ , attemptT+ , attemptTIO , module Data.Attempt ) where @@ -62,3 +65,23 @@ => AttemptT m v -> m v evalAttemptT = join . liftM fromAttempt . runAttemptT where++-- | The equivalent of 'attempt' for transformers. Given a success and failure+-- handler, eliminates the 'AttemptT' portion of the transformer stack.+attemptT :: Monad m+ => (forall e. Exception e => e -> b)+ -> (a -> b)+ -> AttemptT m a+ -> m b+attemptT s f = liftM (attempt s f) . runAttemptT++-- | Catches runtime (ie, IO) exceptions and represents them in an 'AttemptT'+-- transformer.+--+-- Like 'handle', the first argument to this function must explicitly state the+-- type of its input.+attemptTIO :: (Exception eIn, Exception eOut)+ => (eIn -> eOut)+ -> IO v+ -> AttemptT IO v+attemptTIO f = AttemptT . attemptIO f
control-monad-attempt.cabal view
@@ -1,5 +1,5 @@ name: control-monad-attempt-version: 0.0.0+version: 0.0.1 license: BSD3 license-file: LICENSE author: Michael Snoyman, Nicolas Pouillard@@ -10,12 +10,12 @@ stability: stable cabal-version: >= 1.2 build-type: Simple-homepage: http://github.com/snoyberg/attempt/tree/transformer+homepage: http://github.com/snoyberg/control-monad-attempt library build-depends: base >= 4 && < 5, syb, transformers >= 0.1.4.0,- attempt >= 0.2.0 && < 0.3+ attempt >= 0.2.2 && < 0.3 exposed-modules: Control.Monad.Attempt ghc-options: -Wall