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

Flat records for limits/colimits #417

Closed
wants to merge 29 commits into from
Closed

Flat records for limits/colimits #417

wants to merge 29 commits into from

Conversation

TOTBWF
Copy link
Collaborator

@TOTBWF TOTBWF commented Jul 26, 2024

Description

This PR flattens out Binary-products et. al into flat records to get better printing.

Currently, this is a draft to get API feedback!

Checklist

Before submitting a merge request, please check the items below:

  • I've read the contributing guidelines.
  • The imports of new modules have been sorted with support/sort-imports.hs (or nix run --experimental-features nix-command -f . sort-imports).
  • All new code blocks have "agda" as their language.

If your change affects many files without adding substantial content, and
you don't want your name to appear on those pages (for example, treewide
refactorings or reformattings), start the commit message and PR title with chore:.

@TOTBWF TOTBWF changed the title Flat limits/colimits Flat records for limits/colimits Jul 26, 2024
@Lavenza
Copy link
Member

Lavenza commented Jul 26, 2024

Pull request preview

@ncfavier
Copy link
Member

Could we have a test/reproducer for the printing issues with, say, binary products?

@TOTBWF
Copy link
Collaborator Author

TOTBWF commented Jul 26, 2024

I think @plt-amy had a good real world example in https://gist.github.com/plt-amy/9f1efaaef2fe15baf4965be21e60994b, we could use the code that generated the nightmare for that

@ncfavier
Copy link
Member

I guess things like δ-natural can serve as test cases. Without this PR the goal is

is-product.⟨ Product.has-is-product (all-products y y) , id ⟩
      id
      ∘ f
      ≡
      is-product.⟨ Product.has-is-product (all-products y y) ,
      f ∘ Product.π₁ (all-products x x) ⟩
      (f ∘ Product.π₂ (all-products x x))
      ∘ is-product.⟨ Product.has-is-product (all-products x x) , id ⟩ id

With this PR it becomes ⟨ id , id ⟩ ∘ f ≡ ⟨ f ∘ π₁ , f ∘ π₂ ⟩ ∘ ⟨ id , id ⟩. Much better!

@TOTBWF TOTBWF marked this pull request as ready for review August 12, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants