Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
PermissiveImportsProposal
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Advantages== Currently using more polymorphic functions (e.g. IO functions lifted into MonadIO) or differently monomorphic functions (e.g. Text instead of String-based) requires a certain amount of friction. In these cases it is common to use the same identifiers for the same functionality, but this requires us to hide those same identifiers from any modules which export clashing names. When we've already already explicitly imported those identifiers in the first place these hiding clauses are redundent, and amount to code duplication. Plus, if in the course of refactoring we later decide we no longer need the explicitly imported functions we should probably remove the now-unnecessary hiding clause, which could easily be missed if the programmer isn't conscientious enough, and could cause confusion if they're left in. The other option is to use re-designed modules that don't export the identifiers you don't want to use. This is common in the case of the Prelude, where there are many alternate Preludes with a different set of exported functions. Using these incurs an extra dependency, and doesn't solve the issue if you later decide you need more general functions again. There are legitimate reasons not to want the Prelude to be overly polymorphic, as it can complicate error messages. With this proposal libraries could be more conservative with how much polymorphism they include, and users could still easily take advantage of the more polymorphic functions without the hiding clauses when they need to, still having the less generalized functions when they don't need the extra power. This should reduce the need to expose too much polymorphism in the Prelude (however much that happens to be), and also make it easier for a larger number of people to experiment with changes that might be considered in the future to see how well those changes work in practice. This would also have the advantage when implicitly importing from a module that is updated to export new functions. If you are already using functions with the same identifier this will cause an ambiguous occurrence error. There was discussion about moving <$>/<*> into the Prelude that this was a concern, as it would essentially steal the symbol from other users (http://www.reddit.com/r/haskell/comments/2icjmf/how_to_rewrite_the_prelude/cl14789). Note that the PVP also allows minor version bumps to include new identifiers, though I don't think this is a common problem in practice.
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width