FailT 0.1.1.0 → 0.1.2.0
raw patch · 6 files changed
+40/−3 lines, 6 filesdep ~mtlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: mtl
API changes (from Hackage documentation)
+ Control.Monad.Trans.Fail: failManyT :: Applicative m => [e] -> FailT e m a
+ Control.Monad.Trans.Fail.String: failManyT :: Applicative m => [String] -> FailT m a
+ Control.Monad.Trans.Fail.Text: failManyT :: Applicative m => [Text] -> FailT m a
Files
- CHANGELOG.md +5/−0
- FailT.cabal +2/−2
- README.md +1/−1
- src/Control/Monad/Trans/Fail.hs +14/−0
- src/Control/Monad/Trans/Fail/String.hs +10/−0
- src/Control/Monad/Trans/Fail/Text.hs +8/−0
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog for `FailT` +## 0.1.2.0++* Compatiblity with mtl-2.3+* Add `failManyT`+ ## 0.1.1.0 * Remove unnecessary `IsString` constraint from instance definitions for GHC >= 8.10
FailT.cabal view
@@ -1,5 +1,5 @@ name: FailT-version: 0.1.1.0+version: 0.1.2.0 synopsis: A 'FailT' monad transformer that plays well with 'MonadFail' description: Fail gracefully when stuck in a 'MonadFail'@@ -13,7 +13,7 @@ . -homepage: https://github.com/lehins/FailT+homepage: https://github.com/lehins/FailT license: BSD3 license-file: LICENSE author: Alexey Kuleshevich
README.md view
@@ -8,7 +8,7 @@ |:--------------:|:---------:|:-------:|:-------:|:---:| | [![GA-CI][GA-B]][GA-L] | [![Coveralls][Co-B]][Co-L] | [![Hackage][Ha-B]][Ha-L] | [![Nightly][StN-B]][StN-L] | [![LTS][StLTS-B]][StLTS-L] | -[GA-B]: https://github.com/lehins/FailT/workflows/FailT-CI/badge.svg+[GA-B]: https://github.com/lehins/FailT/workflows/FailT-CI/badge.svg?branch=master [GA-L]: https://github.com/lehins/FailT/actions [Co-B]: https://coveralls.io/repos/github/lehins/FailT/badge.svg?branch=master [Co-L]: https://coveralls.io/github/lehins/FailT?branch=master
src/Control/Monad/Trans/Fail.hs view
@@ -34,6 +34,7 @@ FailT (..), FailException (..), failT,+ failManyT, runFailT, runFailLastT, runFailAggT,@@ -56,6 +57,9 @@ import Control.Monad.Catch (MonadThrow (throwM)) import Control.Monad.Cont import Control.Monad.Except+#if MIN_VERSION_mtl(2,3,0)+import Control.Monad.Fix+#endif import qualified Control.Monad.Fail as F import Control.Monad.RWS.Class (MonadRWS) import Control.Monad.Reader@@ -162,6 +166,16 @@ -- | Similar to `fail`, but it is not restricted to `String`. failT :: Applicative m => e -> FailT e m a failT = FailT . pure . Left . pure+{-# INLINE failT #-}++-- | Similar to `failT`, but accepts a list of failures.+--+-- prop> runFailAgg (foldMap failT (xs :: [String])) == runFailAgg (failManyT xs)+--+-- @since 0.1.2+failManyT :: Applicative m => [e] -> FailT e m a+failManyT = FailT . pure . Left+{-# INLINE failManyT #-} -- | Similar to `runFail`, except underlying monad is not restricted to `Identity`. --
src/Control/Monad/Trans/Fail/String.hs view
@@ -23,6 +23,7 @@ FailT, F.FailException (..), failT,+ failManyT, runFailT, runFailLastT, runFailAggT,@@ -88,6 +89,15 @@ failT :: Applicative m => String -> FailT m a failT = F.failT {-# INLINE failT #-}++-- | Version of `F.failManyT` restricted to `String`+--+-- prop> runFailAgg (foldMap failT xs) == runFailAgg (failManyT xs)+--+-- @since 0.1.2+failManyT :: Applicative m => [String] -> FailT m a+failManyT = F.failManyT+{-# INLINE failManyT #-} -- | Version of `F.runFailT` restricted to `String` runFailT :: Functor m => FailT m a -> m (Either String a)
src/Control/Monad/Trans/Fail/Text.hs view
@@ -23,6 +23,7 @@ FailT, F.FailException (..), failT,+ failManyT, runFailT, runFailLastT, runFailAggT,@@ -89,6 +90,13 @@ failT :: Applicative m => Text -> FailT m a failT = F.failT {-# INLINE failT #-}++-- | Version of `F.failManyT` restricted to `Text`+--+-- @since 0.1.2+failManyT :: Applicative m => [Text] -> FailT m a+failManyT = F.failManyT+{-# INLINE failManyT #-} -- | Version of `F.runFailT` restricted to `Text` runFailT :: Functor m => FailT m a -> m (Either Text a)