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

Create a contributor's guide #308

Open
sstucki opened this issue Aug 26, 2021 · 2 comments
Open

Create a contributor's guide #308

sstucki opened this issue Aug 26, 2021 · 2 comments

Comments

@sstucki
Copy link
Collaborator

sstucki commented Aug 26, 2021

(Prompted by the discussion in #304 (comment).)

There are some guidelines in the README.md about what idioms to use and to avoid, but there are also a bunch of non-trivial patterns (like the use of the sym-* fields, or general strategies for avoiding bad performance) that don't seem to be documented in the repo. These should probably all go into a contributors guide.

Until there's such a guide, we could maybe at least collect important points here.

@sstucki
Copy link
Collaborator Author

sstucki commented Aug 26, 2021

I'll start: apparently, its a bad idea to inline long equational proofs in record definitions.

@JacquesCarette
Copy link
Collaborator

  • don't use let-in because that's just syntactic sugar, and it will get expanded out / duplicated everywhere. It might be ok for open and giving short names meant for humans.
  • don't put module versions of a record in records all over the place. These make the end results a lot bigger, and make typechecking time go up quite a bit too. [Note: the paper explicitly advocates for this pattern! It is indeed super-convenient, but also very bad for efficiency.]
  • be very sparing with open public. This can be convenient at times, but can also really pollute the name space and make interoperability complicated
  • do use using qualifiers, both at the top and for local modules. These end up in the signature of the modules, and can have a knock-on effect on size.
  • avoid putting too many utilities directly in a record. Instead, go for minimal records and a utility module that adds them all. Then users can choose to bring them in at the use site.

paolobrasolin added a commit to paolobrasolin/agda-categories that referenced this issue Jun 22, 2024
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

No branches or pull requests

2 participants