packages feed

composition-prelude (empty) → 0.1.0.0

raw patch · 7 files changed

+137/−0 lines, 7 filesdep +basesetup-changed

Dependencies added: base

Files

+ .travis.yml view
@@ -0,0 +1,18 @@+sudo: false+language: default+cache:+  directories:+  - $HOME/.stack+addons:+    apt:+        packages:+            - libgmp3-dev+before_install:+- mkdir -p ~/.local/bin+- export PATH=$HOME/.local/bin:$PATH+- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'+- chmod a+x ~/.local/bin/stack+install:+- stack --no-terminal --install-ghc test --only-dependencies+script:+- stack --no-terminal test --bench --haddock --no-haddock-deps
+ LICENSE view
@@ -0,0 +1,11 @@+Copyright Vanessa McHale (c) 2017++Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.++3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,7 @@+# composition-prelude++Higher-order function composition.++An alternate version of what's provided in+[composition](https://hackage.haskell.org/package/composition) and+[composition-extra](https://hackage.haskell.org/package/composition-extra).
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ composition-prelude.cabal view
@@ -0,0 +1,35 @@+name:                composition-prelude+version:             0.1.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+license:             BSD3+license-file:        LICENSE+author:              Vanessa McHale+maintainer:          vanessa.mchale@reconfigure.io+copyright:           Copyright: (c) 2017 Vanessa McHale+category:            Control, Data+build-type:          Simple+extra-source-files:  README.md+                   , stack.yaml+                   , .travis.yml+cabal-version:       >=1.10++Flag development {+  Description: Enable `-Werror`+  manual: True+  default: False+}++library+  hs-source-dirs:      src+  exposed-modules:     Control.Composition+  build-depends:       base >= 4.7 && < 5+  default-language:    Haskell2010+  if flag(development)+    ghc-options: -Werror+  ghc-options:         -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wmissing-import-lists++source-repository head+  type:     git+  location: https://github.com/vmchale/composition-prelude
+ src/Control/Composition.hs view
@@ -0,0 +1,56 @@+module Control.Composition+    ( -- ^ Postcomposition+      (.*)+    , (.**)+    -- ^ Precomposition+    , (-.)+    , (-.*)+    -- ^ Tuple helpers+    , both+    -- ^ Reexports from Control.Arrow+    , (&&&)+    , (***)+    -- ^ Reexports from Control.Monad+    , join+    , (=<<)+    , (>=>)+    , (<=<)+    -- ^ Reexports from base+    , (&)+    , fix+    , on+    ) where++import           Control.Arrow ((&&&), (***))+import           Control.Monad (join, (<=<), (=<<), (>=>))+import           Data.Function (fix, on, (&))++infixr 8 .*+infixr 8 -.*++{-weird' :: (b -> (c -> d)) -> (a -> (c -> b)) -> (a -> (c -> d))+weird' = (<=<)++weird :: (a -> (b -> c)) -> (b -> a) -> (b -> c)+weird = (=<<)-}++both :: (a -> b) -> (a, a) -> (b, b)+both = join (***)++-- | As an example:+--+-- > λ:> ((*2) .* (+)) 1 3 4+-- > 4+(.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d+(.*) 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)++-- | The Oedipus combinator+(-.*) :: (b -> c) -> (a -> c -> d) -> a -> b -> d+(-.*) f g x y = g x (f y)++-- | Backwards function composition+(-.) :: (a -> b) -> (b -> c) -> a -> c+(-.) f g x = g (f x)
+ stack.yaml view
@@ -0,0 +1,8 @@+resolver: lts-9.0+packages:+- '.'+extra-deps: []+flags:+    composition-prelude:+        development: true+extra-package-dbs: []