>>> 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 ()
>>> 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
>>> (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)
2 ^& 3 :: P2 3 ^& 5 ^& 6 :: V3Note that ^& is left-associative.
(<<&&=) :: MonadState s m => Lens' s Bool -> Bool -> m Bool (<<&&=) :: MonadState s m => Iso' s Bool -> Bool -> m Bool
>>> (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)