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
adding qualified name lookup for psci :browse issue #974 #1824
Conversation
Nothing -> | ||
PSCI $ outputStrLn $ "Module '" ++ N.runModuleName moduleName ++ "' is not valid." | ||
Just qualifiedName -> | ||
handleBrowse qualifiedName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we're running make
twice. Can we avoid that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just copy and run the if
on line 489 again instead, would that be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, let's not copy it. Maybe we can extract it into a separate function.
@garyb Let's include this one in 0.8, yes? |
Sure, sounds good to me 👍 |
failNotInEnv moduleName | ||
where | ||
isModInEnv modName st = | ||
isJust $ find ((\ (P.Module _ _ mName _ _ ) -> mName == modName) . snd) (psciLoadedModules st) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isJust . find = any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you can then eta-reduce:
isModInEnv modName = any ((== modName) . getModuleName . snd) . psciLoadedModules
@soupi I added a couple more comments here. If you could have a quick look, I'll get this merged in before the next RC. Thanks! |
@paf31 thanks for the suggestions! I made the changes and squashed the commits by doing a force push. I hope that's alright. |
adding qualified name lookup for psci :browse issue #974
Thanks very much! |
gladly! |
as requested here.