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
[ fix #4093 ] Bye bye Set #4629
Conversation
What happens if you rename |
This file is accepted: {-# OPTIONS --no-auto-import-primitive #-}
open import Agda.Primitive renaming (Set to _X_X_)
test : _X_X₁_
test = _X_X_ |
What if you rename |
{-# OPTIONS --no-auto-import-primitive --prop #-}
open import Agda.Primitive renaming (Set to Set; Prop to Set₁)
test : Set₁
test = Set gives
:( |
Oh, sorry… |
So next on the list is the ability to rename the |
Agda won't truly be configurable until we make it possible to rename |
Yes! It should be possible to rename |
What about the following code? {-# OPTIONS --no-auto-import-primitive #-}
open import Agda.Primitive using (Prop)
postulate
Set₁ : Prop
open import Agda.Primitive using (Set)
postulate
A : Set₁ |
The code is accepted if you add the |
Yes, we should have a bit of insurance against such obfuscation.
In the spirit of looking forward, I suggest to rename the
|
I agree. |
I was leaving this comment without seeing this discussion. Could not be the default behaviour without implicit import and |
But currently |
Sorry, I did not think about backward compatibility. Of course In that case, I would upvote this comment from Andreas, Otherwise, would not be better |
It affects |
Maybe, aiming for forward compatibility, the I would suggest having modules |
I've updated the PR with better handling of cases with ambiguous names, e.g. {-# OPTIONS --no-auto-import-primitive --prop #-}
open import Agda.Primitive renaming (Set to Set; Prop to Set₁)
test : Set₁
test = Set now gives
and {-# OPTIONS --no-auto-import-primitive #-}
open import Agda.Primitive using (Prop)
postulate
Set₁ : Prop
open import Agda.Primitive using (Set)
postulate
A : Set₁ gives
I also renamed the Finally, I renamed the |
This can be merged once the CI passes. |
My rebase messed things up, plz send help |
…le auto-import of Agda.Primitive using (Set; Prop)
…ixed or non-suffixed
That looks better, let's hope CI passes this time. |
@@ -56,6 +57,7 @@ import Agda.Utils.Maybe | |||
import Agda.Utils.Monad | |||
import Agda.Utils.Null | |||
import Agda.Utils.Pretty | |||
import Agda.Utils.Suffix as C |
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.
This might have connections to #5706.
This PR implements my proposed solution for #4093. It consists of the following changes:
Set
andProp
are removed as keywords, as areSet0
,Set1
,Prop0
, ... and their unicode variants.Agda.Primitive
now declares two new builtins{-# BUILTIN SET Set #-}
and{-# BUILTIN PROP Prop #-}
, which can be renamed when importing this module.open import Agda.Primitive using (Set; Prop)
, unless the flag--no-auto-import-primitive
is used.SET
andPROP
, so for exampleType0
,Type1
, ... are now accepted whenSet
has been renamed toType
.SET
andPROP
, so the renamed versions are used in error messages and interactive commands.If there is a consensus that this is a good design, I will add a changelog entry, some documentation, and a test case before merging.