The same as C way. You can import Data.Bits and can use the functions.
Prelude> import Data.Bits
Prelude Data.Bits> Data.Bits.
Data.Bits..&. Data.Bits.bitDefault Data.Bits.complementBit Data.Bits.rotate Data.Bits.shift Data.Bits.testBitDefault
Data.Bits..|. Data.Bits.bitSize Data.Bits.isSigned Data.Bits.rotateL Data.Bits.shiftL Data.Bits.unsafeShiftL
Data.Bits.Bits Data.Bits.clearBit Data.Bits.popCount Data.Bits.rotateR Data.Bits.shiftR Data.Bits.unsafeShiftR
Data.Bits.bit Data.Bits.complement Data.Bits.popCountDefault Data.Bits.setBit Data.Bits.testBit Data.Bits.xor
Prelude Data.Bits> (.&.) 1 2
0
Prelude Data.Bits> (.&.) 2 2
2
I wrote a minimum spanning tree code and rather than maintaining the list of visited nodes, I took a Integer because of arbitrary precision and set the bits accordingly.
visited :: Int -> Integer -> ( Bool , Integer )
visited x vis = ( t == 0 , vis' ) where
t = ( B..&. ) ( B.shiftL ( 1 :: Integer ) x ) vis
vis' = ( B..|. ) ( B.shiftL ( 1 :: Integer ) x ) vis
Mukesh