packages feed

flow 1.0.0 → 1.0.1

raw patch · 8 files changed

+134/−106 lines, 8 filesdep ~doctestPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: doctest

API changes (from Hackage documentation)

Files

− Bench.hs
@@ -1,35 +0,0 @@-module Main (main) where--import Criterion.Main-import Flow--main :: IO ()-main = defaultMain-    [ bgroup "application"-        [ bench "f x" $ whnf f x-        , bench "apply x f" $ whnf (apply x) f-        , bench "x |> f" $ whnf (x |>) f-        , bench "f <| x" $ whnf (<| x) f-        ]-    , bgroup "composition"-        [ bench "f . g" $ whnf (f .) g-        , bench "compose f g" $ whnf (compose f) g-        , bench "f .> g" $ whnf (f .>) g-        , bench "g <. f" $ whnf (<. f) g-        ]-    , bgroup "strict application"-        [ bench "seq x (f x)" $ whnf (seq x) (f x)-        , bench "apply' x f" $ whnf (apply' x) f-        , bench "x !> f" $ whnf (x !>) f-        , bench "f <! x" $ whnf (<! x) f-        ]-    ]--x :: Int-x = 1--f :: Int -> Int-f = (+ 2)--g :: Int -> Int-g = (* 3)
CHANGELOG.md view
@@ -1,5 +1,12 @@ # Change log +Flow uses [Semantic Versioning][].++## v1.0.1 (2015-06-04)++-   Updated documentation.+-   Supported doctest 0.10.+ ## v1.0.0 (2015-04-01)  -   Initially released.@@ -7,3 +14,5 @@ ## v0.0.0 (2015-04-01)  -   Initially created.++[semantic versioning]: http://semver.org/spec/v2.0.0.html
Flow.hs view
@@ -1,11 +1,16 @@ {- |-    Flow provides functions and operators for writing more understandable-    Haskell.+    Flow is a package that provides functions and operators for writing more+    understandable Haskell. It's an alternative to some common idioms like+    @($)@ for function application and @(.)@ for function composition. -    Flow does not export anything that conflicts with the "Prelude". The-    recommended way to use Flow is to import it unqualified.+    Flow is designed to be imported unqualified. It does not export anything+    that conflicts with+    <http://hackage.haskell.org/package/base the base package>.      >>> import Flow++    For more information about Flow, please visit+    <http://taylor.fausak.me/flow/ the official site>. -} module Flow (     -- * Function application@@ -13,7 +18,7 @@     -- * Function composition     compose, (.>), (<.),     -- * Strict function application-    apply', (!>), (<!)+    apply', (!>), (<!), ) where  import Prelude (seq)@@ -21,7 +26,8 @@ {- $setup     >>> import Prelude     >>> let f = (+ 2)-    >>> let g = (* 3)+    >>> let g = (* 2)+    >>> let h = (^ 2) -}  {- |@@ -51,6 +57,7 @@  {- |     prop> (x |> f) == f x+    prop> (x |> f |> g) == g (f x)      Left-associative 'apply' operator. This is like a flipped version of the     'Prelude.$' operator. Read it as "apply forward" or "pipe into".@@ -76,6 +83,7 @@  {- |     prop> (f <| x) == f x+    prop> (g <| f <| x) == g (f x)      Right-associative 'apply' operator. This is like the 'Prelude.$' operator.     Read it as "apply backward" or "pipe from".@@ -119,6 +127,7 @@  {- |     prop> (f .> g) x == g (f x)+    prop> (f .> g .> h) x == h (g (f x))      Left-associative 'compose' operator. This is like a flipped version of the     'Prelude..' operator. Read it as "compose forward" or "and then".@@ -137,6 +146,7 @@  {- |     prop> (g <. f) x == g (f x)+    prop> (h <. g <. f) x == h (g (f x))      Right-associative 'compose' operator. This is like the 'Prelude..'     operator. Read it as "compose backward" or "but first".@@ -166,6 +176,7 @@  {- |     prop> (x !> f) == seq x (f x)+    prop> (x !> f !> g) == seq x (g (seq x (f x)))      Left-associative 'apply'' operator. This is like a flipped version of the     'Prelude.$!' operator.@@ -179,6 +190,7 @@  {- |     prop> (f <! x) == seq x (f x)+    prop> (g <! f <! x) == seq x (g (seq x (f x)))      Right-associative 'apply'' operator. This is like the 'Prelude.$!'     operator.
+ FlowBench.hs view
@@ -0,0 +1,35 @@+module Main (main) where++import Criterion.Main+import Flow++main :: IO ()+main = defaultMain+    [ bgroup "application"+        [ bench "f x" $ whnf f x+        , bench "apply x f" $ whnf (apply x) f+        , bench "x |> f" $ whnf (x |>) f+        , bench "f <| x" $ whnf (<| x) f+        ]+    , bgroup "composition"+        [ bench "f . g" $ whnf (f .) g+        , bench "compose f g" $ whnf (compose f) g+        , bench "f .> g" $ whnf (f .>) g+        , bench "g <. f" $ whnf (<. f) g+        ]+    , bgroup "strict application"+        [ bench "seq x (f x)" $ whnf (seq x) (f x)+        , bench "apply' x f" $ whnf (apply' x) f+        , bench "x !> f" $ whnf (x !>) f+        , bench "f <! x" $ whnf (<! x) f+        ]+    ]++x :: Int+x = 2++f :: Int -> Int+f = (+ 2)++g :: Int -> Int+g = (* 2)
+ FlowTest.hs view
@@ -0,0 +1,6 @@+module Main (main) where++import Test.DocTest (doctest)++main :: IO ()+main = doctest ["Flow.hs"]
README.md view
@@ -1,77 +1,76 @@-<h1 align="center">-    <a href="https://github.com/tfausak/flow">-        Flow-    </a>-</h1>+# [Flow][] -<p align="center">-    Functions and operators for more understandable Haskell-</p>+Write more understandable Haskell. -<p align="center">-    <a href="https://hackage.haskell.org/package/flow"><img alt="" src="https://img.shields.io/hackage/v/flow.svg"></a>-    <a href="https://travis-ci.org/tfausak/flow"><img alt="" src="https://img.shields.io/travis/tfausak/flow/master.svg"></a>-    <a href="http://packdeps.haskellers.com/feed?needle=flow"><img alt="" src="https://img.shields.io/hackage-deps/v/flow.svg"></a>-</p>+[![Version][]](https://hackage.haskell.org/package/flow)+[![Build][]](https://travis-ci.org/tfausak/flow)+[![Dependencies][]](http://packdeps.haskellers.com/feed?needle=flow) -<hr>+--- -Flow provides functions and operators for writing more understandable Haskell.+Flow is a package that provides functions and operators for writing more+understandable Haskell. It's an alternative to some common idioms like+[`($)`][] for function application and [`(.)`][] for function composition. --   [Install](#install)--   [Use](#use)--   [Develop](#develop)+-   [Requirements](#requirements)+-   [Installation](#installation)+-   [Usage](#usage) -## Install+## Requirements -To use Flow in a Cabal package, add it to your Cabal file.+Flow requires a Haskell compiler. It is tested with recent versions of GHC, but+older or different compilers should be acceptable. For installation with Cabal,+Flow requires at least Cabal 1.8. +## Installation++To add Flow as a dependency to your package, add it to your Cabal file.+ ```-build-depends:-    flow ==1.*+build-depends: flow ==1.0.* ```  For other use cases, install it with Cabal.  ``` sh-$ cabal update-$ cabal install 'flow ==1.*'+$ cabal install 'flow ==1.0.*' ``` -Flow uses [Semantic Versioning][]. Check out [the change log][] for a-detailed list of changes.+Flow uses [Semantic Versioning][]. See [the change log][] for a detailed list+of changes. -## Use+## Usage -Flow is designed to be imported unqualified. It does not export anything-that conflicts with the Prelude. To get started, simply import it.+Flow is designed to be imported unqualified. It does not export anything that+conflicts with [the base package][].  ``` hs import Flow ``` -Check out [the Haddock documentation][] for more information about the-functions Flow provides.--## Develop--If you want to help develop Flow, you'll need Git, GHC, and Cabal. To get-started, clone the repository and install the dependencies.--``` sh-$ git clone https://github.com/tfausak/flow-$ cd flow+Here is a quick overview of the functions and operators that Flow provides. -$ cabal sandbox init-$ cabal install --enable-benchmarks --enable-tests --only-dependencies-```+Flow            | Base+--------------- | -------------+`apply x f`     | `f x`+`x |> f`        | `x & f`+`f <| x`        | `f $ x`+`compose f g x` | `g (f x)`+`f .> g`        | `f >>> g`+`g <. f`        | `g . f`+`apply' x f`    | `seq x (f x)`+`x !> f`        | -+`f <! x`        | `f $! x` -Once you've done that, you should be able to use the normal Cabal tools-(`repl`, `test`, `haddock`, and `bench` in particular). If you've made changes-that you want merged into this repository, create a fork and open a pull-request. GitHub's [Fork A Repo][] article can help with that.+For more information about Flow, please read [the Haddock documentation][]. +[flow]: http://taylor.fausak.me/flow/+[version]: https://img.shields.io/hackage/v/flow.svg?label=version&style=flat-square+[build]: https://img.shields.io/travis/tfausak/flow/master.svg?label=build&style=flat-square+[dependencies]: https://img.shields.io/hackage-deps/v/flow.svg?label=dependencies&style=flat-square+[`($)`]: http://hackage.haskell.org/package/base-4.8.0.0/docs/Prelude.html#v:-36-+[`(.)`]: http://hackage.haskell.org/package/base-4.8.0.0/docs/Prelude.html#v:. [semantic versioning]: http://semver.org/spec/v2.0.0.html [the change log]: CHANGELOG.md-[the haddock documentation]: https://hackage.haskell.org/package/flow-[fork a repo]: https://help.github.com/articles/fork-a-repo/+[the base package]: http://hackage.haskell.org/package/base+[the haddock documentation]: https://hackage.haskell.org/package/flow/docs/Flow.html
− Test.hs
@@ -1,6 +0,0 @@-module Main (main) where--import Test.DocTest (doctest)--main :: IO ()-main = doctest ["Flow.hs"]
flow.cabal view
@@ -1,15 +1,23 @@ name: flow-version: 1.0.0+version: 1.0.1 cabal-version: >=1.8 build-type: Simple license: MIT license-file: LICENSE.md+copyright: 2015 Taylor Fausak <taylor@fausak.me> maintainer: Taylor Fausak <taylor@fausak.me>-synopsis: Functions and operators for more understandable Haskell+homepage: http://taylor.fausak.me/flow/+bug-reports: https://github.com/tfausak/flow/issues+synopsis: Write more understandable Haskell. description:-    Flow provides functions and operators for writing more understandable-    Haskell.-category: Utility+    Flow is a package that provides functions and operators for writing more+    understandable Haskell. It's an alternative to some common idioms like+    @($)@ for function application and @(.)@ for function composition.+    .+    For more information, please visit+    <http://taylor.fausak.me/flow/ the official site>.+category: Combinators, Functions, Utility+author: Taylor Fausak <taylor@fausak.me> extra-source-files:     CHANGELOG.md     README.md@@ -27,20 +35,20 @@  test-suite test     type: exitcode-stdio-1.0-    main-is: Test.hs+    main-is: FlowTest.hs     build-depends:         base -any,         flow -any,-        doctest ==0.9.*,+        doctest >= 0.9 && <0.11,         QuickCheck ==2.*,         template-haskell ==2.*-    ghc-options: -Wall -Werror+    ghc-options: -Wall  benchmark bench     type: exitcode-stdio-1.0-    main-is: Bench.hs+    main-is: FlowBench.hs     build-depends:         base -any,         flow -any,         criterion ==1.*-    ghc-options: -Wall -Werror+    ghc-options: -Wall