Giter VIP home page Giter VIP logo

Comments (7)

mechvel avatar mechvel commented on September 28, 2024

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.

mechvel avatar mechvel commented on September 28, 2024

How to enter here the underscore symbol?

from agda-stdlib.

fmap avatar fmap commented on September 28, 2024
`_≈_`

https://guides.github.com/features/mastering-markdown/

from agda-stdlib.

MatthewDaggitt avatar MatthewDaggitt commented on September 28, 2024

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.

mechvel avatar mechvel commented on September 28, 2024

from agda-stdlib.

gallais avatar gallais commented on September 28, 2024

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.

mechvel avatar mechvel commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.