[Yhc] ByteString

Thomas Shackell shackell at cs.york.ac.uk
Tue Jun 19 11:14:23 EDT 2007


Neil Mitchell wrote:
> Perhaps:
> 
> packString x = sum (map ord x) `seq` x
> 
> Will give you what you need. That function should have the same
> strictness as the original packString.

Or alternatively the slightly less evil

   packString x = foldr (\ y ys -> y `seq` y : ys) [] x

Tom




More information about the Yhc mailing list