Effect-TS is a TypeScript framework for building type-safe, composable, and observable programs. Its Effect<A, E, R> type encodes success, typed errors, and dependencies, enabling powerful composition without untyped exceptions.
0 / 5 completed
1 / 5
What is the Effect type in Effect-TS?
Effect<A, E, R> is the core type: A is the success value type, E is the typed error (no untyped exceptions), and R is the required environment (dependencies). Effects are lazy — they describe what to do but do not run until explicitly executed with a runner like Effect.runPromise().
2 / 5
What does Effect.gen() enable in Effect-TS?
Effect.gen() lets you write Effects using JavaScript generators with yield* to 'unwrap' inner Effects, similar to async/await for Promises. This provides a readable sequential style while preserving full type inference for success values, typed errors, and dependency requirements.
3 / 5
What does Effect.catchAll() do?
Effect.catchAll(effect, handler) intercepts all errors in the typed error channel and runs the handler function with the error value to produce a recovery Effect. After catchAll, the resulting Effect's error type is the error type of the handler, allowing progressive narrowing of the error channel.
4 / 5
What is an Effect Schedule used for?
Schedule in Effect-TS is a composable data type that describes when and how to repeat or retry an Effect. For example, Schedule.exponential('100 millis').pipe(Schedule.jittered, Schedule.upTo('30 seconds')) creates an exponentially backing-off retry schedule with jitter and a maximum duration.
5 / 5
What does pipe do in Effect-TS?
pipe(value, f1, f2, f3) applies each function in sequence: f3(f2(f1(value))). In Effect-TS it is the primary composition tool — rather than method chaining (which would fix the API surface), pipe with module functions like Effect.map, Effect.flatMap, and Effect.catchAll keeps the library fully tree-shakeable.