[cap-talk] Access Abstraction vs Static Typing
Sandro Magi
smagi at higherlogics.com
Thu Dec 13 15:32:49 EST 2007
Mark Miller wrote:
>
> Ok, now I think I mostly understand the question. Except that the
> question I think I understand would convert from a received byte
> sequence to an typed object by safe unserialization, not upcasting.
> This raises the question of how one can write a statically typed safe
> unserializer. As Jonathan Rees first pointed out to me,
> unserialization can be viewed as a simplified form of eval(). (Data-E
> is based on this idea.) GADTs are sufficient to write a statically
> typed eval(), and so should be sufficient to write a statically typed
> safe unserializer.
>
> Does this answer the actual question?
Serialization is a polytypic/generic function. GADTs are one solution to
polytypm via representation types [1], but there are others.
Sandro
[1] http://lambda-the-ultimate.org/node/2566#comment-38770
More information about the cap-talk
mailing list