packages feed

composition-prelude 2.0.5.0 → 3.0.0.0

raw patch · 4 files changed

+62/−40 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Control.Composition: (-.*) :: (b -> c) -> (a -> c -> d) -> a -> b -> d
- Control.Composition: (-.**) :: (c -> d) -> (a -> b -> d -> e) -> a -> b -> c -> e
- Control.Composition: (-.***) :: (d -> e) -> (a -> b -> c -> e -> f) -> a -> b -> c -> d -> f
- Control.Composition: (-.****) :: (e -> f) -> (a -> b -> c -> d -> f -> g) -> a -> b -> c -> d -> e -> g
+ Control.Composition: (&:) :: (b -> b -> c) -> (a -> b) -> a -> a -> c
+ Control.Composition: (+>) :: (a -> b) -> (a, a) -> (b, b)
+ Control.Composition: (.@@@@@) :: (f -> g) -> (a -> b -> c -> d -> e -> g -> h) -> a -> b -> c -> d -> e -> f -> h
+ Control.Composition: (<**>) :: Applicative f => f a -> f (a -> b) -> f b
+ Control.Composition: infixl 4 <**>
+ Control.Composition: infixr 6 +>
- Control.Composition: infixr 8 -.****
+ Control.Composition: infixr 8 .@@@@@

Files

CHANGELOG.md view
@@ -1,7 +1,15 @@ # composition-prelude +# 3.0.0.0++  * Remove `-.**` etc. and replace with `.@`+  * Fix documentation+  * Add rule for `thread`+  * `-.` has a different fixity+  * Add `+>`, `&:` infix synonyms+ # 2.0.5.0-  +   * Add `(.*****)` and `(.******)`.   * Polish documentation @@ -15,7 +23,7 @@   * Improved documentation  # 2.0.2.2-  +   * Polish documentation  # 2.0.2.1
LICENSE view
@@ -1,4 +1,4 @@-Copyright Vanessa McHale (c) 2017+Copyright Vanessa McHale (c) 2017-2020  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 
composition-prelude.cabal view
@@ -1,9 +1,9 @@ cabal-version: 1.18 name: composition-prelude-version: 2.0.5.0+version: 3.0.0.0 license: BSD3 license-file: LICENSE-copyright: Copyright: (c) 2017-2019 Vanessa McHale+copyright: Copyright: (c) 2017-2020 Vanessa McHale maintainer: vamchale@gmail.com author: Vanessa McHale bug-reports: https://hub.darcs.net/vmchale/composition-prelude/issues
src/Control/Composition.hs view
@@ -7,15 +7,12 @@     , (.*****)     , (.******)     -- * Precomposition+    , (-.)     , (.@)     , (.@@)     , (.@@@)     , (.@@@@)-    , (-.)-    , (-.*)-    , (-.**)-    , (-.***)-    , (-.****)+    , (.@@@@@)     -- * Monadic postcomposition     , (<=*<)     , (<=**<)@@ -45,10 +42,13 @@     -- * Tuple helpers     , both     , dup-    -- J inspired: `&:`, `,` etc.+    , (+>)+    -- * J inspired+    , (&:)     -- * Reëxports from base     , (<=<)     , (>=>)+    , (<**>)     , (&)     , (<&>)     , fix@@ -70,14 +70,13 @@ infixr 8 .**** infixr 8 .***** infixr 8 .******-infixr 8 -.*-infixr 8 -.**-infixr 8 -.***-infixr 8 -.****+infixr 8 -. infixr 8 .@ infixr 8 .@@ infixr 8 .@@@ infixr 8 .@@@@+infixr 8 .@@@@@+infixl 0 &: infixl 3 .$ infixl 8 -$ infixl 8 ~@~@@ -90,6 +89,7 @@ infixr 1 >-=*> infixr 1 <-=**< infixr 1 >-=**>+infixr 6 +>  axe :: (Traversable t, Applicative f) => t (a -> f ()) -> a -> f () axe = sequenceA_ .* sequenceA@@ -100,6 +100,18 @@ biaxe :: (Traversable t, Applicative f) => t (a -> b -> f ()) -> a -> b -> f () biaxe = sequenceA_ .** bisequence' +-- | Pronounced \'appose\'. Synonym for 'on'+--+-- @since 3.0.0.0+(&:) :: (b -> b -> c) -> (a -> b) -> a -> a -> c+(&:) = on++-- | Infix synonym for 'both'+--+-- @since 3.0.0.0+(+>) :: (a -> b) -> (a, a) -> (b, b)+(+>) = both+ both :: (a -> b) -> (a, a) -> (b, b) both = join (***) @@ -117,6 +129,16 @@ -- -- > between .$ (char '"') --+-- Or+--+-- > fromEither :: Either a a -> a+-- > fromEither = either id id+--+-- to+--+-- > fromEither :: Either a a -> a+-- > fromEither = either .$ id+-- -- @since 2.0.2.0 (.$) :: Monad m => m (m a) -> m a (.$) = join@@ -125,10 +147,6 @@ (-$) :: (a -> b -> c) -> b -> a -> c (-$) = flip --- | As an example:------ > λ:> ((*2) .* (+)) 1 3 4--- > 16 (.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d (.*) f g = \x y -> f (g x y) @@ -196,49 +214,45 @@ (>-=**>) :: Monad m => (a -> b -> d -> m e) -> (c -> m d) -> a -> b -> c -> m e (>-=**>) g f = \x y z -> g x y =<< f z --- | The Oedipus combinator-(-.*) :: (b -> c) -> (a -> c -> d) -> a -> b -> d-(-.*) f g = \x y -> g x (f y)- -- | @since 2.0.3.0 (.@) :: (b -> c) -> (a -> c -> d) -> a -> b -> d (.@) f g = \x y -> g x (f y) -(-.**) :: (c -> d) -> (a -> b -> d -> e) -> a -> b -> c -> e-(-.**) f g = \x y z -> g x y (f z)-{-# DEPRECATED (-.**) "Use '.@@' instead" #-}- -- | @since 2.0.3.0 (.@@) :: (c -> d) -> (a -> b -> d -> e) -> a -> b -> c -> e (.@@) f g = \x y z -> g x y (f z) -(-.***) :: (d -> e) -> (a -> b -> c -> e -> f) -> a -> b -> c -> d -> f-(-.***) f g = \w x y z -> g w x y (f z)-{-# DEPRECATED (-.***) "Use '.@@@' instead" #-}- -- | @since 2.0.3.0 (.@@@) :: (d -> e) -> (a -> b -> c -> e -> f) -> a -> b -> c -> d -> f (.@@@) f g = \w x y z -> g w x y (f z) -(-.****) :: (e -> f) -> (a -> b -> c -> d -> f -> g) -> a -> b -> c -> d -> e -> g-(-.****) f g = \v w x y z -> g v w x y (f z)-{-# DEPRECATED (-.****) "Use '.@@@@' instead" #-}- -- | @since 2.0.3.0 (.@@@@) :: (e -> f) -> (a -> b -> c -> d -> f -> g) -> a -> b -> c -> d -> e -> g (.@@@@) f g = \v w x y z -> g v w x y (f z) --- | Backwards function composition. This is a specialization of '<&>'.+-- | @since 3.0.0.0+(.@@@@@) :: (f -> g) -> (a -> b -> c -> d -> e -> g -> h) -> a -> b -> c -> d -> e -> f -> h+(.@@@@@) f g = \u v w x y z -> g u v w x y (f z)++-- | Backwards function composition. This is a specialization of '<&>', but it+-- has a different fixity. (-.) :: (a -> b) -> (b -> c) -> a -> c (-.) = (<&>)-{-# DEPRECATED (-.) "Use '<&>' instead" #-} +-- infixl 1+-- (.&) :: a -> b -> (a -> b -> c) -> c+--+-- infixr 0+-- (.$) :: (a -> b -> c) -> a -> b -> c+ {-# RULES-    "thread" forall f g.   thread [f, g]    = f . g;-    "thread" forall f g h. thread [f, g, h] = f . g . h;-    "thread" forall f fs.  thread (f:fs)    = f . thread fs+    "thread"     forall f g.   thread [f, g]              = f . g;+    "thread"     forall f g h. thread [f, g, h]           = f . g . h;+    "thread"     forall f fs.  thread (f:fs)              = f . thread fs;+    "thread/map" forall fs.    thread [ map f | f <- fs ] = map (thread fs)   #-} +-- | @since 1.1.0.1 thread :: Foldable t => t (a -> a) -> a -> a thread = foldr (.) id