I&#39;m trying to get around my problem (still stuck...).<br>I have really to call a function like this:<br>triggerEvent :: (Typeable e, Show e, Eq e) =&gt; Event e -&gt; EventData e -&gt; State Game ()<br><br>This function simply execute an event given the corresponding data and change the state of the game.<br>
Now as explained my web framework won&#39;t accept random types (like &quot;e&quot;) to be passed around.<br>So I said to myself &quot;OK, so let&#39;s store the events in a list and ask the gui to just give me the number of the event&quot;.<br>
So I have an heterogeneous list of events [EventWrap]:<br><br>data EventWrap where<br>    EW :: (Typeable e, Show e, Eq e) =&gt; {eventNumber :: Int, event :: Event e} -&gt; EventWrap<br><br>Do you think this solution can lead me somewhere?? I have actually doubts I can find back my &quot;Event e&quot; from the list because of the implicit forall in the GADT.....<br>
<br>Thanks,<br>Corentin<br><br><br><div class="gmail_quote">On Wed, Oct 24, 2012 at 3:37 PM, Chris Smith <span dir="ltr">&lt;<a href="mailto:cdsmith@gmail.com" target="_blank">cdsmith@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><p dir="ltr">&quot;Corentin Dupont&quot; &lt;<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>&gt; wrote:<br>
&gt; I could ask my user to make his new type an instance of a class as suggested by Alberto...</p>
</div><p dir="ltr">If you are working with unknown types, then your options are: (a) constrain to some type class, or (b) have your clients pass in functions to operate on the type alongside the values.  Actually the first is just a special case of the second with syntactic sugar...</p>


</blockquote></div><br>