[Haskell-cafe] Any generic serializer to String? was: Any working example of using genericserialize?

Max Bolingbroke batterseapower at hotmail.com
Wed Sep 30 09:53:37 EDT 2009


FWIW, writing your own is not hard. I wrote a serializer for GHC using
Data in less than 150 (simple) LOC. It produces [Word8], but producing
strings instead would be easy. You can check out the code here:

http://darcs.haskell.org/ghc/compiler/utils/Serialized.hs

Cheers,
Max

2009/9/30 Dimitry Golubovsky <golubovsky at gmail.com>:
> Hi,
>
> On 9/30/09, Jason Dagit <dagit at codersbase.com> wrote:
>
> [skip]
>
>> Seems like using withList is wrong or the deserializer is simply buggy.  It
>> certainly doesn't work the way I would expect SExp reading to work.  I also
>> notice from reading the source on hackage that there may not be any tests
>> for this package and it is a 0.1 release.  I'd contact the author, as it
>> seems there is a deficiency in the documentation or a bug in the
>> implementation.
>
> Thanks Jason for trying this. The genericserialize package is probably
> not finished yet.
>
> What else exists that could be used to serialize in generic way (i.
> e., anything that is an instance of Data and Typeable) into a string?
> It does not need to be very efficient as structures to be serialized
> are not huge (but may be pretty complex), and serialization is a part
> of an utility not to be used frequently. It only needs to "just work".
>
> One thing I thought of was to serialize to JSON (there is a generic
> serializer in one of packages although I did not test it other way)
> which has higher overhead than S-expressions though.
>
> Any other thoughts?
>
> Thanks.
>
> --
> Dimitry Golubovsky
>
> Anywhere on the Web
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>


More information about the Haskell-Cafe mailing list