
13 Jul
2008
13 Jul
'08
7:28 p.m.
On Thu, 2008-07-10 at 10:59 -0700, Jonathan Cast wrote:
On Thu, 2008-07-10 at 14:53 -0300, Marco TĂșlio Gontijo e Silva wrote:
Hello,
how do I unbox a existential quantificated data type?
You can't. You have to use case analysis:
case foo of L l -> <whatever you wanted to do>
where none of the information your case analysis discovers about the actual type of l can be made available outside of the scope of the case expression. (It can't `escape'). This is required for decidable static typing, IIRC.
It's not an extraneous requirement; it is part of the definition of existential types.