On Wed, Sep 9, 2009 at 1:46 PM, Jean-Philippe Bernardy <[email protected]> wrote: > I tried this some time ago, but it is not sufficient to reload the > values. The problem is that it is impossible to "recreate" a type for > a runtime value, in general. > The best you can hope (I think) is to use a GADT to encode type info, then you > may recover type in a pre-determined universe. I don't see the details > yet though.
Ah I see the comment in Yi/Dynamic now: -- Unfortunately, this is not serializable: there is no way to recover a type from a TypeRep. data Dynamic = forall a. Initializable a => Dynamic a Hmmm. Yes. Some further functionality is required to build a data marshalling layer suitable for for the dynamic store. After a bit of research I think Happstack.Data.State has all the features yi requires. Even has support for accounting for versioning. Which is something yi might encounter if a user reloads after installing a new version of yi. http://hackage.haskell.org/package/happstack-data specifically the module: http://hackage.haskell.org/packages/archive/happstack-data/0.3.3/doc/html/Happstack-Data-Serialize.html Also has a template haskell module that can aid in generating the Serialize instances required. We can likely trim down the happstack-data package to only include the modules that we need. Might just want to branch it from them anyways. Sound like a reasonable plan? Cheers, Corey O'Connor --~--~---------~--~----~------------~-------~--~----~ Yi development mailing list [email protected] http://groups.google.com/group/yi-devel -~----------~----~----~----~------~----~------~--~---
