
12 Sep
2006
12 Sep
'06
10:15 a.m.
Bulat Ziganshin wrote:
data Box = forall a. Cxt a => Box a quite successfully for a while. But now I am trying to implement the Load/Save mechanism and getting stuck with that. It's not hard to write a Box into a file, but how do I get it back?
gshow/gread provided by module Data.Generics.Text
I am afraid this won't do it. For gread to work I still need to know the result type before I call it, but the problem with the Box is exactly that you don't know the type it will contain in advance. Maybe there is a way to dump the binary representation of the whole box and then read it back (using unsafeCoerce or similar stuff on the way)? Cheers, Misha