| Portability | LiberalTypeSynonyms | 
|---|---|
| Stability | experimental | 
| Maintainer | Edward Kmett <ekmett@gmail.com> | 
| Safe Haskell | Safe-Infered | 
Data.Bits.Lens
Description
- (|~) :: Bits c => Setting a b c c -> c -> a -> b
- (&~) :: Bits c => Setting a b c c -> c -> a -> b
- (<|~) :: Bits c => LensLike ((,) c) a b c c -> c -> a -> (c, b)
- (<&~) :: Bits c => LensLike ((,) c) a b c c -> c -> a -> (c, b)
- (|=) :: (MonadState a m, Bits b) => Simple Setting a b -> b -> m ()
- (&=) :: (MonadState a m, Bits b) => Simple Setting a b -> b -> m ()
- (<|=) :: (MonadState a m, Bits b) => SimpleLensLike ((,) b) a b -> b -> m b
- (<&=) :: (MonadState a m, Bits b) => SimpleLensLike ((,) b) a b -> b -> m b
- bitAt :: Bits b => Int -> SimpleIndexedLens Int b Bool
- traverseBits :: Bits b => SimpleIndexedTraversal Int b Bool
Documentation
(<|~) :: Bits c => LensLike ((,) c) a b c c -> c -> a -> (c, b)Source
Bitwise .|. the target(s) of a Lens (or Traversal), returning the result
 (or a monoidal summary of all of the results).
>>>_2 <|~ 6 $ ("hello",3)(7,("hello",7))
(<|~) ::Bitsc =>Isoa b c c -> c -> a -> (c, b) (<|~) ::Bitsc =>Lensa b c c -> c -> a -> (c, b) (<|~) :: (Bitsc, 'Monoid c) =>Traversala b c c -> c -> a -> (c, b)
(<&~) :: Bits c => LensLike ((,) c) a b c c -> c -> a -> (c, b)Source
Bitwise .&. the target(s) of a Lens or Traversal, returning the result
 (or a monoidal summary of all of the results).
>>>_2 <&~ 7 $ ("hello",254)(6,("hello",6))
(<&~) ::Bitsc =>Isoa b c c -> c -> a -> (c, b) (<&~) ::Bitsc =>Lensa b c c -> c -> a -> (c, b) (<&~) :: (Bitsc, 'Monoid c) =>Traversala b c c -> c -> a -> (c, b)
(|=) :: (MonadState a m, Bits b) => Simple Setting a b -> b -> m ()Source
Modify the target(s) of a Simple Lens, Setter or Traversal by computing its bitwise .|. with another value.
(|=):: (MonadStatea m,Bitsb) =>SimpleSettera b -> b -> m () (|=):: (MonadStatea m,Bitsb) =>SimpleIsoa b -> b -> m () (|=):: (MonadStatea m,Bitsb) =>SimpleLensa b -> b -> m () (|=):: (MonadStatea m,Bitsb) =>SimpleTraversala b -> b -> m ()
(&=) :: (MonadState a m, Bits b) => Simple Setting a b -> b -> m ()Source
Modify the target(s) of a Simple Lens, Setter or Traversal by computing its bitwise .&. with another value.
(&=):: (MonadStatea m,Bitsb) =>SimpleSettera b -> b -> m () (&=):: (MonadStatea m,Bitsb) =>SimpleIsoa b -> b -> m () (&=):: (MonadStatea m,Bitsb) =>SimpleLensa b -> b -> m () (&=):: (MonadStatea m,Bitsb) =>SimpleTraversala b -> b -> m ()
(<|=) :: (MonadState a m, Bits b) => SimpleLensLike ((,) b) a b -> b -> m bSource
Modify the target(s) of a Simple Lens, (or Traversal) by computing its bitwise .|. with another value,
 returning the result (or a monoidal summary of all of the results traversed)
(<|=) :: (MonadStatea m,Bitsb) =>SimpleLensa b -> b -> m b (<|=) :: (MonadStatea m,Bitsb,Monoidb) =>SimpleTraversala b -> b -> m b
(<&=) :: (MonadState a m, Bits b) => SimpleLensLike ((,) b) a b -> b -> m bSource
Modify the target(s) of a Simple Lens (or Traversal) by computing its bitwise .&. with another value,
 returning the result (or a monoidal summary of all of the results traversed)
(<&=) :: (MonadStatea m,Bitsb) =>SimpleLensa b -> b -> m b (<&=) :: (MonadStatea m,Bitsb,Monoidb) =>SimpleTraversala b -> b -> m b
traverseBits :: Bits b => SimpleIndexedTraversal Int b BoolSource
Traverse over all bits in a numeric type.
The bit position is available as the index.
>>>import Data.Word>>>toListOf traverseBits (5 :: Word8)[True,False,True,False,False,False,False,False]
If you supply this an Integer, the result will
 be an infinite Traversal that can be productively consumed.