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

Version 6: poly-type template #1166

Open
8 tasks
Tracked by #757
StoneCypher opened this issue Aug 14, 2022 · 0 comments
Open
8 tasks
Tracked by #757

Version 6: poly-type template #1166

StoneCypher opened this issue Aug 14, 2022 · 0 comments

Comments

@StoneCypher
Copy link
Owner

StoneCypher commented Aug 14, 2022

Back in the flow days, the template took two types, not one - one for the underlying data type, and one for the node type

These days there are a lot of opportunities for types, and most of them won't show up together. The node type, the action type, the data type, the input and output tape types, and more.

In 6, we should probably have an object that passes in the subordinated types. This means we'll need to figure out a notation for type defaults, so that states are strings-unless-we-say-otherwise, et cetera.

One interesting thing about this would be checking the states and actions against the provided type - if it's not string but rather an alternation of string literals. In that way, multiple machines could be held to a shared communications standard.

A notation like this would be nice:

const tape_inputs  = [troll, treasure, empty, goblin, door],
      tape_outputs = [attack, run, defend, bash, open, sneak],
      machine      = sm<{ inputs: tape_inputs, outputs: tape_outputs }>`...`;
  • Version 6: Type wrapper object for poly-type declaration
  • Version 6: Type wrapper object type defaulting mechanism
  • Version 6: Expose type aliases from type wrapper object as members, for ease
  • Version 6: Type wrapper - state type
  • Version 6: Type wrapper - action type
  • Version 6: Type wrapper - input tape type
  • Version 6: Type wrapper - output tape type
  • Version 6: Type wrapper - data type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant