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

Qualified imports #2004

Merged
merged 9 commits into from
Apr 14, 2023
Merged

Qualified imports #2004

merged 9 commits into from
Apr 14, 2023

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Apr 13, 2023

This pr extends the import statement to support optional renaming. The syntax is as follows:

import Stdlib.Data.Nat as Nat;
import Stdlib.Data.Nat as Qual.Nat;

It is allowed to give the same name to multiple modules:

import Stdlib.Data.Nat as X;
import Stdlib.Data.Int as X;

axiom a : X.Nat;
axiom b : X.Int;

open X; -- This will cause an ambiguous name error

@janmasrovira janmasrovira added scoping enhancement New feature or request syntax labels Apr 13, 2023
@janmasrovira janmasrovira added this to the 0.3.2 milestone Apr 13, 2023
@janmasrovira janmasrovira self-assigned this Apr 13, 2023
@janmasrovira janmasrovira temporarily deployed to github-pages April 14, 2023 09:11 — with GitHub Actions Inactive
@janmasrovira janmasrovira marked this pull request as ready for review April 14, 2023 09:21
@janmasrovira janmasrovira marked this pull request as draft April 14, 2023 09:23
@janmasrovira janmasrovira temporarily deployed to github-pages April 14, 2023 09:28 — with GitHub Actions Inactive
@janmasrovira janmasrovira marked this pull request as ready for review April 14, 2023 09:41
@janmasrovira janmasrovira temporarily deployed to github-pages April 14, 2023 09:52 — with GitHub Actions Inactive
@janmasrovira janmasrovira temporarily deployed to github-pages April 14, 2023 14:15 — with GitHub Actions Inactive
Copy link
Collaborator

@paulcadman paulcadman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice - I tried it in my containers and quickcheck projects and it works well.

@janmasrovira janmasrovira merged commit 15b29bc into main Apr 14, 2023
@janmasrovira janmasrovira deleted the qualified-imports branch April 14, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scoping syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants