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

Remove RecordPattern from the IR #109

Closed
AttilaMihaly opened this issue Aug 3, 2020 · 1 comment · Fixed by #114
Closed

Remove RecordPattern from the IR #109

AttilaMihaly opened this issue Aug 3, 2020 · 1 comment · Fixed by #114
Assignees
Labels
enhancement New feature or request

Comments

@AttilaMihaly
Copy link
Member

Record patterns provide very limited value since you cannot use them to branch out. You can only use them to make the syntax slightly more concise in certain cases. At the same time very few backends will support this and mapping it to existing features will add significant complexity.

If the lack of support ever becomes a limitation for modelers we can easily change the frontend to transparently rewrite usages to the dot notation.

@AttilaMihaly AttilaMihaly added the enhancement New feature or request label Aug 3, 2020
@AttilaMihaly AttilaMihaly self-assigned this Aug 3, 2020
@AttilaMihaly
Copy link
Member Author

For example this snippet:

distance { x, y } =
  sqrt (x^2 + y^2)

Can be rewritten to the following to remove the RecordPattern:

distance p =
  sqrt (p.x^2 + p.y^2)

AttilaMihaly added a commit to AttilaMihaly/morphir-elm that referenced this issue Aug 14, 2020
AttilaMihaly added a commit to AttilaMihaly/morphir-elm that referenced this issue Aug 14, 2020
AttilaMihaly added a commit to AttilaMihaly/morphir-elm that referenced this issue Aug 14, 2020
AttilaMihaly added a commit to AttilaMihaly/morphir-elm that referenced this issue Aug 14, 2020
AttilaMihaly added a commit to AttilaMihaly/morphir-elm that referenced this issue Aug 14, 2020
@AttilaMihaly AttilaMihaly linked a pull request Aug 18, 2020 that will close this issue
sfc-gh-lfallasavendano added a commit to Snowflake-Labs/morphir-elm that referenced this issue Dec 13, 2023
sfc-gh-lfallasavendano added a commit to Snowflake-Labs/morphir-elm that referenced this issue Dec 13, 2023
sfc-gh-lfallasavendano added a commit to Snowflake-Labs/morphir-elm that referenced this issue Jan 2, 2024
sfc-gh-lfallasavendano added a commit to Snowflake-Labs/morphir-elm that referenced this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant