Open ion1 opened 10 years ago
GHCJS supports
foreign import javascript safe "foo($1, $c);" foo :: A -> IO B
where $c stands for a continuation/callback function such that
$c
do { b <- foo a; {-rest-} }
translates into an equivalent of
foo(a, function (b) { /*rest*/ });
instead of
var b = foo(a); /*rest*/
making asynchronous code more convenient to write. It would be nice if Haste had that.
Since Haste's IO monad is synchronous, this would be hard to support with the normal FFI. However, it would probably be quite possible to implement something like this for Haste.Foreign. Will look into it.
Haste.Foreign
GHCJS supports
where
$c
stands for a continuation/callback function such thattranslates into an equivalent of
instead of
making asynchronous code more convenient to write. It would be nice if Haste had that.