Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-06 Thread Gwern Branwen
On Thu, Mar 5, 2009 at 6:51 AM, Neil Mitchell ndmitch...@gmail.com wrote: 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

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-06 Thread Gwern Branwen
On Thu, Mar 5, 2009 at 2:55 PM, Neil Mitchell ndmitch...@gmail.com wrote: Avoid massive reductions in runtime while maintaining the same API? I did move to using ByteString's internally for those bits later on, but reading String's from Data.Binary with a ByteString+unpack went much more

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-05 Thread 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

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-05 Thread Don Stewart
Avoid unpack! ndmitchell: 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

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-05 Thread Neil Mitchell
Avoid massive reductions in runtime while maintaining the same API? I did move to using ByteString's internally for those bits later on, but reading String's from Data.Binary with a ByteString+unpack went much more quickly than reading String's On Thu, Mar 5, 2009 at 7:35 PM, Don Stewart

Re: [Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-04 Thread Gwern Branwen
On Tue, Mar 3, 2009 at 11:50 PM, Spencer Janssen spencerjans...@gmail.com wrote: On Tue, Mar 3, 2009 at 10:30 PM, Gwern Branwen gwe...@gmail.com wrote: So recently I've been having issues with Data.Binary Data.Sequence; I serialize a 'Seq String' You can see the file here:

[Haskell-cafe] Data.Binary stack overflow with Data.Sequence String

2009-03-03 Thread Gwern Branwen
So recently I've been having issues with Data.Binary Data.Sequence; I serialize a 'Seq String' You can see the file here: http://code.haskell.org/yi/Yi/IReader.hs The relevant function seems to be: -- | Read in database from 'dbLocation' and then parse it into an 'ArticleDB'. readDB :: YiM