Let's say I have the following type:
data WaveFormatChunk = WaveFormatChunk {
compression :: Word16,
channels :: Word16,
sampleRate :: Word32,
averageBps :: Word32,
blockAlign :: Word16,
significantBits :: Word16
} deriving (Show)
Is there a way to just dump all of this in a ByteString (or similar structure) in bulk (in the manner of old C structures)? If not, and I need to write a function that separately puts all of them in a list, are there at least functions that make it easy to insert a value into a Word8 list, for example, Word8? Something like putWordBBxe, with the exception of strings or a list of bytes (although I, most likely, am very mistaken, since I have not read it correctly in Monads, it seems to me that Get / Put is mainly used with streams).
Data.Binary is not quite what I'm looking for, it seems more useful for just dumping data on disk than saving it in a specific format with specific (and "wrong") content.