I am trying to write a little tool to hide text in PGM image files by overwriting the LSB in each byte in the input. I need help writing a function such as
writeBit :: Bool -> Word8 -> Word8 writeBit b w = ...
where the ouput is equal to
w with its LSB set to
b. Can anyone help me get started with this?