<div dir="ltr">if you are willing to have a closed universe, you can pattern match on a gadt to do do the unpacking</div><br><div class="gmail_quote"><div dir="ltr">On Sat, 20 Feb 2016 at 19:19 Jeffrey Brown <<a href="mailto:jeffbrown.the@gmail.com">jeffbrown.the@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, that is my point. Existentials cannot be unwrapped.</div><div class="gmail_extra"></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 20, 2016 at 4:18 AM, Kosyrev Serge <span dir="ltr"><<a href="mailto:_deepfire@feelingofgreen.ru" target="_blank">_deepfire@feelingofgreen.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>Jeffrey Brown <<a href="mailto:jeffbrown.the@gmail.com" target="_blank">jeffbrown.the@gmail.com</a>> writes:<br>
> After further study I believe existentials are not (at least alone)<br>
> enough to solve the problem.<br>
</span>..<br>
<span>> getInt :: ShowBox -> Int<br>
> getInt (SB i) = i<br>
><br>
> will not compile, because it cannot infer that i is an Int:<br>
<br>
</span>You take a value of an existentially quantified type (which means it<br>
can be anything at all, absent some extra context) and *proclaim* it<br>
is an integer.<br>
<br>
On what grounds should the compiler accept your optimistic restriction?<br>
<div><div><br>
--<br>
с уважениeм / respectfully,<br>
Косырев Сергей<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div><div class="gmail_extra">-- <br><div><div dir="ltr">Jeffrey Benjamin Brown</div></div>
</div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>