[ refactor ] use variables more systematically in Data.List.Fresh{.*}#2916
[ refactor ] use variables more systematically in Data.List.Fresh{.*}#2916jamesmckinna wants to merge 21 commits intoagda:masterfrom
variables more systematically in Data.List.Fresh{.*}#2916Conversation
There was a problem hiding this comment.
I like these changes! The only comment I have is that according to the style guide, P should not be a variable as it is not involved in the type of the data definition.
EDIT: Ah I see you already commented above. So R is covered under the style guide already. I think the current style-guide rule is a good balance, and I don't see how one could extend it in a principled manner?
@MatthewDaggitt , you wrote
Thanks! UPDATED: TL;DR: you were right, and I was wrong. The additional commits for the (IGNORE FROM HERE) I (largely) agree, but in my more 'maximalist' style, I am reaching the point where I would like the
That is to say, in this example, once we have Now, this would be a significant widening of the style-guide recommendations, for sure, so how to keep things under reasonable control so that
The alternative (as we do now, but sometimes it gets very creaky, at least, that was how I felt doing this piece of work) is to be (more) disciplined about using module _ {P : Pred A _} wherescoping mechanisms, but the creakiness comes, as with this PR when we pass to I'm sure there are good reasons to reject the above ideas, but... testing the envelope! UPDATED: I think the above can (mostly) stand, but I did at least re-read my own code contributed here, and agree with you. I was being an idiot! |
|
I think in the interests of review overhead, I won't contribute the corresponding refactoring of |
| -- then we have a list of distinct values. | ||
|
|
||
| module _ {a} (A : Set a) (R : Rel A r) where | ||
| module _ (A : Set a) (R : Rel A r) where |
There was a problem hiding this comment.
I keep scratching my head as to whether A could be bound implicitly here, or indeed should.
That would obviously be a breaking change to the API, so out-of-scope for this PR, but still...
gallais
left a comment
There was a problem hiding this comment.
My suggestions are orthogonal to the variable cleanup but I couldn't help myself.
Happy for them to be ignored though :)
Use a `Unary` definition, rather than spell it out explicitly. Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
|
Any thoughts @gallais @MatthewDaggitt concerning my suggested introduction of UPDATED: by inserting appropriate |
|
I do like that |
|
Regarding the discussions above about the type of It's worth noting that at least as far as Similarly, we should followup this PR with one which is more systematic wrt use of |
@jkopanski 's recent #2914 nudged me to think about refactoring the associated modules
variables (UPDATED: it seems the only reasonable way to do this for the whole library is ... little-by-little, at least wrt only 'small' groups of cognate modules?)to extend the range of permitted such declarations to also range overRelandPredarguments... (elsewhere discussed as astyle-guide/library-designissue Policy on generalised variables #697 [ refactor ] Experimenting with variables inData.List#701 etc.)DRAFT, for discussion at this stage.Now open for review (including a self-review... ;-))UPDATED:
CHANGELOGnow records the new notationx #[ R ] xs