[Feature Request] Operator <-
as Syntax Sugar for yield *
#1696
Labels
proposal
Proposal or discussion about a significant language feature
Hi Civet Team,
Thank you for your continuous work in enhancing Civet. I'd like to propose a new feature to add the operator
<-
as syntax sugar foryield *
. This feature aims to improve code readability by providing a more concise and expressive way to handle generator delegation, especially when using the Effect.ts library.Motivating Example
Effect.ts is a powerful library for managing side effects in TypeScript applications. It provides tools to handle asynchronous operations, error management, and resource management in a type-safe manner. Effect.ts heavily relies on generators to make effect composition more readable and maintainable.
Consider the following example from Effect.ts official doc:
The proposed syntax sugar
<-
simplifies the code and aligns with Civet's goal of making the language more concise. This change reduces verbosity and makes the intent of yielding effects more explicit.Effect.civet feels like a language with first-class effect management by introducing a special operator
<-
, while still backed by TypeScript's mature type system.Prior Successful Collaboration
Civet has previously collaborated with SolidJS, demonstrating the benefits of integrating with other modern frameworks and libraries. Supporting Effect.ts would be another excellent collaboration, enhancing Civet's utility and appeal to developers who value maximum type safety in their applications.
Alignment with Civet Design Philosophy
This feature aligns with Civet's design philosophy in several ways:
<-
operator reduces the verbosity ofyield *
, making the code more readable and concise.<-
provides clear and context-specific behavior for generator delegation, enhancing code clarity.Thank you for considering this feature request. I believe it will enhance Civet's expressiveness and make generator delegation more intuitive for developers.
The text was updated successfully, but these errors were encountered: