Stream: beginners

Topic: Bool as Tag Union?


view this post on Zulip Jared Cone (Oct 19 2024 at 16:24):

I thought I recall one of the talks I've seen on Roc mentioned that Bool was just a tag union of [True, False]. But it seems now it's a special type with values Bool.true and Bool.false. Am I misremembering, or did that change?

view this post on Zulip Anton (Oct 19 2024 at 16:27):

Yes, that changed, that was a couple of years ago I believe

view this post on Zulip Anton (Oct 19 2024 at 16:31):

It is still a tag union under the hood :)

view this post on Zulip Jared Cone (Oct 19 2024 at 17:16):

oh, why not have it be a tag union publicly?

view this post on Zulip Anton (Oct 19 2024 at 17:21):

Good question, I do not remember :sweat_smile: perhaps it was to discourage the use of bools and encourage tags with a nice name

view this post on Zulip Anton (Oct 19 2024 at 17:28):

found it: https://docs.google.com/document/d/1a51n7eIEbPjCWnGaL-pWbZBsRfi55GVQwIdPQTUu49Q/edit?tab=t.0#heading=h.kikaz4s9uvzo


Last updated: Jul 06 2025 at 12:14 UTC