between: Function combinator "between" and derived combinators
It turns out that this combinator
f ~@~ g = (f .) . (. g)
is a powerful thing. It was abstracted from following (commonly used)
f . h . g where
g are fixed.
This library not only define
~@~ combinator, but also some derived
combinators that can help us to easily define a lot of things including
lenses. See lens package for
detais on what lenses are.
Data.Function.on can be implemented using
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c on f g = (id ~@~ g ~@~ g) f
on3 existed in base then it could be defined as:
on3 :: (b -> b -> b -> d) -> (a -> b) -> a -> a -> a -> d on3 f g = (id ~@~ g ~@~ g ~@~ g) f
Other usage examples and documentation can be found in Data.Function.Between.
[Skip to Readme]
|Versions [faq]||0.9.0.0, 0.9.0.1, 0.9.0.2, 0.10.0.0, 0.11.0.0|
|Dependencies||base (>3 && <5) [details]|
|Copyright||(c) 2013, 2014 Peter Trško|
|Source repo||head: git clone git://github.com/trskop/between.git
this: git clone git://github.com/trskop/between.git(tag v0.9.0.2)
|Uploaded||by PeterTrsko at Sat Aug 30 09:38:05 UTC 2014|
|Distributions||LTSHaskell:0.11.0.0, NixOS:0.11.0.0, Stackage:0.11.0.0|
|Downloads||2118 total (59 in the last 30 days)|
|Rating||(no votes yet) [estimated by rule of succession]|
Docs available [build log]
Successful builds reported [all 1 reports]
Pass additional warning flags including -Werror to GHC during compilation.
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
For package maintainers and hackage trustees