Skip to content

Instantly share code, notes, and snippets.

@raimohanska
Created November 26, 2012 19:56
Show Gist options
  • Save raimohanska/4150252 to your computer and use it in GitHub Desktop.
Save raimohanska/4150252 to your computer and use it in GitHub Desktop.
Roy Monad syntax bug
let ioMonad = {
return: \x -> (\() -> x)
bind: \action f -> (\() ->
let value = action ()
let action2 = f value
action2 ()
)
}
let putStrLn line = (\() -> console.log line)
let main = do ioMonad
_ <- putStrLn "a"
putStrLn "b"
main ()
@raimohanska
Copy link
Author

If line 13 was just

putStrLn "a"

The letter "a" doesn't get printed.

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