
12 Aug
2008
12 Aug
'08
8:58 p.m.
Maybe it makes sense to have the streamble list instance in Binary as well, with some examples?
A flexible format that doesn't sacrifice too much space efficiency would be to encode in chunks of up to 255 elements: Chunk = { length :: Word8 elems :: [Elem] -- 0..255 repetitions } Chunks = [Chunk] -- terminated with the first 0 length Chunk streamable, amortized cost is about 1/256th of the length, and the encoding is much more efficient than the current scheme for short lists (like most strings). Currently a string "foobar" is 8 bytes for length and 7 for the actual string.
-- Don
Tim Newsham http://www.thenewsh.com/~newsham/