<p>That pattern looks so familiar. :) Existential types seem to fit in to the type system really well so I never got why it is not part of the standard.</p>
<div class="gmail_quote">On Aug 12, 2012 10:36 AM, "Daniel Trstenjak" <<a href="mailto:daniel.trstenjak@gmail.com">daniel.trstenjak@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi Oleg,<br>
<br>
On Sat, Aug 11, 2012 at 08:14:47AM -0000, <a href="mailto:oleg@okmij.org">oleg@okmij.org</a> wrote:<br>
> I'd like to point out that the only operation we can do on the first<br>
> argument of MkFoo is to show to it. This is all we can ever do:<br>
> we have no idea of its type but we know we can show it and get a<br>
> String. Why not to apply show to start with (it won't be evaluated<br>
> until required anyway)?<br>
<br>
It's only a test case. The real thing is for a game and will be<br>
something like:<br>
<br>
class EntityT e where<br>
update :: e -> e<br>
<br>
render :: e -> IO ()<br>
<br>
handleEvent :: e -> Event -> e<br>
<br>
getBound :: e -> Maybe Bound<br>
<br>
<br>
data Entity = forall e. (EntityT e) => Entity e<br>
<br>
data Level = Level {<br>
entities = [Entity],<br>
...<br>
}<br>
<br>
<br>
Greetings,<br>
Daniel<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>