Effect-TS / effect

An ecosystem of tools to build robust applications in TypeScript
https://effect.website
MIT License
7.71k stars 245 forks source link

From Discord: Question about using a refinement type with a split operator in Effect Typescript library #3863

Closed effect-bot closed 2 weeks ago

effect-bot commented 3 weeks ago

Summary

The conversation involves two users discussing a feature of the Effect TypeScript library related to streams. A user named @dan_connector has been exploring the library and is particularly interested in a solution for a debounced stream shared by @don_corleone076. They notice that before a stream is split, its type is A | symbol, but after the split, it becomes a type A stream. The issue is that the split operator currently only accepts a predicate, and they want to modify it to accept a refinement.

The suggested type changes:

@don_corleone076 responds, expressing willingness to review the suggestion but notes that they are not completely familiar with the specifics of Stream.aggregate and suggests there might be a better type-level fit.

Key Takeaways:

Discord thread

https://discord.com/channels/795981131316985866/1300889589023768599