[Yhc] ByteString

Neil Mitchell ndmitchell at gmail.com
Tue Jun 19 09:54:06 EDT 2007


Hi

> > > Yeah in line with Neal's suggestion, I had added a FakeString module
> > > that was imported by SysDeps as PackedString and just provided
> > > unpackPS = id
> > > and
> > > packString = id
> > > I had done something silly where that first one didn't build properly,
> > > but now that that's fixed I'm getting errors I don't really understand
> > > on 5 of the tests.  I'll probably look at them tonight & ask questions
> > > about how chunks of the code work.
> >
> > hmm I would have thought that String and PackedString should behave
> > identical, apart from the 'packedness'. Still there could be some subtle
> > semantic difference ...
>
> Yeah, a several of the five failures were caused by running out of memory.
> Now, I thought String vs. PackedString shouldn't be that much of a
> difference anymore?  Are there strictness differences between the two that
> could be causing the String version to build up huge thunks?  Maybe I'll be
> a wench and change it to ByteString.Char8 and see what happens.

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.

Thanks

Neil


More information about the Yhc mailing list