& package:base-prelude
& 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
$.
>>> 5 & (+1) & show
"6"
Boolean "and", lazy in the second argument
Fanout: send the input to both argument arrows and combine their
output.
The default definition may be overridden with a more efficient version
if desired.
Flipped version of
<$>.
(<&>) = flip fmap
Examples
Apply
(+1) to a list, a
Just and a
Right:
>>> Just 2 <&> (+1)
Just 3
>>> [1,2,3] <&> (+1)
[2,3,4]
>>> Right 3 <&> (+1)
Right 4