
#13893: Improved Help for Control.Concurrent and Control.Exception when "variable not in scope" -------------------------------------+------------------------------------- Reporter: vanto | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by vanto): Replying to [[span(style=color: #FF0000, slyfox )]]:\\
Why take preference of packages coming with ghc in this case?\\ Because these are the main libraries, of course. Those related to Haskell standard Prelude. (e.g Data.Char, Control.Applicative, Control.Monad, Data.Monoid, Data.Foldable and so on)\\\\
It's not always the case that user wants to use base's primitives.\\ so what?\\\\
I would say suggesting incorrect module imports would lead to more confusion.\\ You do not trust the compiler?\\ Dr. Bjarne Stroustrup said that you should always trust the answers given by the compiler. And he's right. So that GHC gives the right answers, you have to program it in this way. it is obvious.\\ If the compiler is able to recognize the variables that belong to a module ( which I quote above) it must be able to suggest the appropriate module.\\ __And to go further if the compiler is able to suggest the right module it must be able to compile it independently of the programmer.__\\ The compiler is able to recognize many of the leading pragmas (file-header LANGUAGE pragmas).
Which procedure should define which packages (and modules) are blessed to deliver suggestions for symbols?\\ I do not quite understand the question.\\ But if you talk about the code that makes it work it would be the same
As ticket's subject is worded why Control.Concurrent and Control.Exception should be threated special?\\ Not at all. These modules are examples. The subject is badly defined in
Experiencing yourself by writing a few expressions that need their pragmas to work, but do not write them and compile the file. You will be surprised to see how well the compiler is able to recognize them and to propose them to the programmer to insert them in the program. Even changes the order of the functions in the file. Moves the first function to the end for example and writes the function from end to beginning. Done with functions using various pragmas and you will be even more surprised.\\ __What the compiler can do is marvellous.__\\\\ procedure which defines the pragmas I suppose or another choice that remains to be defined.\\\\ the ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13893#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler