composition 0.2 → 0.2.1
raw patch · 3 files changed
+15/−8 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Composition: (.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
Files
- LICENSE +1/−1
- composition.cabal +2/−3
- src/Data/Composition.hs +12/−4
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c)2011, Dan Burton +Copyright (c) 2011-2012, Dan Burton All rights reserved.
composition.cabal view
@@ -1,5 +1,5 @@ Name: composition -Version: 0.2 +Version: 0.2.1 Synopsis: Combinators for unorthodox function composition License: BSD3 License-file: LICENSE @@ -10,7 +10,6 @@ Cabal-version: >=1.2 Library - hs-source-dirs: src + hs-source-dirs: src Exposed-modules: Data.Composition Build-depends: base >= 2 && < 5 -
src/Data/Composition.hs view
@@ -1,4 +1,5 @@ module Data.Composition ( + (.:), (.*), (.**), (.***), @@ -17,15 +18,22 @@ compose9 ) where --- | This function can be more clearly defined as +-- | This function is defined as -- --- > (.*) f g x y = f (g x y) --- --- Example usage: @bind = join .* flip fmap@ +-- > (.:) f g x y = f (g x y) +-- +-- Example usage: @bind = join .: flip fmap@ -- Notice how two arguments will be given to @flip fmap@ before the result -- is passed to @join@. -- -- This is equivalent to @bind v f = join (fmap v f)@ +(.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d +(.:) f g x y = f (g x y) + +-- | Equivalent to '(.:)' +-- +-- The pattern of appending asterisks is more extensible, +-- but uncommon in practice. (.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d (.*) = (.) . (.)