-
Notifications
You must be signed in to change notification settings - Fork 234
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
Refactoring uses of with
#2123
Labels
Comments
This was referenced Apr 12, 2024
github-merge-queue bot
pushed a commit
that referenced
this issue
Apr 19, 2024
…) (#2361) * `with`-free definitions plus tests * `CHANGELOG` * use `foldr` on @JacquesCarette 's solution * tidied up unsolved metas * factrored out comparison as removable module `MapMaybeTest` * tidied up; removed `mapMaybeTest` * tidied up; removed v2.1 deprecation section * tidy up long line * Update src/Data/List/Base.agda Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org> * @gallais 's comments * Update src/Data/List/Base.agda Oops! Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org> --------- Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
github-merge-queue bot
pushed a commit
that referenced
this issue
Apr 20, 2024
#2364) * `with`-free definition of `unfold` * fixed previous commit
andreasabel
pushed a commit
that referenced
this issue
Jul 10, 2024
…) (#2361) * `with`-free definitions plus tests * `CHANGELOG` * use `foldr` on @JacquesCarette 's solution * tidied up unsolved metas * factrored out comparison as removable module `MapMaybeTest` * tidied up; removed `mapMaybeTest` * tidied up; removed v2.1 deprecation section * tidy up long line * Update src/Data/List/Base.agda Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org> * @gallais 's comments * Update src/Data/List/Base.agda Oops! Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org> --------- Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
andreasabel
pushed a commit
that referenced
this issue
Jul 10, 2024
#2364) * `with`-free definition of `unfold` * fixed previous commit
andreasabel
pushed a commit
that referenced
this issue
Jul 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cf. #1937
As well as removing 'redundant' uses of
with
, it seems worth flagging as a separate issue the need/desire to exploit the (idiomatics of the) extended capabilities ofwith
notation throughout the library. Specifically:with
esp. in conjunction with the next idiom, irrefutablewith
, building up a cascade of dependent inversions until the final RHS proof term may be assembled from the resulting pieces;with
:with <pat> ← <exp> = ...
which avoids having to uncouple the sub-expression<exp>
from the single matching clause... | <pat> = ...
with which the definition then proceeds; there are three distinguished special cases of this, according to the form of<pat>
:()
or more generally,<constructor> (<constructor>... ()...)
, as a (convenient?) drop-in replacement for more explicit appeals to⊥-elim
orRelation.Nullary.Negation.Core.contradiction
;refl
: such uses seem strictly to extend the capability ofrewrite <exp>
for an<exp>
of types ≡ t
;<pat1> , <pat2> , ... , <patn>
(andrecord
constructors more generally) for extended/nestedΣ
-types; the advantages being that parentheses around the pattern are frequently redundant clutter, but also that such uses may often also permit simplification in the form of replacing the use of an irrefutablewith
pattern with alet <pat1> , <pat2> , ... , <patn> = <exp> in ...
binding instead;with <exp> in <eq>
: this is perhaps more controversial, given the ongoing saga of this notation not precisely offering a drop-in replacement for the hoped-to-be-deprecatedinspect
idiom; nevertheless, all uses ofinspect
have been successfully removed from the library, so the use of this extended form is encouraged where possible;Other features/idioms as they arise... with the proposal that at some point (v2.1? v3.0?) we systematically weed out the redundant uses of
with
and refactor to take advantage of the above.The text was updated successfully, but these errors were encountered: