Comments (7)
This is definitely about Agda's handling of 'irrelevant' (which I've run into quite a bit too). A discussion about it should happen on the Agda side (either Zulip or git issues) as that's where the experts are for that.
from agda-stdlib.
Further evidence towards the identification of Recomputable
and Harrop:
Recomputable : ∀ {a} (A : Set a) → Set a
Recomputable A = .A → A
_×-recompute_ : Recomputable A → Recomputable B → Recomputable (A × B)
(rA ×-recompute rB) p = rA (p .proj₁) , rB (p .proj₂)
-- NB this definition fails: (rA ×-recompute rB) (a , b) = rA a , rB b
-- Cannot pattern match against irrelevant argument of type A × B
-- when checking that the pattern a , b has type A × B
→-recompute : Recomputable B → Recomputable (A → B)
→-recompute rB f a = rB (f a)
∀-recompute : (B : A → Set b) → ((x : A) → Recomputable (B x)) → Recomputable ((x : A) → B x)
∀-recompute B rB f a = rB a (f a)
Suggest that this become a focus of effort on reconciling (the) 'classical' fragment(s) of type theory with the ambient intuitionistic.
Or has this already been done somewhere (else) before?
Have now asked on the main Agda Zulip
Nisse's answer there has me needing to think a bit harder. Specifically, I don't think we can make a simple-minded identification of Recomputable
and Harrop; rather they have the same/similar closure properties. But for any collection of 'base' types, the Harrop/negative fragment defined over them will satisfy all sorts of things (Recomputable
, Decidable
, Stable
, ...) depending on the corresponding conditions on those base types. So this seems really to be more about 'induction over the negative fragment'.
from agda-stdlib.
But the main content of the issue: namely reconciling 'irrelevant' ⊥-elim
and ⊥-elim
, still stands. So at some point I'll turn the branch into a small(er)-scale PR, leaving the 'other' issue: what/where/how should we define Recomputable
, and refactor the library to make use of this definition? So... further comments on the issue welcome towards such an eventual 'design'.
from agda-stdlib.
Proposal: replace the type of ⊥-elim
with that of ⊥-elim-irr
:
⊥-elim : ∀ {w} {Whatever : Set w} → .⊥ → Whatever
⊥-elim ()
Would this constitute a breaking change?
from agda-stdlib.
Would this constitute a breaking change?
Given that we don't have subtyping for functions whose domain is irrelevant (the following is rejected:
app : {A B : Set} → (.A → B) → (A → B)
app f = f
) then I'd say yes. It could break strange code that uses ⊥-elim
partially applied.
from agda-stdlib.
Good point: I think that the proposal goes one step too far. Indeed it would only break rather strange code, but the debugging pain would be quite something!
from agda-stdlib.
Thanks to both. Indeed, errors arising from (some) partial applications of contradiction
was one reason I introduced its friend contradictionᵒ
in #2243 , and I won't pursue the more radical proposal on that PR ... or any other, until v3.0! But definitely keen to push on with what's already there. Please review!
from agda-stdlib.
Related Issues (20)
- List of sub-optimal definitions in `Data.List.Base` HOT 25
- Add the `Setoid`al structure of a (free) `Monoid` on `List` HOT 1
- lib2.0 : `ℕᵇ `(binary) can be pure unlike `ℕ`. HOT 8
- To let or not to let HOT 3
- lemma for `map` for `⊆` as Subset
- Allow `.lagda` for library sources HOT 7
- `m+[n∸m]≡n` in the wrong section HOT 2
- Add bundled mono-/iso-{/epi-} morphisms
- Add bundles for lattice-like and module-like morphisms
- Document `variable` block indentation style HOT 5
- [DRY] what's the best way to `public`ly re-export properties/structure? HOT 5
- Use the Monoid structure of Endomorphisms to define powering HOT 1
- [DRY] More redundant `zero` fields in `Algebra.Structures`
- Why is `Data.List.Relation.Binary.Subset.Setoid.Properties` not parametrized on the `Setoid` as a whole HOT 5
- What's the 'right' notion of equality between functions? HOT 7
- [DRY] Refactor `Algebra.Solver.*Monoid` (or deprecate entirely?)
- Rename `WeaklyDecidable`? HOT 4
- Add `Algebra.Properties.IdempotentCommutativeMonoid`
- Naming of new functions `tail∘inits` and `tail∘tails` HOT 5
- comments on lib-2.1 candidate 1 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agda-stdlib.