[GHC] #13039: Add options to select GHCi prompt type errors

#13039: Add options to select GHCi prompt type errors -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: new request | Priority: low | Milestone: 8.4.1 Component: GHCi | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- [This SO post](http://stackoverflow.com/questions/41354231/how-can-i-set- up-haskells-ghci-to-interactively-evaluate-functions-to-their-sig) implicitly suggests some extra options for reporting type errors for expressions typed into GHCi. When GHCi reports a type error for an expression `e` typed at the prompt, it has effectively failed to check `void e :: IO ()` and `print e :: IO ()`. It always reports the error for the latter. There are three things a user may want, and I think options should control which ones are shown: 1. Why didn't `void e :: IO ()` check? 2. Why didn't `print e :: IO ()` check? 3. If any type could be inferred for `e`, what was it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13039 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13039: Add options to select GHCi prompt type errors -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature request | Status: new Priority: low | Milestone: 8.4.1 Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by Iceland_jack): * cc: Iceland_jack (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13039#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13039: Add options to select GHCi prompt type errors -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature request | Status: new Priority: low | Milestone: 8.4.1 Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by dfeuer: @@ -1,2 +1,2 @@ - [This SO post](http://stackoverflow.com/questions/41354231/how-can-i-set- - up-haskells-ghci-to-interactively-evaluate-functions-to-their-sig) + [http://stackoverflow.com/questions/41354231/how-can-i-set-up-haskells- + ghci-to-interactively-evaluate-functions-to-their-sig This SO post] New description: [http://stackoverflow.com/questions/41354231/how-can-i-set-up-haskells- ghci-to-interactively-evaluate-functions-to-their-sig This SO post] implicitly suggests some extra options for reporting type errors for expressions typed into GHCi. When GHCi reports a type error for an expression `e` typed at the prompt, it has effectively failed to check `void e :: IO ()` and `print e :: IO ()`. It always reports the error for the latter. There are three things a user may want, and I think options should control which ones are shown: 1. Why didn't `void e :: IO ()` check? 2. Why didn't `print e :: IO ()` check? 3. If any type could be inferred for `e`, what was it? -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13039#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13039: Add options to select GHCi prompt type errors -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature request | Status: new Priority: low | Milestone: 8.4.1 Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): I don't like the idea of adding options here since they will only benefit those who know about them; and I don't think those will be the same people as the people who have trouble with the existing behavior. (And if you really want to know why `void e :: IO ()` didn't type check then you can enter `void e :: IO ()` into ghci; and that's much more obvious than turning on an option.) I do think that it'd be reasonable to improve the (default) behavior when `e` type checks but `print e` does not (presumably due to a missing `Show` instance). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13039#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC