composition-prelude 1.2.0.1 → 1.3.0.0
raw patch · 2 files changed
+10/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Control.Composition: threadM_ :: (Applicative f) => [f ()] -> f ()
+ Control.Composition: axe :: (Traversable t, Monad m) => t (a -> m ()) -> a -> m ()
+ Control.Composition: biaxe :: (Traversable t, Monad m) => t (a -> b -> m ()) -> a -> b -> m ()
Files
composition-prelude.cabal view
@@ -1,5 +1,5 @@ name: composition-prelude-version: 1.2.0.1+version: 1.3.0.0 synopsis: Higher-order function combinators description: Replacement for `composition` or `composition-exta`, exporting everything in one sane module. homepage: https://github.com/vmchale/composition-prelude#readme
src/Control/Composition.hs view
@@ -14,9 +14,11 @@ , (-.****) -- * Fancy function application , (-$)+ -- * Monadic actions+ , axe+ , biaxe -- * Composition with lists of functions , thread- , threadM_ -- * Tuple helpers , both -- * Functor helpers@@ -66,6 +68,12 @@ infixl 1 <&> #endif +axe :: (Traversable t, Monad m) => t (a -> m ()) -> a -> m ()+axe = sequence_ .* sequence++biaxe :: (Traversable t, Monad m) => t (a -> b -> m ()) -> a -> b -> m ()+biaxe = sequence_ .** sequence .* sequence+ both :: (a -> b) -> (a, a) -> (b, b) both = join (***) @@ -120,9 +128,6 @@ thread :: [a -> a] -> a -> a thread = foldr (.) id--threadM_ :: (Applicative f) => [f ()] -> f ()-threadM_ = foldr (*>) (pure ()) -- setZip :: [ASetter a a b b] -> [b] -> a -> a -- setZip ls ts = thread (zipWith set ls ts)