Add '<&>' operator to Data.Functor. '<&>' calls '<$>' with flipped arguments.
authorSven Tennie <sven.tennie@gmail.com>
Fri, 28 Jul 2017 22:25:50 +0000 (18:25 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sat, 29 Jul 2017 14:33:42 +0000 (10:33 -0400)
commit9cfabbb5267e72b8017d8dc04d8580f73f425aa8
tree26e04fcfd989ebae6aa570f7d957a68b0b30828e
parent84f8e86248d47f619a94c68260876a1258e0a931
Add '<&>' operator to Data.Functor. '<&>' calls '<$>' with flipped arguments.

This was proposed by David Feuer
(https://mail.haskell.org/pipermail/libraries/2016-August/027293.html)
and solves #14029.

The implementation is a copy of the '<&>' operator in Control.Lens.Lens.

Add tests for following Data.Functor operators: '<$>', '<&>', '<$' and '$>'.

'<&>' was added for solving #14029. '<$>', '<$' and '$>' were probably
untested.

Reviewers: austin, hvr, bgamari, RyanGlScott

Reviewed By: RyanGlScott

Subscribers: RyanGlScott, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3800
libraries/base/Data/Functor.hs
libraries/base/changelog.md
libraries/base/tests/all.T
libraries/base/tests/functorOperators.hs [new file with mode: 0644]
libraries/base/tests/functorOperators.stdout [new file with mode: 0644]