-
Notifications
You must be signed in to change notification settings - Fork 242
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
[ refactor ] Possible refactoring of #2509 / #2513 ? #2517
Comments
If this can be done in a way compatible with the current module dependency graph then this seems like a nice refactoring. |
#2513 added
to the dependencies of So the question is: do we want As for the proposed refactoring, I still need to figure out the best way to achieve it, but that is, I think, independent of the above question? |
My feeling is definitely this way round. Binary relations should depend on unary relations. |
OK. I think we were perhaps too hasty with #2513 ! |
Incoming PR #2524 refactors to put lemma under |
#2527) * add: `⊆-Reasoning` on the model of `Subset` * fix title comment * add: `Heterogeneous.Properties.⊆-Reasoning` * fixed `CHANGELOG` * fixed `CHANGELOG`: added missing lemma name from #2517 * oops: fixed `import` * reduce code duplication * refactor: pick the correct `preorder` * do not hide the useful reasoning combinators. Also the ≋-syntax needed a 4th argument. * tidied up symmetry proof * `fix-whitespace` --------- Co-authored-by: Jacques Carette <[email protected]>
This issue may be regarded (and hence instantly dismissed) as a
status:duplicate
of #2509... but posted for 'documentation'/alternative implementation purposes.I'm happy with the merged #2513 , fixing #2509 , and so too is the author of the OP. Thanks to @MatthewDaggitt for the speedy turnround time!
That said, a brain-worm has been worrying away at me as to whether a pattern-matching-free solution was available (slightly better abstraction wrt presentation/implementation of the
Sublist
relation...?), and it seems there is: relative to the existing solution inData.List.Relation.Unary.All.Properties
, we can refactor as follows(and further simplification may be even be possible in the definition of
prf
itself? The⊆-reflexive
step is to pass from a rather simple relation viamap
to the more complex iteratedSublist (Sublist R)
... so this seems to have the flavour of the triangular identities forSublist
as a suitable 'monad' on relations... but I can't quite see the details yet)This suggests that we might, instead, refactor by lifting out the above
where
-bound lemma into a self-standing one inData.List.Relation.Binary.Sublist.Propositional.Properties
(maybe even inSetoid
? but then the proposed refactoring seems to stumble on the parameterisation on theSetoid
, and the lemma shifts fromA
toList A
... :-(, so perhaps the answer is to pull back all the way toHeterogeneous.Properties
?) of the formleaving the final implementation (under
Data.List.Relation.Unary.All.Properties
? or should this move as well?) simply as:The text was updated successfully, but these errors were encountered: