composition-prelude 1.4.0.1 → 1.4.0.2
raw patch · 2 files changed
+37/−2 lines, 2 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- composition-prelude.cabal +2/−2
- src/Control/Composition.hs +35/−0
composition-prelude.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: composition-prelude-version: 1.4.0.1+version: 1.4.0.2 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2017-2018 Vanessa McHale@@ -35,7 +35,7 @@ default-language: Haskell2010 ghc-options: -Wall build-depends:- base >=4.8 && <5+ base >=4.3 && <5 if flag(development) ghc-options: -Werror
src/Control/Composition.hs view
@@ -35,8 +35,14 @@ import Control.Arrow ((***)) import Control.Monad+#if MIN_VERSION_base(4,7,0) import Data.Bool (bool)+#endif+#if MIN_VERSION_base(4,8,0) import Data.Function (fix, on, (&))+#else+import Data.Function (fix, on)+#endif #if defined(MIN_VERSION_lens) #if MIN_VERSION_lens(3,0) import Control.Lens ((<&>))@@ -56,6 +62,9 @@ infixr 8 -.*** infixr 8 -.**** infixl 8 -$+#if !(MIN_VERSION_base(4,8,0))+infixl 1 &+#endif #if defined(MIN_VERSION_lens) #if !MIN_VERSION_lens(3,0) infixl 1 <&>@@ -68,14 +77,40 @@ infixl 1 <&> #endif +#if !(MIN_VERSION_base(4,8,0))+(&) :: a -> (a -> b) -> b+(&) x f = f x+#endif++#if !MIN_VERSION_base(4,8,0)+axe :: (Monad m) => [a -> m ()] -> a -> m ()+#else axe :: (Traversable t, Monad m) => t (a -> m ()) -> a -> m ()+#endif axe = sequence_ .* sequence +#if !MIN_VERSION_base(4,8,0)+bisequence' :: (Monad m) => [a -> b -> m c] -> a -> b -> [m c]+#else bisequence' :: (Traversable t, Monad m) => t (a -> b -> m c) -> a -> b -> t (m c)+#endif bisequence' = sequence .* sequence +#if !MIN_VERSION_base(4,8,0)+biaxe :: (Monad m) => [a -> b -> m ()] -> a -> b -> m ()+#else biaxe :: (Traversable t, Monad m) => t (a -> b -> m ()) -> a -> b -> m ()+#endif biaxe = sequence_ .** bisequence'++#if !(MIN_VERSION_base(4,7,0))+-- | See+-- [here](http://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Bool.html#v:bool)+-- for docs.+bool :: a -> a -> Bool -> a+bool x _ False = x+bool _ x True = x+#endif both :: (a -> b) -> (a, a) -> (b, b) both = join (***)