Skip to content

Add polyvar docs (latest) #173

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

Merged
merged 6 commits into from
Jan 9, 2021
Merged

Add polyvar docs (latest) #173

merged 6 commits into from
Jan 9, 2021

Conversation

ryyppy
Copy link
Member

@ryyppy ryyppy commented Jan 5, 2021

Fixes #154

Copy link

@jchavarri jchavarri left a comment

Choose a reason for hiding this comment

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

looks amazing! thanks for your hard work on the docs.

Copy link
Collaborator

@IwanKaramazow IwanKaramazow left a comment

Choose a reason for hiding this comment

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

Good stuff!

```res
// This doesn't actually need any color type definition
// beforehand
let myColor = #Red
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add the js output?


### Upper Bound (`[<`)

The upper bound works in the exact opposite way: The extending type may only use constructors that are stated in the lower bound constraint.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The upper bound works in the exact opposite way: The extending type may only use constructors that are stated in the lower bound constraint.
The upper bound works in the exact opposite way: the extending type may only use constructors that are stated in the lower bound constraint.

Content:
- recursive types
- JS output for relevant snippets
- Variant vs polymorphic variant section
@ryyppy
Copy link
Member Author

ryyppy commented Jan 7, 2021

@bobzhang @IwanKaramazow @jchavarri thanks for your feedback! I addressed all your raised issues and actually added some more content that I forgot:

  • Composing poly variant types (type rgb = [ red | green | #Blue ])
  • Pattern matching | #...red

etc etc

@ryyppy ryyppy merged commit 9b0df04 into master Jan 9, 2021
@ryyppy ryyppy deleted the add-polyvariant-docs branch January 9, 2021 11:38
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.

Document Polymorphic Variants
5 participants