Skip to content
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

Very dependent map and zipWith? #833

Closed
JacquesCarette opened this issue Jul 7, 2019 · 2 comments · Fixed by #2373
Closed

Very dependent map and zipWith? #833

JacquesCarette opened this issue Jul 7, 2019 · 2 comments · Fixed by #2373
Assignees

Comments

@JacquesCarette
Copy link
Contributor

Buried in the old categories library, I found the following gems:

  map⁎ :  {a b p q} {A : Set a} {B : A  Set b} {P : A  Set p} {Q : {x : A}  P x  B x  Set q} 
        (f : (x : A)  B x)  ( {x}  (y : P x)  Q y (f x))  (v : Σ A P)  Σ (B (proj₁ v)) (Q (proj₂ v))
  map⁎ f g (x , y) = (f x , g y)

  map⁎′ :  {a b p q} {A : Set a} {B : A  Set b} {P : Set p} {Q : P  Set q}  (f : (x : A)  B x)  ((x : P)  Q x)  (v : A × P)  B (proj₁ v) × Q (proj₂ v)
  map⁎′ f g (x , y) = (f x , g y)

  zipWith :  {a b c p q r s} {A : Set a} {B : Set b} {C : Set c} {P : A  Set p} {Q : B  Set q} {R : C  Set r} {S : (x : C)  R x  Set s} (_∙_ : A  B  C)  (_∘_ :  {x y}  P x  Q y  R (x ∙ y))  (_*_ : (x : C)  (y : R x)  S x y)  (x : Σ A P)  (y : Σ B Q)  S (proj₁ x ∙ proj₁ y) (proj₂ x ∘ proj₂ y)
  zipWith _∙_ _∘_ _*_ (a , p) (b , q) = (a ∙ b) * (p ∘ q)

Should these be added to the standard library?

@MatthewDaggitt
Copy link
Contributor

Oh wow, those are fun! Yes, they'd be good to add. The zipWith name is consistent I think. I'm not sure what to call the map variants? Are people happy with map*? The one thing that definitely needs to be changed is that the ′ needs to be turned in a \prime.

@JacquesCarette
Copy link
Contributor Author

I'm not particularly pleased with map* (that's the name in the library, not mine). I'd be happy doing a PR for this, once the names have settled. So I'll assign this to myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants