Hi,
Sorry if it was not enough explicit.
I want to write functions like this:

serialize :: (Show a) => Event a -> IO ()
deserialize :: (Read a) => IO () -> Event a

The functions would write and read the data in a file, storing/retrieving also the type "a" I suppose...
BR,
C



On Sun, Oct 21, 2012 at 7:03 PM, MigMit <miguelimo38@yandex.ru> wrote:
Seems like nobody really understands what is it that you want to accomplish or what your problem is.

ïÔÐÒÁ×ÌÅÎÏ Ó iPhone

21.10.2012, × 20:39, Corentin Dupont <corentin.dupont@gmail.com> ÎÁÐÉÓÁÌ(Á):

Nobody on this one?
Here is a simplified version:

data Event a where
ššš InputChoice ::š a -> Event a

How to serialize/deserialize this?

Cheers,
Corentin

On Sat, Oct 20, 2012 at 10:49 PM, Corentin Dupont <corentin.dupont@gmail.com> wrote:
Hi the list!
I have a simple question, how can I serialize/deserialize a structure like this:

data InputChoice cš deriving Typeable
data Event a where
ššš InputChoice :: (Eq c, Show c) => [c] -> c -> Event (InputChoice c)
š(...)

I'd like that the values of type "c" get serialized to a String... That's the easy part, but for deserializing, oops!

Cheers,
Corentin

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe