Skip to content

Instantly share code, notes, and snippets.

@j-maas
j-maas / README.md
Last active November 21, 2023 07:51
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