language-service
language-service copied to clipboard
Suggest returning yield* with Effect.fail inside Effect.gen
What is the problem this feature would solve?
Would prevent things such as
const program = (key: string) =>
Effect.gen(function*() {
const remoteConfig = yield* Effect.tryPromise(() =>
);
if (isUndefined(defaultValue) || !hasProperty(defaultValue, "value")) {
yield* Effect.fail(
new RemoteConfigError({
cause: `Remote config key '${key}' not found`,
}),
);
}
return defaultValue.value;
});
What is the feature you are proposing to solve the problem?
Emit a warning diagnostic
What alternatives have you considered?
No response
BTW some Yieldable structures can be supported in advance - Option, Either etc
and Option.gen & Either.gen contexts