Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunroofCompileJSB does not need a binding name? #38

Open
jbracker opened this issue Apr 29, 2013 · 2 comments
Open

sunroofCompileJSB does not need a binding name? #38

jbracker opened this issue Apr 29, 2013 · 2 comments

Comments

@jbracker
Copy link
Member

Right now sunroofCompileJSB has the following signature:

sunroofCompileJSB :: CompilerOpts -> String -> JS B () -> IO String

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
@jbracker
Copy link
Member Author

Did we settle on something for this?

@andygill
Copy link
Member

No - not yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants