[GHC] #9086: main :: IO Int does different things with runghc and when compiled

#9086: main :: IO Int does different things with runghc and when compiled --------------------------+------------------------------------------------ Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: | Version: 7.8.2 Compiler | Operating System: Unknown/Multiple Keywords: | Type of failure: Incorrect result at runtime Architecture: | Test Case: Unknown/Multiple | Blocking: Difficulty: | Unknown | Blocked By: | Related Tickets: | --------------------------+------------------------------------------------ Consider {{{ main :: IO Int main = return 1 }}} This does different things when compiled and when run with `runghc`/`runhaskell` (it prints an extra `1` with the latter). For practical purposes, I think it is beneficial if either of the two ways to run a Haskell program have the same output. Or did somebody intend this to happen? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled ------------------------------------------------+-------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result at runtime | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Comment (by nomeata): Seems to be a left-over from how commands are handled in `GHCi`, where the result of an `IO` action is printed (if it has `Show` and is not `()`, it seems). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled ------------------------------------------------+-------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result at runtime | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: ------------------------------------------------+-------------------------- Changes (by gintas): * owner: => gintas -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled -------------------------------------+------------------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by gintas): * cc: nomeata (added) * difficulty: Unknown => Easy (less than 1 hour) * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled -------------------------------------+------------------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by nomeata): Thanks for the patch! It is common to comment when you change the status of the ticket, something like “I worked on this and here is the result. From my point of view, it is good to go. Can someone review and push it” and possibly more (e.g. whether it was hard or easy, whether you like the result or not). A simple status change may be overlooked. Besides that, the patch (which has a sufficient comment and a test case) looks good from my pov. Unless someone complains I’ll push it soon. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled -------------------------------------+------------------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by gintas): <friendly ping> Is there anything keeping this patch from being applied? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled -------------------------------------+------------------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by thoughtpolice): No, I just haven't gotten to the outstanding patch queue. It's on my radar, don't worry. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled
-------------------------------------+-------------------------------------
Reporter: nh2 | Owner: gintas
Type: bug | Status: patch
Priority: normal | Milestone: 7.10.1
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: Incorrect result | Difficulty: Easy (less than 1
at runtime | hour)
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+-------------------------------------
Comment (by Joachim Breitner

#9086: main :: IO Int does different things with runghc and when compiled -------------------------------------+------------------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: patch Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by nomeata): Sorry, I promised to push it but then it slipped my mind. Just validated and pushed. Congrats, Gintautas, for your first contribution to GHC! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled -------------------------------------+------------------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: patch Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: ghci/scripts/T9086b, | Related Tickets: ghc-e/should_run/T9086 | Blocking: | -------------------------------------+------------------------------------- Changes (by simonpj): * priority: normal => highest * testcase: => ghci/scripts/T9086b, ghc-e/should_run/T9086 Comment: So, can we close this ticket? It looks as if everyone thinks it's done. I added the test cases to the ticket description. I'll make it highest priority so we don't forget to close it! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9086: main :: IO Int does different things with runghc and when compiled -------------------------------------+------------------------------------- Reporter: nh2 | Owner: gintas Type: bug | Status: closed Priority: highest | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Incorrect result | Difficulty: Easy (less than 1 at runtime | hour) Test Case: | Blocked By: ghci/scripts/T9086b, | Related Tickets: ghc-e/should_run/T9086 | Blocking: | -------------------------------------+------------------------------------- Changes (by nomeata): * status: patch => closed * resolution: => fixed Comment: Eh, yes, guess my habit of closing stuff with `fixes #n` in the commit message came through. Sorry. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9086#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC