Portability | LiberalTypeSynonyms |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Infered |
- (|~) :: Bits c => Setter a b c c -> c -> a -> b
- (&~) :: Bits c => Setter a b c c -> c -> a -> b
- (|=) :: (MonadState a m, Bits b) => Simple Setter a b -> b -> m ()
- (&=) :: (MonadState a m, Bits b) => Simple Setter a b -> b -> m ()
- bitAt :: Bits b => Int -> Simple Lens b Bool
- traverseBits :: Bits b => Simple Traversal b Bool
Documentation
bitAt :: Bits b => Int -> Simple Lens b BoolSource
This lens can be used to access the value of the nth bit in a number.
bitsAt n
is only a legal Lens
into b
if 0 <= n < bitSize (undefined :: b)
traverseBits :: Bits b => Simple Traversal b BoolSource
Traverse over all bits in a numeric type.
ghci> toListOf traverseBits (5 :: Word8) [True,False,True,False,False,False,False,False]
If you supply this an Integer, it won't crash, but the result will be an infinite traversal that can be productively consumed.
ghci> toListOf traverseBits 5 [True,False,True,False,False,False,False,False,False,False,False,False...