[Haskell-cafe] Re: Mining Twitter data in Haskell and Clojure
aslatter at gmail.com
Mon Jun 28 22:51:47 EDT 2010
On Mon, Jun 28, 2010 at 2:32 PM, Don Stewart <dons at galois.com> wrote:
>> To binary package users/authors: is there a typed version of binary (that
>> is, one that records and checks a representation of the serialized type
>> before actual (de-)serialization)? It
>> would be nice to have such a type check, even though it
>> wouldn't protect against missing bytes or strictness changes.
> There is a wrapper, that wraps all encodes in a typeOf (iirC), I think
> by Edward Kmett, but I couldn't find e.g. binary-typed on Hackage.
In Happstack.Data there's a wrapper type called Object which we
serialize through which has a type-rep field and a ByteString field,
and the deserialize instance function checks that the type-string
filed matches "show (typeOf result)":
A similar technique might be approrpiate for 'binary' or 'cereal'.
More information about the Haskell-Cafe