Git Product home page Git Product logo

Comments (13)

gares avatar gares commented on July 1, 2024

I like mixin and factory to be attributes.
I don't like much the builder line.

I'm just brainstorming

from hierarchy-builder.

gares avatar gares commented on July 1, 2024

We could also indent things like

#[mixin] HB
Record .....

and hope to be able to write, one day,

#[hb.mixin]
Record .....

from hierarchy-builder.

CohenCyril avatar CohenCyril commented on July 1, 2024

and hope to be able to write, one day,

#[hb.mixin]
Record .....

That would be really nice...

from hierarchy-builder.

CohenCyril avatar CohenCyril commented on July 1, 2024

#[factory]
HB Record Monoid_of_Type.axioms A := { ... } as f.
#[builder] HB Definition _ : AbGroup.axioms A _ := AbGroup.Axioms A (foo f).
HB End.

I do not like the fact that the presence of HB End depends on an attribute...

from hierarchy-builder.

gares avatar gares commented on July 1, 2024

It is already the case of other coq commands, iirc #[program] can change if the command opens goals or not...

An alternative would be to turn End into something different, eg Export Builders.

Another option is to let one list after the factory record the names of the builders, and implicitly end the module when the last one is declared (a bit a la next Obligation )

from hierarchy-builder.

gares avatar gares commented on July 1, 2024

Actually, we could tell the user which builders are required (proviso factories come after structure). Am I right?

from hierarchy-builder.

CohenCyril avatar CohenCyril commented on July 1, 2024

Actually, we could tell the user which builders are required (proviso factories come after structure). Am I right?

We could, but that would be too verbose...

from hierarchy-builder.

CohenCyril avatar CohenCyril commented on July 1, 2024

Actually, my preference goes to:

(* a mixin is necessarily a record *)
HB Mixin AbGroup.axioms T of Monoid.axioms T & .. := Axioms { opp : T -> T; ..  }.

(* a factory can be a record or a definition *)
HB Factory Record Monoid_of_Type.axioms T of .. & .. := Axioms { foo : .. ; .. }.
HB Builders (T : Type) (f : Monoid_of_Type.axioms T). 
 #[hb.instance T]
 Definition _ : AbGroup.axioms T := AbGroup.Axioms T (foo f).
HB End.

HB Structure Ring of Foo.axioms & Bar.axioms.

Definition X_isFoo : Foo.axioms X := ...
Definition X_isBar : Bar.axioms X := ...
(* equivalent to #[hb.instance X] for the two definitions above *)
HB Instance X X_isFoo X_isBar.

from hierarchy-builder.

gares avatar gares commented on July 1, 2024

I think that I will not merge attributes yet in coq-elpi.
All the rest is doable, but using Record or Definition as a prefix, otherwise it is too ambiguous (were does the telescope begin?)

from hierarchy-builder.

gares avatar gares commented on July 1, 2024

So it will be always HB Instance X... or HB Instance Definition ...
and HB Mixin Definition .. or HB Mixin Record ...

from hierarchy-builder.

gares avatar gares commented on July 1, 2024

and the tentation HB.Mixin is so strong ;-)

Anyway, the current syntax with no capitals looks so much lighter to me... maybe HB.mixin ?

from hierarchy-builder.

gares avatar gares commented on July 1, 2024
HB Factory Record Monoid_of_Type.axioms T of .. & .. := Axioms { foo : .. ; .. }.

I'm wondering what is the purpose of Module.axioms... can't we just put Module (and define a Module.axiom as per contract)?

from hierarchy-builder.

CohenCyril avatar CohenCyril commented on July 1, 2024

I'm wondering what is the purpose of Module.axioms... can't we just put Module (and define a Module.axiom as per contract)?

Mmmh, we could. I am not sure whether I prefer a "contract" or explicit naming though... but we already have a contract for .type and .sort, so let's go for .axioms.

from hierarchy-builder.

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.