Function combinator "between" and derived combinators
|LTS Haskell 20.23:||0.11.0.0|
|Stackage Nightly 2023-05-29:||0.11.0.0|
|Latest on Hackage:||0.11.0.0|
Module documentation for 0.11.0.0
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
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
For more examples see documentation.
Stable releases with API documentation are available on Hackage.
-fpedantic(disabled by default)
Pass additional warning flags to GHC.
The BSD 3-Clause License, see LICENSE file for details.
Contributions, pull requests and bug reports are welcome! Please don’t be
afraid to contact author using GitHub or by e-mail (see
.cabal file for
ChangeLog / ReleaseNotes
- New function application combinators (new):
inbetween :: a -> b -> (a -> b -> r) -> r
(~$~) :: a -> b -> (a -> b -> r) -> r
(~$$~) :: b -> a -> (a -> b -> r) -> r
withIn :: ((a -> b -> r) -> r) -> (a -> b -> r) -> r
withReIn :: ((b -> a -> r) -> r) -> (a -> b -> r) -> r
- Precursors to
type PreIso r s t a b = ((b -> t) -> (s -> a) -> r) -> r
type PreIso' r s a = PreIso r s s a a
type PreLens r s t a b = ((b -> s -> t) -> (s -> a) -> r) -> r
type PreLens' r s a = PreLens r s s a a
type PrePrism r s t a b = ((b -> t) -> (s -> Either t a) -> r) -> r
type PrePrism' r s a = PrePrism r s s a a
- Uploaded to Hackage: http://hackage.haskell.org/package/between-0.11.0.0
- Original implementation moved to module
Data.Function.Between.Lazyand is now reexported by
- Implementation of strict variants of all functions defined in
Data.Function.Between.Lazymodule. These new functions use
(f . g) x = f '$!' g '$!' xas definition for function composition where
$!is strict application. (new)
- Uploaded to Hackage: http://hackage.haskell.org/package/between-0.10.0.0
- Minor documentation changes.
- Resolving some Haddock issues in documentation.
- Uploaded to Hackage: http://hackage.haskell.org/package/between-0.9.0.2
- Removing all INLINE and RULES. Tested it using ghc-core with GHC 7.8.3 (bundled with Haskell Platform 2014.2.0.0) and it works well.
- Uploaded to Hackage: http://hackage.haskell.org/package/between-0.9.0.1
- First public release.
- Uploaded to Hackage: http://hackage.haskell.org/package/between-0.9.0.0