Comments (7)
Strangely, this editor cancels many of underscores that I set in the code.
Let me try to copy-paste the underscore from the first line:
≈
from agda-stdlib.
How to enter here the underscore symbol?
from agda-stdlib.
`_≈_`
https://guides.github.com/features/mastering-markdown/
from agda-stdlib.
Hmm I can envisage a use case for such a type. Not sure about the name Respects₂gen
though. My alternative is:
_Respects₂_∧_ : ∀ {a b ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} →
REL A B ℓ₁ → Rel A ℓ₂ → Rel B ℓ₃ → Set _
_∼_ Respects₂ _≈₁_ ∧ _≈₂_ = ∀ {x y u v} → x ∼ u → x ≈₁ y → u ≈₂ v → y ∼ v
Still not entirely happy with it though. Thoughts?
The other question is whether we define it as a product ala _Respects₂_
_Respects₂_∧_ : ∀ {a b ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} →
REL A B ℓ₁ → Rel A ℓ₂ → Rel B ℓ₃ → Set _
_∼_ Respects₂ _≈₁_ ∧ _≈₂_ = (∀ {y} → (_∼ y) Respects _≈₁_) ×
(∀ {x} → (x ∼_) Respects _≈₂_)
from agda-stdlib.
from agda-stdlib.
I keep introducing generalisations of the combinators in Relation.Binary.Core
, the
latest being P ⟶ Q Respects _∼_ = ∀ {x y} → x ∼ y → P x → Q y
so I can sympathise.
I would go even further and suggest:
_⟶_Respects₂_∧_ :
∀ {a b c d r s ℓ₁ ℓ₂} {A : Set a} {B : Set b} {C : Set c} {D : Set d}
(R : REL A B r) (S : REL C D s) (_≈₁_ : REL A C ℓ₁) (_≈₂_ : REL B D ℓ₂) → Set _
R ⟶ S Respects₂ _≈₁_ ∧ _≈₂_ = ∀ {a b c d} → a ≈₁ c → b ≈₂ d → R a b → S c d
The others can be defined as specialisations.
The other question is whether we define it as a product ala
_Respects₂_
I would say yes because this one is usable even when the respected relations are not
reflexive. However it may be worth defining an ad-hoc record type rather than using
a product, this way we can provide the two-in-one-go as a definition in the record's
module.
from agda-stdlib.
Currently I define and use
RELRespects : REL A B ℓ → Rel A ℓ₁ → Rel B ℓ₂ → Set _
RELRespects _~_ _~₁_ _∼₂_ =
∀ {x x' y y'} → x ~₁ x' → y ∼₂ y' → x ~ y → x' ~ y'
and suggest this for Standard library.
The attempt with _Respects_×_
failed because when it is applied to examples, it overlaps with applying _Respects_
,
so that one is forced to apply (_Respects _×_ ~ ~'1 ~2)
with ignoring the infix possibility.
from agda-stdlib.
Related Issues (20)
- Organizing 3.0
- ``_=ₛ_`` and ``⊆ + reverse`` for lib-2.0 HOT 4
- List of wrinkles in `Data.List.Properties` HOT 7
- List of sub-optimal definitions in `Data.List.Base` HOT 28
- 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
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.