Brendan Hansknecht said:
Bool:
- Should almost never be stored. Essentially always better to store a tag. Really just exist for use in if conditionals.
Side question, probably should be a different topic. Should we remove if (like gleam), to encourage to use tags more?
What do you do for if x > 3 then
2 messages were moved here from #contributing > Strengths of each primitive/builtin Roc type by Brendan Hansknecht.
Brendan Hansknecht said:
What do you do for
if x > 3 then
when x > 3 is
True -> ...
False -> ...
Or something else similar. Not campaigning for it. But it's a thing that could be done (and what I was doing in Chakra).
I like the feel of if then else and use it frequently.
I don't think this is worth it - it adds overhead to a familiar concept. It also doesn't work well with early returns, which Roc now has
@Ayaz Hafiz That's surprising that early returns don't work in when .. iswhen that is really just sugar over some complex and sometimes low-level if statements
Yeah, this sounds not at all worth it to me. If is useful. Bool.true already does enough to stop most people from wanting to use bool.
I don't want it either. Some people just seem to like it in gleam, so I thought I'd bring it up
this may be the first time we've had an #ideas topic where even OP doesn't want it :joy:
This question has come up before. It's tempting to make the language simpler, but I think it'd be a big hit to the weirdness budget. Beginners would all have to ask how to do an if, or just bounce off the language if they can't figure it out.
Sky Rose has marked this topic as resolved.
Last updated: Jun 16 2026 at 16:19 UTC