
6 Mar
2009
6 Mar
'09
8:19 p.m.
On Thu, Mar 5, 2009 at 6:51 AM, Neil Mitchell
Hi Gwern,
I get String/Data.Binary issues too. My suggestion would be to change your strings to ByteString's, serisalise, and then do the reverse conversion when reading. Interestingly, a String and a ByteString have identical Data.Binary reps, but in my experiments converting, including the cost of BS.unpack, makes the reading substantially cheaper.
Thanks
Neil
Ah, thanks for the advice. Switching to (strict) ByteString seems to resolve the stack overflow. (And thank goodness too, I need my ireader!) I hadn't realized it was the String that was messing things up and being lazy. Very annoying! (The String code was cleaner - fewer packs/unpacks.) -- gwern