j.stutterheim at me.com
Mon Nov 12 09:16:22 CET 2012
foreign import js "%1.push(%2)"
push :: JSArray a -> a -> IO (JSArray a)
Here, we write a small expression in the import declaration, in which the object and arguments are numbered. The object argument, %1, corresponds to the `JSArray a` in the type signature of `push`, while the method argument %2 corresponds with the `a` in the type signature. Chris Done drew inspiration from this calling convention in designing the FFI for his Fay programming language.
Any input on this is appreciated :)
More information about the Glasgow-haskell-users