-
Notifications
You must be signed in to change notification settings - Fork 246
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
Un-deprecate inspect idiom #2107
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,15 +104,17 @@ module _ (_≟_ : DecidableEquality A) {x y : A} where | |
≢-≟-identity = dec-no (x ≟ y) | ||
|
||
|
||
------------------------------------------------------------------------ | ||
-- Inspect | ||
|
||
-- Inspect can be used when you want to pattern match on the result r | ||
-- of some expression e, and you also need to "remember" that r ≡ e. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of the (many? subtle!) peculiarities of Unless one perhaps writes directly with inspect {.(f a)} f a
... | eq = ... but even then the explicit dot-patterned term is not bound to a(n independent) variable subsequently available to the matcher. So even the pragmatic of this notation are both annoying, and hard to explain well... |
||
|
||
------------------------------------------------------------------------ | ||
-- DEPRECATED NAMES | ||
------------------------------------------------------------------------ | ||
-- Please use the new names as continuing support for the old names is | ||
-- not guaranteed. | ||
-- See README.Inspect for an explanation of how/why to use this. | ||
|
||
-- Version 2.0 | ||
-- Normally (but not always) the new `with ... in` syntax described at | ||
-- https://agda.readthedocs.io/en/v2.6.3/language/with-abstraction.html#with-abstraction-equality | ||
-- can be used instead." | ||
|
||
record Reveal_·_is_ {A : Set a} {B : A → Set b} | ||
(f : (x : A) → B x) (x : A) (y : B x) : | ||
|
@@ -123,12 +125,3 @@ record Reveal_·_is_ {A : Set a} {B : A → Set b} | |
inspect : ∀ {A : Set a} {B : A → Set b} | ||
(f : (x : A) → B x) (x : A) → Reveal f · x is f x | ||
inspect f x = [ refl ] | ||
|
||
{-# WARNING_ON_USAGE Reveal_·_is_ | ||
"Warning: Reveal_·_is_ was deprecated in v2.0. | ||
Please use new `with ... in` syntax described at https://agda.readthedocs.io/en/v2.6.3/language/with-abstraction.html#with-abstraction-equality instead." | ||
#-} | ||
{-# WARNING_ON_USAGE inspect | ||
"Warning: inspect was deprecated in v2.0. | ||
Please use new `with ... in` syntax described at https://agda.readthedocs.io/en/v2.6.3/language/with-abstraction.html#with-abstraction-equality instead." | ||
#-} |
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.
'result' or 'value'?
(I realise this is the previous text, but I wonder if this is more precise usage?)