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

Try making all of the ids type parameters #1371

Draft
wants to merge 8 commits into
base: dev
Choose a base branch
from
Draft

Try making all of the ids type parameters #1371

wants to merge 8 commits into from

Conversation

7h3kk1d
Copy link
Contributor

@7h3kk1d 7h3kk1d commented Aug 13, 2024

This is still just an idea. Not sure if it's a good one.

Comment on lines +16 to +22
type segment('a) = list(piece('a))
and piece('a) =
| Tile(tile('a))
| Grout(Grout.t)
| Secondary(Secondary.t)
| Projector(projector)
and tile = {
| Projector(projector('a))
and tile('a) = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main idea for tiles.

// invariants:
// - length(mold.in_) + 1 == length(label)
// - length(shards) <= length(label)
// - length(shards) == length(children) + 1
// - sort(shards) == shards
id: Id.t,
extra: 'a,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rename this to something more relevant and have the inhabitants use a {id: Id.t} type rather than directly embed Id.t

| Cast(t, Typ.t, Typ.t) // first Typ.t field is only meaningful in dynamic expressions
and t = IdTagged.t(term);
| Cast(t('id), Typ.t, Typ.t) // first Typ.t field is only meaningful in dynamic expressions
and t('id) = IdTagged.t(term('id), 'id);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't feel like the right encoding but I'd like to talk with someone else about it before I fall down any more rabbit holes

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.

1 participant