You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Following example does not work because return is not parsed correctly:
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
text <- return "hello"
putStrLn text
main ()
The text was updated successfully, but these errors were encountered:
Btw, there's another trick in the example: the putStrLn implementation assumes that Roy functions are curried and partially applicable which apparently is not the case. Hence, my working version has also this change:
let putStrLn line = (\() -> console.log line)
In this same experiment I tried to introduce
let const x = (\() -> x)
But that doesn't compile; const seems like a reserved word. Don't know if that's intentional... (If I name it "always" instead, it compiles)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Following example does not work because
return
is not parsed correctly:The text was updated successfully, but these errors were encountered: