Commit 1bf6c0e4 authored by bernalex's avatar bernalex Committed by Herbert Valerio Riedel

Add reverse application operator Data.Function.(&)

Add `&` as the reverse application operator with `infixl 1`, which allows
it to be nested in `$` (re #9008).

Approved by the core libraries committee on 2013-10-14.

This also bumps the `base` version number to 4.7.1.0
parent 1d2ffb6a
......@@ -4,6 +4,7 @@
-- |
-- Module : Data.Function
-- Copyright : Nils Anders Danielsson 2006
-- , Alexander Berntsen 2014
-- License : BSD-style (see the LICENSE file in the distribution)
--
-- Maintainer : libraries@haskell.org
......@@ -18,6 +19,7 @@ module Data.Function
( -- * "Prelude" re-exports
id, const, (.), flip, ($)
-- * Other combinators
, (&)
, fix
, on
) where
......@@ -25,6 +27,7 @@ module Data.Function
import Prelude
infixl 0 `on`
infixl 1 &
-- | @'fix' f@ is the least fixed point of the function @f@,
-- i.e. the least defined @x@ such that @f x = x@.
......@@ -86,3 +89,11 @@ fix f = let x = f x in x
on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
(.*.) `on` f = \x y -> f x .*. f y
-- | '&' is a reverse application operator. This provides notational
-- convenience. Its precedence is one higher than that of the forward
-- application operator '$', which allows '&' to be nested in '$'.
--
-- /Since: 4.7.1.0/
(&) :: a -> (a -> b) -> b
x & f = f x
name: base
version: 4.7.0.0
version: 4.7.1.0
-- GHC 7.6.1 released with 4.6.0.0
license: BSD3
license-file: LICENSE
......
# Changelog for [`base` package](http://hackage.haskell.org/package/base)
## 4.7.0.0 *Feb 2014*
## 4.7.1.0 *TBA*
* Bundled with GHC 7.10.1
* Add reverse application operator `Data.Function.(&)`
## 4.7.0.0 *Apr 2014*
* Bundled with GHC 7.8.1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment