Data.ByteString.packCStringLen for Ptr Word8

Henning Thielemann lemming at
Wed Jul 25 13:12:45 CEST 2012

I want to copy a piece of memory addressed by a Ptr Word8 into a 
ByteString. I only found packCStringLen for that purpose but it expects a 
Ptr CChar as input. Since ByteString represents a sequence of Word8 I 
thought that the most natural input for packCStringLen should be (Ptr 
Word8). Of course I can use castPtr but that always looks like a hack.

More information about the Libraries mailing list