Beside the internal implementation, why does it take a name to privde a binding? JS B () never has a interesting result. So shouldn't the signature be:
sunroofCompileJSB :: CompilerOpts -> JS B () -> IO String
Possible implementation:
sunroofCompileJSB :: CompilerOpts -> JS B () -> IO String
sunroofCompileJSB opts f = do
(stmts,_) <- compileJS opts 0 (single . JS_Return) $ do
k <- continuation (\ () -> f)
goto k () :: JS A ()
return $ showStmt $ ExprStmt $ scopeForEffect stmts
Right now
sunroofCompileJSB
has the following signature:Beside the internal implementation, why does it take a name to privde a binding?
JS B ()
never has a interesting result. So shouldn't the signature be:Possible implementation: