between-0.11.0.0: 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)
pattern f . h . g where f and g are fixed.
This library not only defines ~@~ combinator, but also some derived
combinators that can help us easily define a lot of things including
lenses. See lens package for
detais on what lenses are.
Function Data.Function.on can be implemented using ~@~ as:
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c on f g = (id ~@~ g ~@~ g) f
If function 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 module.
Signatures
Modules
- Data
- Function
- Data.Function.Between Function combinator "between" and its variations.
- Data.Function.Between.Lazy Lazy function combinator "between" and its variations.
- Data.Function.Between.Strict Strict function combinator "between" and its variations.
- Data.Function.Between.Strict.Internal Definitions used by family of strict function combinators.
- Data.Function.Between.Types Precursors to Iso, Lens and Prism types.
- Data.Function.Between Function combinator "between" and its variations.
- Function