Skip to content

Conversation

@gares
Copy link
Member

@gares gares commented Mar 2, 2021

No description provided.

- [StructureName.of T : StructureName sT] infers the class of the canonical [StructureName.type] of [T].
- [StructureName.Build T cT : StructureName T] outputs the class of the canonical,
and [StructureName.type] of [cT], and give it the type [Structure]. So that it is
ready to use in combination with HB.instance, as in
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CohenCyril I've some troubles understanding this lat bullet point, see also the change below

structures.v Outdated
Comment on lines 300 to 303
(* not sure I get this use case *)
HB.instance Definition _ := StructureName.Build T cT.
(* cloning a structure *)
HB.instance Definition _ := StructureName.Build T' (StructureName.of T).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(* not sure I get this use case *)
HB.instance Definition _ := StructureName.Build T cT.
(* cloning a structure *)
HB.instance Definition _ := StructureName.Build T' (StructureName.of T).
(* cloning a structure *)
HB.instance Definition _ := StructureName.Build T cT.

I see why you are confused. Build does not have the same type as for factories and mixins.

Indeed we since the only authorized way of making a class is to get it from another structure
StructureName.Build T' (StructureName.of T). would be redundant, that's way I skip StructureName.of altogether and the second argument of StructureName.Build is simply another structure we want to take the class from.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should have another name. Maybe we should even redefine clone to be this one...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked the fact that it's a Build because T comes first and then "how to build" is simply different by nature for classes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example does not show how you get cT, so I'm not so sure I can fix the comment myself.
It is not just the code snippet, it is also the bullet point which fails to parse to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- [StructureName.Build T cT : StructureName T] outputs the class of the canonical,
    and [StructureName.type] of [cT], and give it the type [Structure]. So that it is
    ready to use in combination with HB.instance, as in

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S.Build T cT builds a class record. It is projected out the canonical S on T. [Structure] seem unbound.

Copy link
Member

@CohenCyril CohenCyril Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should read:

- [StructureName.Build T cT] outputs the class of the canonical [StructureName.type] of [cT],
  and gives it the type [StructureName T]. So that it is ready to use in combination with HB.instance, as in

@gares
Copy link
Member Author

gares commented Mar 2, 2021

Can you clarify the naming convention? This is my understanding

  • T is a type (a carrier)
  • sT is a structure on T (T is the carrier)
  • cT is the class of sT

but I guess it is wrong

@CohenCyril
Copy link
Member

Can you clarify the naming convention? This is my understanding

  • T is a type (a carrier)
  • sT is a structure on T (T is the carrier)
  • cT is the class of sT

but I guess it is wrong

Right, I should use T' then in the problematic bullet. I used cT to mean "Type with a canonical", but that's not intuitive at all.

@gares
Copy link
Member Author

gares commented Mar 2, 2021

Maybe I should have opened an issue instead of a PR, and let you open the PR.
Maybe this is what we should do, you update the doc and I do the crash test dummy.

@gares
Copy link
Member Author

gares commented Mar 30, 2021

Great!

@CohenCyril CohenCyril merged commit 2345551 into master Mar 30, 2021
@CohenCyril CohenCyril deleted the improve-doc branch March 30, 2021 14: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