Skip to content
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 qualified" is desired #4302

Open
luochen1990 opened this issue Jan 24, 2018 · 1 comment
Open

"import qualified" is desired #4302

luochen1990 opened this issue Jan 24, 2018 · 1 comment

Comments

@luochen1990
Copy link
Contributor

I'm using Idris 1.2.0, and find that import ... as ... is not qualified, and still cause name confliction.

Here is my test code:

module TestNamespace

import Data.Vect as V

data Ty = UNIT | ARR Ty Ty

data Elem : V.Vect n Ty -> Ty -> Type where
  Here : {ts : V.Vect n Ty} -> Elem (t::ts) t
  There : {ts : V.Vect n Ty} -> Elem ts t -> Elem (t'::ts) t

-- Type checking .\namespace-issue.idr
-- namespace-issue.idr:9:11-60:
--   |
-- 9 |   There : {ts : V.Vect n Ty} -> Elem ts t -> Elem (t'::ts) t
--   |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- When checking type of There:
-- Can't disambiguate name: TestNamespace.Elem, Data.Vect.Elem

I think we have to provide qualified importing. Consider the following situation: We have written down thousands of code and using some Identifier A, and one day, we need to import a new package P, and P also defined A. If there is no qualified importing, we have to change thousands of code to replace A into Main.A, just because we want to import another package.

@ahmadsalim ahmadsalim changed the title "import qualified" is required "import qualified" is desired Jan 27, 2018
@ahmadsalim
Copy link

Thanks for the feature request. Contributions are more than welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants