<div dir="ltr"><div><div>Oh, that's a great workaround :)<br><br></div>I ended up just simplifying it - in this case, I only have one source, so I just passed in the curried set function (I don't need to ever get the value, but I could also pass in the curried get function). And it is working very well - I'm happy about the division between FFI and non-FFI code.<br>

<br><br></div>One odd thing about this - I have this signature in the .urs file:<br><br>val init : ...<br>           (float -> transaction unit) -> (* set function *)<br>           ...<br>           transaction unit<br>

<div><div><br></div><div>But to use that function in javascript, I need to pass it _two_ arguments, ie, call it as execF (execF (set_function, float_value), ignored_value)) - where, as the name indicates, the second argument seems to be ignored. It doesn't prevent it from working, but is that expected behavior? ie is there some extra unit argument added to functions, or something?<br>

</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 12, 2013 at 3:54 PM, Adam Chlipala <span dir="ltr"><<a href="mailto:adamc@csail.mit.edu" target="_blank">adamc@csail.mit.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 03/11/2013 07:51 PM, Daniel Patterson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My problem is just writing the type signature for the FFI signature file - as mentioned in the other thread, it seems like sourceL.ur from the meta repository will work for what I want, and so the signature I want to write is:<br>


<br>
val init : id -> (* id for player container *)<br>
           SourceL.t float -> (* offset source *)<br>
           (SourceL.t float -> float -> transaction unit) -> (* set function *)<br>
           url -> (* video url *)<br>
           url -> (* audio url *)<br>
           transaction unit<br>
<br>
Which fails, because the signature file doesn't know what I mean by SourceL. How can I get that in scope, or is this just not possible (because I've overestimated what I can get into javascript)?<br>
</blockquote>
<br></div>
Hm, I can't think of a _principled_ way to do what you're asking, with the current Ur/Web, but here's an _un_principled solution: declare [init] as polymorphic in some type variable, which you then write in place of [SourceL.float]. :)<br>


<br>
______________________________<u></u>_________________<br>
Ur mailing list<br>
<a href="mailto:Ur@impredicative.com" target="_blank">Ur@impredicative.com</a><br>
<a href="http://www.impredicative.com/cgi-bin/mailman/listinfo/ur" target="_blank">http://www.impredicative.com/<u></u>cgi-bin/mailman/listinfo/ur</a><br>
</blockquote></div><br></div>