It struck me today that when and if expressions seem like quite overlapping features. if/elses don't have an exhaustiveness check, but it seems like in most other cases, they aren't orthogonal features. They both are ways to diverge the execution of your program, however, they do seem a least a little different in practical use. Would it be at all advantageous to drop ifs and only use whens?
I vaguely remember this coming up in a previous discussion. I think the summary was that we wanted to keep if because its such a familiar tool for most programmers and the wierdness budget. I'll have a dig around and see if I can find it.
Ah found it
Anton said:
it was decided to stay with the current syntax :)
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/.E2.9C.94.201.20line.20pattern.20match.20.2B.20.60when.20is.60-like.20bool.20structure
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/single.20line.20pattern.20matching
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/kotlin-like.20decision.20structures
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/eliminate.20.60then.60.20keyword
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/harmonize.20decision.20structures
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/.E2.9C.94.20adjust.20meaning.20of.20else
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/Prevent.20.60else.20if.60
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/elif.20syntax
https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/cond-like.20if.20syntax
Thanks! I'll look at that. I had assumed I wasn't the first one to think of this, but I couldn't find this
We should maybe make an FAQ for this (or some other doc for less frequently asked but useful discussion based answers). Or at least aggregate links somewhere for future reference.
I feel like we have a few topics like this on Zulip that end up being a mix of links and discussion instead of a collected and referenceable thought.
I've thought before about an overview of pros and cons (sorted by importance) for a certain issue. We could include a very brief explanation with e.g.: "We felt con X carried a lot of weight..." or "Given this balance of pros and cons, we decided to go with...".
It would also be cool to be able to view discussion per pro/con. Grayed out pros/cons could be used for things that seem like a pro/con but are invalidated with additional context...
100%
Though we should be careful not to make the great the enemy of the good. As in, that would be great, but it will also be a solid amount of work and aggregating and such. Simple writing a super short summary and collecting links for later world be very good to have and is much easier to do.
We could create a separate zulip stream "decisions" with topics such as "keeping if", "effect interpreters",... and in each topic we only put a single message with the summary, further replies are prevented/deleted. If people have something to add to the summary they can open a new topic in the ideas stream and discussion there can result in changes to the summary.
Where are things like this normally saved? Is there an easier way than searching through zulip to find topics like this? I'm just getting started with roc, and the places I know to look to be able to answer my questions are:
Is there an easier way than searching through zulip to find topics like this?
No, I think the separate decisions stream with summaries would be a good improvement, anybody have a better idea?
I'm going to try setting up RocGPT today and give it access to examples, faq, tutorial, docs... that should be a good start to help people find answers to general Roc questions.
That'd be pretty neat!
RocGPT is up ![]()
Hallucinations are pretty common but it definitely can help you find answers to your questions :)
I could upload no more than 20 files so I'm going to look into merging some files later so I can add more knowledge.
Anton said:
RocGPT is up
I tried going to it, but it looks like I need ChatGPT Pro, which I'm on the fence about getting. You should let other people know!
Last updated: Jun 16 2026 at 16:19 UTC