& package:diagrams-lib

& 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"
Modify the target(s) of a Lens', Iso, Setter or Traversal by taking their logical && with a value.
>>> execState (do _1 &&= True; _2 &&= False; _3 &&= True; _4 &&= False) (True,True,False,False)
(True,False,False,False)
(&&=) :: MonadState s m => Setter' s Bool    -> Bool -> m ()
(&&=) :: MonadState s m => Iso' s Bool       -> Bool -> m ()
(&&=) :: MonadState s m => Lens' s Bool      -> Bool -> m ()
(&&=) :: MonadState s m => Traversal' s Bool -> Bool -> m ()
Logically && the target(s) of a Bool-valued Lens or Setter.
>>> both &&~ True $ (False, True)
(False,True)
>>> both &&~ False $ (False, True)
(False,False)
(&&~) :: Setter' s Bool    -> Bool -> s -> s
(&&~) :: Iso' s Bool       -> Bool -> s -> s
(&&~) :: Lens' s Bool      -> Bool -> s -> s
(&&~) :: Traversal' s Bool -> Bool -> s -> s
This can be used to chain lens operations using op= syntax rather than op~ syntax for simple non-type-changing cases.
>>> (10,20) & _1 .~ 30 & _2 .~ 40
(30,40)
>>> (10,20) &~ do _1 .= 30; _2 .= 40
(30,40)
This does not support type-changing assignment, e.g.
>>> (10,20) & _1 .~ "hello"
("hello",20)
A pair of values, with a convenient infix (left-associative) data constructor.
Construct a value of type c by providing something of one less dimension (which is perhaps itself recursively constructed using (^&)) and a final coordinate. For example,
2 ^& 3 :: P2
3 ^& 5 ^& 6 :: V3
Note that ^& is left-associative.
Logically && a Boolean valued Lens into your Monad's state and return the result. When you do not need the result of the operation, (&&=) is more flexible.
(<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<&&=) :: MonadState s m => Iso' s Bool  -> Bool -> m Bool
Logically && a Boolean valued Lens and return the result. When you do not need the result of the operation, (&&~) is more flexible.
(<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<&&~) :: Iso' s Bool  -> Bool -> s -> (Bool, s)
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
Modify the target of a Lens into your Monad's state by taking its logical && with a value and return the old value that was replaced. When you do not need the result of the operation, (&&=) is more flexible.
(<<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool
(<<&&=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool
Logically && the target of a Bool-valued Lens and return the old value. When you do not need the old value, (&&~) is more flexible.
>>> (False,6) & _1 <<&&~ True
(False,(False,6))
>>> ("hello",True) & _2 <<&&~ False
(True,("hello",False))
(<<&&~) :: Lens' s Bool -> Bool -> s -> (Bool, s)
(<<&&~) :: Iso' s Bool -> Bool -> s -> (Bool, s)