Remix.run Logo
aix1 a day ago

Could someone explain the appeal of flow typing?

I can see how it can be useful to start with a broad type, e.g. a union, and narrow it down in a block. However, I don't quite get the opposite direction shown in their example (first an int, then a string, then a union).

mrkeen a day ago | parent [-]

Same rationale as flow valuing. Some people like values being reassigned, and some people like types being reassigned.

You might be reading too much into the union example. The checker just doesn't know if the middle block ran, so maybe it remained an int, or maybe it became a string.