TokTok / hs-msgpack-binary

Haskell implementation of MessagePack / msgpack.org
http://msgpack.org/
Other
16 stars 10 forks source link

Add option to encode records as string-to-T maps #27

Open iphydf opened 7 years ago

iphydf commented 7 years ago

Currently, records and tuples are encoded the same way. Reordering or adding fields in records will break the serialisation format. We could add an option to use field names as map indices. This would only break if fields are renamed. We could also add an option to be lax about accepting input: extra fields are ignored. To be lax about missing fields, we would need to require a Default instance for every field type, effectively making MessagePack a subclass of Default.