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

Change #pattern to *pattern #581

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Change #pattern to *pattern #581

wants to merge 2 commits into from

Conversation

SanderSpies
Copy link
Contributor

@SanderSpies SanderSpies commented Jun 13, 2016

Fixes #578.

Also related to #366

@jordwalke
Copy link
Member

Wow, I had no idea we could even use #polymorphic-type in a pattern match!
I see the motivation here. We should come up with a consistent language for representing row-polymorphic types and then try to use that in this case. It's likely not going to be the *. Perhaps your goal was merely to get it out of the syntactic real estate quickly so that we could use # for polymorphic variants? The syntax for polymorphic pattern type match likely should match the syntax for class types which also use the #. If we change one we should probably change the other.

@SanderSpies
Copy link
Contributor Author

Yes, the idea is to make it possible to use # for polymorphic variants. This PR was mostly to start the discussion on how to solve this. I see class types as something different though and from my understanding it's not related. Actually for this change I think we should focus on polymorphic variants instead. In that sense it should be somewhat related to the # that is being proposed, or we need to choose a different syntax.

@jordwalke
Copy link
Member

see class types as something different though and from my understanding it's not related.

You may wish to read up on the object system and class types. Polymoprhic variants and objects are actually very much related and it was a very enlightening learning experience to discover the connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants