Skip to content

Conversation

@jkopanski
Copy link
Contributor

I needed to inline Decidable because otherwise Agda wasn't able to figure out r.

Copy link
Collaborator

@jamesmckinna jamesmckinna left a comment

Choose a reason for hiding this comment

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

Thanks very much for this.
It all looks good, but I've offered suggestions which might sharpen what you have.

Comment on lines 32 to 36
variable
r : Level

_∈?_ : {R : Rel A r} → (x : A) → (xs : List# A R) → Dec (x ∈ xs)
x ∈? xs = any? (x ≟_) xs
Copy link
Collaborator

Choose a reason for hiding this comment

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

The explicit expansion to use Dec might indeed be annoying. I'm not sure it would necessarily be an improvement (readability?), though, to open import Relation.Binary.Definitions using (Decidable), and then have

 private
  variable
    r : Level
    R : Rel A r


------------------------------------------------------------------------
-- Re-export contents of propositional membership

open import Data.List.Fresh.Membership.Setoid setoid public

------------------------------------------------------------------------
-- Other operations

infix 4 _∈?_ _∉?_

_∈?_ : Decidable (_∈_ {R = R})
x ∈? xs = any? (x ≟_) xs

instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The explicit expansion to use Dec might indeed be annoying

It's not that annoying imho. In the opening message I was just trying to address question that I thought might pop up.

Copy link
Collaborator

@jamesmckinna jamesmckinna Jan 23, 2026

Choose a reason for hiding this comment

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

But thanks for encouraging the question!

It may be that I am irritated by having to supply so much quantifier prefix/inlined terms in order to get past the typechecker, so I thought it worth exploring the alternatives, notwithstanding @JacquesCarette 's reservations concerning #697 ...

See #2916 for such an exploration, following my suggestions above.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And thanks for taking my suggestions... I think it does look cleaner now. I think we can merge this now, but suggest waiting till Monday in case any of the other maintainers have strong views on the matter!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may be that I am irritated by having to supply so much quantifier prefix/unlined fern in order to get past the typechecker, so I thought it worth exploring the alternative

Sure, although personally I have a knee-jerk reaction whenever I have to apply implicit to operator thinking that I must have done something wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

See also agda/agda#8067

@jamesmckinna jamesmckinna added this pull request to the merge queue Jan 26, 2026
Merged via the queue into agda:master with commit dbdebad Jan 26, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants