4 ms·
Coming from a ReasonML / OCaml codebase (frontend react), I'm seeing a lot to love with the pattern matching and sum types. Zod is already one of my favorites (
by rashkov 2y ago
Coming from a ReasonML / OCaml codebase (frontend react), I'm seeing a lot to love with the pattern matching and sum types. Zod is already one of my favorites (coming from https://github.com/glennsl/bs-json https://github.com/glennsl/bs-json).
Is 'retry / observability / error handling" something that comes from Effect?
- Stoids 2y agoThat's right, Effect lifts all types to a lazily-evaluated common type and provides combinators to work with that type, similar to RxJS with Observables and its operators. Retrying[0], observability[1], and error handling[2] are first-class concerns and have built-in combinators to make dealing with those problems quite ergonomic. Having these features is a non-starter for any serious application, but unfortunately, the story around them in the TypeScript ecosystem is not great—at least as far as coherence goes. You often end up creating abstractions on top of unrelated libraries and trying to smash them together. I'm a big fan of ReasonML / OCaml, and I think the future of TypeScript will involve imitating many of its code patterns. [0] https://effect.website/docs/guides/error-management/retrying https://effect.website/docs/guides/error-management/retrying [1] https://effect.website/docs/guides/observability/telemetry/tracing#creating-spans https://effect.website/docs/guides/observability/telemetry/t... [2] https://effect.website/docs/guides/error-management/expected-errors https://effect.website/docs/guides/error-management/expected...