Skip to content

Instantly share code, notes, and snippets.

View ayazhafiz's full-sized avatar
💭
🫡

Ayaz ayazhafiz

💭
🫡
View GitHub Profile
@ayazhafiz
ayazhafiz / README.md
Last active April 4, 2022 17:03 — forked from j-maas/README.md
Roc: Open and closed tag unions

Roc: Open and closed tag unions

People's intuition

As evidenced in the discussions on Zulip (1, 2, 3) there are some cases where open and closed tags behave in a way that goes against people's intuition.

The main problem seems to be that people expect produced values to compose, but the "default" syntax (without *) prohibits this. People understand the openness to mean whether all possible values are listed, not whether more values can be added "later". For example: Roc infers myValue = if True then One else Two to be an open tag unio