[ deprecate ] Relation/Binary.PropositionalEquality.inspect (#1580 / #1630 / #1930 redux)#2934
[ deprecate ] Relation/Binary.PropositionalEquality.inspect (#1580 / #1630 / #1930 redux)#2934jamesmckinna wants to merge 3 commits intoagda:masterfrom
Relation/Binary.PropositionalEquality.inspect (#1580 / #1630 / #1930 redux)#2934Conversation
|
I further experimented with the following 'alternative' (well: hardly!) design, which is less dramatic, but does achieve (by the back door) deprecation of the bugbear module Graph {A : Set a} {B : A → Set b} (f : (x : A) → B x) (x : A) where
record View (y : B x) : Set (a ⊔ b) where
field fx≡y : f x ≡ y
view : View (f x)
view .View.fx≡y = refl
pattern [_] eq = record { fx≡y = eq } -- can be omitted?
-- Version 2.4
module _ {A : Set a} {B : A → Set b} where
Reveal_·_is_ : (f : (x : A) → B x) (x : A) (y : B x) → Set (a ⊔ b)
Reveal f · x is y = Graph.View f x y
inspect : (f : (x : A) → B x) (x : A) → Reveal f · x is f x
inspect = Graph.view
{-# WARNING_ON_USAGE inspect
"Warning: inspect was deprecated in v2.4.
Please use Graph.view instead. "
#-}
{-# WARNING_ON_USAGE Reveal_·_is_
"Warning: Reveal_·_is_ was deprecated in v2.4.
Please use Graph.View instead. "
#-}That way we still retain a useful notion (the graph relation associated with a function, cf. my comment on #2909; this is Conor's
Perhaps the thing to do is to lift this out to a separate module, or else in |
|
I rather like the |
Thanks for the endorsement. I realised that to try and work out a 'proper' design wrt arbitrary (indexed!) relations, and naming, was a bit beyond me (I have yet another wicked chest/throat infection atm after what seems like 7 continuous weeks of freezing rain here), so I'll make some rearrangements to the above code, and then leave it be... but I'd be happy either way if the most recent commit b23264e were reverted. I think it's time to stop picking at this particular wart! |
Fixes #1580 see the discussion there and on the previous attempts #1630 #1930.
CHANGELOGbased on text from #1930NB
Relation/Binary.HeterogeneousEquality.*modules, which should be tackled in a separate PR, once we can agree how best to deal with them.README.Inspect#2928 (on which this PR isblocking;-)) forward pointers to documentation of the Agda v2.9.0 release.UPDATED: added
CHANGELOG, but cancelled most recentmake testto save cycles.