Portability | LiberalTypeSynonyms |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Infered |
- (|~) :: Bits c => Setting a b c c -> c -> a -> b
- (&~) :: Bits c => Setting a b c c -> c -> a -> b
- (|=) :: (MonadState a m, Bits b) => Simple Setting a b -> b -> m ()
- (&=) :: (MonadState a m, Bits b) => Simple Setting a b -> b -> m ()
- bitAt :: Bits b => Int -> SimpleIndexedLens Int b Bool
- traverseBits :: Bits b => SimpleIndexedTraversal Int b Bool
Documentation
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.