-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import Prelude by default #18
Comments
I implemented this, but while testing the different cases I discovered that hint doesn't behave very well when the Prelude is not imported or imported qualified. The problem seems to be, once again, with the type of the evaluated expression, A simple solution would be to also import the Prelude unqualified, but then this would cause naming conflicts, i.e. if the user imports ByteString unqualified, Another workaround would be to return a built-in type, such as The hardest, but most correct fix would be to dig into the source of |
Wait but this is already implemented: in let modulesWithPrelude = if "Prelude" `L.notElem` fmap P.fst modules
then ("Prelude",Nothing):modules
else modules |
That code imports the prelude, unqualified, if it isn't already imported. It doesn't add an implicit Prelude import to the user prelude, nor does it fix the subsequent issue with naming conflicts. The only situation in which it helps is with the – Samuel On 2013-08-29, at 1:58 PM, Mario Pastorelli [email protected] wrote:
|
I have implemented the unsafePerformIO solution. It is now possible to define commands whose name would previously have conflicted with the Prelude:
|
And, of course, the Prelude module is now implicitly imported by the user's prelude if it is missing:
In this situation, however, the Prelude is not available from the user's expression:
I'm not sure if that's the expected behaviour or not. |
If we want to mimic standard haskell, then |
Ah, found it! I had removed that |
Should be fixed now. Closing. |
Continued from issue 50.
hint
doesn't implicitly import Prelude even when NoImplicitPrelude is off, so we'll have to modify the source to addimport Prelude
if it isn't already present, but only if the user hasn't specified NoImplicitPrelude.The text was updated successfully, but these errors were encountered: