a universal printer for Haskell?
Ch. A. Herrmann
Mon, 18 Feb 2002 12:36:24 +0100
Bernard> I, and I assume many other Haskell programmers would from
Bernard> time to time like a universal print mechanism, something
Bernard> that can turn an arbitrary value into a String.
yes, I'm such a Haskell programmer that would like such a mechanism but
it only makes sense for me if you also have the inverse function.
In this case, you could save the state of your computation on disk and
recover it later, send run-time functions to a remote machine
and execute them on that machine with full control by the programmer.
This marshalling/unmarshalling mechanism is provided partially by
some Haskell tools. As far as I heard, OCaml permits a more general
mechanism, but I didn't manage to get it running with OCaml.
Anyway, I don't want to program in OCaml.
Probably the reason that this mechanism doen't exist in Haskell yet is that
it is difficult to implement. Also, efficient marshalling will likely
produce unreadable strings for elements of the Show class and thus,
would be an additional feature, no extension.