Giter VIP home page Giter VIP logo

Comments (4)

HuStmpHrrr avatar HuStmpHrrr commented on July 17, 2024

I don't have a preference. I think there are two reasons to use records:

  1. the stdlib mainly uses records;
  2. Emacs C-c C-r works quite well for record directly.

but neither is that important. we can try both if copatterns have advantages. but due to agda/agda@ace8e0d, will performance still be a part of consideration?

from agda-categories.

andreasabel avatar andreasabel commented on July 17, 2024

Maybe I alerted you to this question without need, since I was not aware of agda/agda@ace8e0d . If the rhs of a function clause is a record expression (using actual record syntax), then this clause is internally translated to copattern matching.
I think this heuristics was introduced to bring out the benefits of copatterns without forcing users to rewrite large code bases. Thus, you should be fine if you use record syntax.

Orthogonal to this is of course the stylistic policy of the library.

from agda-categories.

JacquesCarette avatar JacquesCarette commented on July 17, 2024

This subtlety is good to know -- especially the part where this doesn't happen when using a record constructor. I tend to like record constructors... but I guess going through a function-as-constructor works.

from agda-categories.

JacquesCarette avatar JacquesCarette commented on July 17, 2024

Right, part of this issue is indeed moot.

Stylistically, I strongly prefer records as the principal way of defining things (i.e. the explicit 'field' keyword and the way things look for record definitions).

For instantiating records, I have not settled on a style. I would not be against using a mixed style in agda-categories.

I consider this to be a sufficient policy 'decision' for now, and so this issue can be closed.

from agda-categories.

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.