
2010/12/27 いとうかつとし
I tryed ByteString import from Data.ByteString. Rather, This field's type is Data.ByteString.Internal.ByteString, on the other hand, fileContent of posted file's content is Data.ByteString.Lazy.Internal.ByteString. then, i translateed by B.concat . L.toChunks imported from Data.ByteString as B and Data.ByteString.Lazy as L. 1. this is right solution? 2. could the yesod framework automatically transform lazy <=> strict? because i think posted file's content is always lazy, but we serialize the content as strict.
1. Yes, I think it is the right solution to convert lazy to strict bytestrings. 2. No, because sometimes you want one, and sometimes you want the other. And converting is a potentially costly operation. I haven't tried and I don't know if there are any bad/good consequences, but you may try using a lazy bytestring in your model. In other words, use lazy bytestrings everywhere. Cheers, -- Felipe.