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

Pattern matching on functions #6

Open
kyouko-taiga opened this issue Oct 23, 2018 · 0 comments
Open

Pattern matching on functions #6

kyouko-taiga opened this issue Oct 23, 2018 · 0 comments
Labels
discussion Further discussion is requested

Comments

@kyouko-taiga
Copy link
Owner

There's currently no way to match a function unless they are bound to a new variable, meaning they can't appear as the subject of a match value. Should we consider a sort of identity comparison for function values, in other words synthesizing = for functions?

This would allow us to write things like:

match (func () -> Int :: 1)
  with (func () -> Int :: 1) :: "the function matched!"
  //

If such synthesized equality operator was to be implemented, should function with the same signature be considered equal, or should equality also encompass function identifiers and/or body?

@kyouko-taiga kyouko-taiga added the discussion Further discussion is requested label Oct 23, 2018
@kyouko-taiga kyouko-taiga changed the title Pattern matching functions Pattern matching on functions Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Further discussion is requested
Projects
None yet
Development

No branches or pull requests

1 participant