Effect-TS is a TypeScript library for building type-safe, composable applications with built-in concurrency primitives. Its Fiber-based runtime enables structured concurrency, where parent Fibers manage child lifecycle, and operators like Effect.all provide fine-grained concurrency control.
0 / 5 completed
1 / 5
What is an Effect in the Effect-TS library, fundamentally?
In Effect-TS, an Effect<A, E, R> is a lazy, immutable description of a computation. It does nothing until run. A is the success type, E is the error type, and R is the required environment. This separates description from execution, enabling composition and testability.
2 / 5
A developer uses Effect.all([effectA, effectB, effectC]). How does Effect-TS execute these by default?
Effect.all() runs effects concurrently with no limit by default in Effect-TS. To control concurrency, pass { concurrency: 3 } as options. For sequential execution, use { concurrency: 1 } or Effect.forEach with sequential semantics.
3 / 5
What is a Fiber in Effect-TS concurrency model?
Fibers in Effect-TS are lightweight virtual threads managed by the Effect runtime, not OS threads. You can fork thousands of Fibers concurrently. Effect.fork() creates a Fiber that runs in the background, and you can join, interrupt, or await its result.
4 / 5
A developer wants to run an effect with a timeout. Which Effect-TS operator should they use?
Effect.timeout(duration) wraps an effect so that if it doesn't complete within the specified duration, it fails with a TimeoutException. Effect.race() races two effects and returns the first to complete. Effect.delay() adds a delay before an effect starts.
5 / 5
Which Effect-TS mechanism provides structured concurrency, ensuring that if a parent Fiber is interrupted, all child Fibers are also interrupted?
Effect.forkScoped() creates a Fiber whose lifecycle is tied to the parent Scope. When the scope closes (due to success, failure, or interruption), all scoped Fibers are automatically interrupted. forkDaemon() creates a Fiber that outlives its parent — use it only when that behavior is intentional.