>>> (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)
>>> 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
(<<&&=) :: 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)
>>> execState (do _1 .&.= 15; _2 .&.= 3) (7,7) (7,3)
(.&.=) :: (MonadState s m, Bits a) => Setter' s a -> a -> m () (.&.=) :: (MonadState s m, Bits a) => Iso' s a -> a -> m () (.&.=) :: (MonadState s m, Bits a) => Lens' s a -> a -> m () (.&.=) :: (MonadState s m, Bits a) => Traversal' s a -> a -> m ()
>>> runState (_1 <.&.= 15) (31,0) (15,(15,0))
(<.&.=) :: (MonadState s m, Bits a) => Lens' s a -> a -> m a (<.&.=) :: (MonadState s m, Bits a, Monoid a) => Traversal' s a -> a -> m a
>>> _2 <.&.~ 7 $ ("hello",254) (6,("hello",6))
(<.&.~) :: Bits a => Iso s t a a -> a -> s -> (a, t) (<.&.~) :: Bits a => Lens s t a a -> a -> s -> (a, t) (<.&.~) :: (Bits a, Monoid a) => Traversal s t a a -> a -> s -> (a, t)
>>> runState (_1 <<.&.= 15) (31,0) (31,(15,0))
(<<.&.=) :: (MonadState s m, Bits a) => Lens' s a -> a -> m a (<<.&.=) :: (MonadState s m, Bits a, Monoid a) => Traversal' s a -> a -> m a
>>> _2 <<.&.~ 7 $ ("hello", 254) (254,("hello",6))
(<<.&.~) :: Bits a => Iso s t a a -> a -> s -> (a, t) (<<.&.~) :: Bits a => Lens s t a a -> a -> s -> (a, t) (<<.&.~) :: (Bits a, Monoid a) => Traversal s t a a -> a -> s -> (a, t)