Effect.gen was introduced in Effect.gen ↗In plain TypeScript, choosing between two results is just an if. You check the value and return one label or the other. Hold on to this shape, because it is the one we want to keep.
pipe is a clean fit when each step just transforms the last, but branching is different. That if has to move inside a Effect.flatMap callback, where it even becomes a ternary because a statement will not fit. Two outcomes, and it already reads harder than the plain if did.
In gen the branch is that plain if again. You yield the value, then branch with ordinary control flow, exactly how you would write it without Effect. And because the compiler sees both literal returns, the type even sharpens to the two strings it can actually produce, nothing wider.