composition-prelude 2.0.0.0 → 2.0.1.0
raw patch · 3 files changed
+13/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.Composition: dup :: a -> (a, a)
Files
- CHANGELOG.md +4/−0
- composition-prelude.cabal +3/−3
- src/Control/Composition.hs +6/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # composition-prelude +# 2.0.1.0++ * Add `dup` for tuples+ # 2.0.0.0 * Fix fixity of various operators
composition-prelude.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: composition-prelude-version: 2.0.0.0+version: 2.0.1.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2017-2018 Vanessa McHale@@ -33,9 +33,9 @@ ghc-options: -Wall build-depends: base >=4.11 && <5- + if flag(development) ghc-options: -Werror- + if impl(ghc >=8.0) ghc-options: -Wincomplete-uni-patterns -Wincomplete-record-updates
src/Control/Composition.hs view
@@ -37,6 +37,8 @@ , threadM -- * Tuple helpers , both+ , dup+ -- J inspired: `&:`, `,` etc. -- * Reëxports from base , (<=<) , (>=>)@@ -87,6 +89,9 @@ both :: (a -> b) -> (a, a) -> (b, b) both = join (***) +dup :: a -> (a, a)+dup = join (,)+ -- | Backwards function application (-$) :: (a -> b -> c) -> b -> a -> c (-$) = flip@@ -96,7 +101,7 @@ -- > λ:> ((*2) .* (+)) 1 3 4 -- > 16 (.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d-(.*) f g = \x y -> f (g x y) -- FIXME use lambda approach for better inlining? Like (.) does+(.*) f g = \x y -> f (g x y) (.**) :: (d -> e) -> (a -> b -> c -> d) -> a -> b -> c -> e (.**) f g = \x y z -> f (g x y z)