Skip to content

Instantly share code, notes, and snippets.

@raimohanska
Created November 26, 2012 17:16
Show Gist options
  • Save raimohanska/4149458 to your computer and use it in GitHub Desktop.
Save raimohanska/4149458 to your computer and use it in GitHub Desktop.
IO Monad in Roy (why fails?)
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 ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment