[Ur] Passing non-Basis data types to javascript ffi?

Adam Chlipala adamc at csail.mit.edu
Tue Mar 12 15:54:03 EDT 2013


On 03/11/2013 07:51 PM, Daniel Patterson wrote:
> 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:
>
> val init : id -> (* id for player container *)
>            SourceL.t float -> (* offset source *)
>            (SourceL.t float -> float -> transaction unit) -> (* set 
> function *)
>            url -> (* video url *)
>            url -> (* audio url *)
>            transaction unit
>
> 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)?

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]. :)



More information about the Ur mailing list