{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/intero/issues/575","repository_url":"https://api.github.com/repos/commercialhaskell/intero","labels_url":"https://api.github.com/repos/commercialhaskell/intero/issues/575/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/intero/issues/575/comments","events_url":"https://api.github.com/repos/commercialhaskell/intero/issues/575/events","html_url":"https://github.com/commercialhaskell/intero/issues/575","id":353973879,"node_id":"MDU6SXNzdWUzNTM5NzM4Nzk=","number":575,"title":"User prompt bug confusing for beginners","user":{"login":"bigos","id":392498,"node_id":"MDQ6VXNlcjM5MjQ5OA==","avatar_url":"https://avatars0.githubusercontent.com/u/392498?v=4","gravatar_id":"","url":"https://api.github.com/users/bigos","html_url":"https://github.com/bigos","followers_url":"https://api.github.com/users/bigos/followers","following_url":"https://api.github.com/users/bigos/following{/other_user}","gists_url":"https://api.github.com/users/bigos/gists{/gist_id}","starred_url":"https://api.github.com/users/bigos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigos/subscriptions","organizations_url":"https://api.github.com/users/bigos/orgs","repos_url":"https://api.github.com/users/bigos/repos","events_url":"https://api.github.com/users/bigos/events{/privacy}","received_events_url":"https://api.github.com/users/bigos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-25T02:05:15Z","updated_at":"2018-10-01T10:36:16Z","closed_at":null,"author_association":"NONE","body":"I am a Haskell noob and I do not know if something is intended Haskell behaviour or my mistake. I have wasted much time trying to print prompt get one line and print some output. The following code does not work with intero:\r\n```\r\nmodule Main where\r\n\r\nmain :: IO ()\r\nmain = do\r\n  putStrLn \"Type something\"\r\n  line <- getLine\r\n  putStrLn (\"you said: \" ++ line)\r\n```\r\n\r\nIn the terminal, I get the expected behaviour:\r\n```\r\n*Main> main\r\nType something\r\none two three\r\nyou said: one two three\r\n```\r\nBut in intero I get this very confusing output:\r\n```\r\nλ main\r\nType something\r\none two three\r\n\r\n<interactive>:10:1: warning: [-Wdeferred-out-of-scope-variables]\r\n    Variable not in scope: one :: t0 -> t1 -> IO a0\r\n\r\n<interactive>:10:5: warning: [-Wdeferred-out-of-scope-variables]\r\n    Variable not in scope: two\r\n\r\n<interactive>:10:9: warning: [-Wdeferred-out-of-scope-variables]\r\n    Variable not in scope: three\r\n*** Exception: <interactive>:10:1: error:\r\n    Variable not in scope: one :: t0 -> t1 -> IO a0\r\n(deferred type error)\r\n```\r\n\r\nCan you imagine my frustration?"},"comment":{"url":"https://api.github.com/repos/commercialhaskell/intero/issues/comments/425862252","html_url":"https://github.com/commercialhaskell/intero/issues/575#issuecomment-425862252","issue_url":"https://api.github.com/repos/commercialhaskell/intero/issues/575","id":425862252,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTg2MjI1Mg==","user":{"login":"bhrgunatha","id":914363,"node_id":"MDQ6VXNlcjkxNDM2Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/914363?v=4","gravatar_id":"","url":"https://api.github.com/users/bhrgunatha","html_url":"https://github.com/bhrgunatha","followers_url":"https://api.github.com/users/bhrgunatha/followers","following_url":"https://api.github.com/users/bhrgunatha/following{/other_user}","gists_url":"https://api.github.com/users/bhrgunatha/gists{/gist_id}","starred_url":"https://api.github.com/users/bhrgunatha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhrgunatha/subscriptions","organizations_url":"https://api.github.com/users/bhrgunatha/orgs","repos_url":"https://api.github.com/users/bhrgunatha/repos","events_url":"https://api.github.com/users/bhrgunatha/events{/privacy}","received_events_url":"https://api.github.com/users/bhrgunatha/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T10:36:16Z","updated_at":"2018-10-01T10:36:16Z","author_association":"NONE","body":"I think it's a bug, but to work around it you could use `shell`, `eshell` or similar when you need input from the keyboard. \r\n```\r\nM-x eshell\r\nWelcome to the Emacs shell\r\nghci\r\nGHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help\r\nPrelude> :l Test\r\n[1 of 1] Compiling Test             ( Test.hs, interpreted )\r\nOk, one module loaded.\r\n*Test> test\r\nmore text\r\nyou said : more text\r\n```\r\nSame result using `stack ghci`\r\n\r\n---\r\n```\r\nM-x shell\r\n$ ghci \r\nGHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help\r\nPrelude> :l Test.hs \r\n:l Test.hs \r\n[1 of 1] Compiling Test             ( Test.hs, interpreted )\r\nOk, one module loaded.\r\n*Test> test \r\ntest \r\n-- at keyboard enter: some text\r\nsome text^Jyou said:  some text\r\n*Test> \r\n```\r\nSame result using `stack ghci`.\r\nI'm not sure why `shell` is repeating keyboard input + `^J` before output but `eshell` doesn't."}}
{"actor":{"display_login":"bhrgunatha"}}