[Yhc] ByteString

Creighton Hogg wchogg at gmail.com
Tue Jun 19 12:36:35 EDT 2007


On 6/19/07, Thomas Shackell <shackell at cs.york.ac.uk> wrote:
>
> 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


I tried this latter one & I tried ByteString.Char8 and both of them failed
the same ways that the basic String did.  Apparently PackedString is a
strange duck.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/yhc/attachments/20070619/40eab767/attachment.htm


More information about the Yhc mailing list