MessagePack is a binary serialization format, which apparently can be used from both Haskell and Python, languages that I need to mix in a project of mine.
The structures that I need to serialize are fairly trivial:
data Citation = Citation {
sourceDocument :: Document,
targetDocument :: Document,
links :: [ Reference ]
}
type Reference = (Int, Int)
data Document = Document {
words :: [ ByteString ],
wordNums :: [ Int ]
}
but I have no idea where to start. Apparently the library for MessagePack supports some kind of deriving mechanism that would make easy to do the above, by making "Document" automatically an instance of OBJECT, but my attempts to invoke automatic derivation have so far failed....
What do you think?
Here is a link to the library: http://hackage.haskell.org/package/msgpack-0.7.1.5 And here is a link to some examples, none of which would work according to the documentation for the above version: