▸case-05 I want to build a reusable repository factory function in fp-ts that wraps Prisma delegate calls like findUnique, findMany, and create. For single-record lookups like findUnique, standard promise-based DB calls return null when a record is absent. How should the return type of findUnique be represented in the repository interface to strictly force callers to handle missing records? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-08 We are building an API server using the Hono framework with fp-ts. We want to inject AppDeps into the request context so that route handlers can extract dependencies and run ReaderTaskEither computations. What pattern should be used to register dependencies in Hono context and convert RTE results into JSON responses? | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-10 Our backend domain has several distinct failure modes: NotFoundError, ValidationError, ConflictError, and InfrastructureError. In standard REST APIs, developers often create custom Error subclass hierarchies like class NotFoundError extends Error. How should domain errors be typed in fp-ts, and how should they be translated to HTTP status codes? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-09 In a microservice built with fp-ts, every incoming request needs to track a requestId, optional authenticated userId, and startTime for performance logging across service layers. Developers often pass context down as optional parameters in every service method signature. How should request context be threaded through fp-ts backend operations? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-21 We are writing a pure mathematical utility function calculateCartDiscount(items: CartItem[], promoCode: Option<string>): Either<DiscountError, number> in fp-ts. There are no database calls, HTTP requests, or external service dependencies. Should this calculation function be wrapped in ReaderTaskEither? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-03 We are structuring application initialization in a TypeScript functional backend. We have config loading, database/redis connection setup, and higher-level domain service instantiation. A common approach is a mutable global service locator or singleton container. How should dependencies be built immutably in layers using fp-ts error-handling types, and how is the final application teardown handled? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-06 We are implementing a fund transfer between two bank accounts in an fp-ts backend. The transfer must execute inside a Prisma transaction ($transaction). Usually, people write a transaction callback using imperative await calls and standard JS exceptions. How can we wrap Prisma's $transaction so that an RTE pipeline executing on transactional dependencies automatically rolls back when a Left error is encountered? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-22 Our backend team is migrating our TypeScript codebase from fp-ts to Effect-TS (@effect/io / effect). How should environment dependencies and scoped resources like database connections be modeled using Effect's native primitives instead of ReaderTaskEither? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-07 I have an Express HTTP application and want to route incoming HTTP GET /users/:id requests to an fp-ts service function returning ReaderTaskEither<AppDeps, AppError, User>. Express route handlers expect (req, res, next) => void. What wrapper function pattern bridges the gap between RTE execution and Express response methods? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-02 In a Node.js backend using fp-ts, I need to compose an order creation operation that validates user existence, fetches a list of products concurrently, calculates a total price, and charges a payment provider. Developers usually write sequential async/await statements with intermediate variables. How should this multi-step pipeline be composed cleanly in fp-ts without losing type-safe dependency threading or explicit error propagation? | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-01 I'm building a TypeScript service method to fetch a user profile by ID. My team wants a functional approach where database connections and loggers are injected implicitly at runtime rather than passed as direct parameter arguments or managed via class constructors. What standard fp-ts type structure should represent this operation's return type, and how are dependencies, domain errors, and successful outputs typed within it? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-18 In a Node.js application entrypoint main.ts, we need to wire dependency construction, start the HTTP server, handle startup errors, and ensure resources like database pools are properly closed on process exit. How is this orchestrated using fp-ts? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-19 During user lookup in an fp-ts service, after successfully finding a user record in the database, we want to log an informational message without changing the wrapped User return value. How should non-mutating side-effects like logging be inserted into an RTE pipeline? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-04 When executing database queries with Prisma inside an fp-ts service layer, raw Prisma Client exceptions (like PrismaClientKnownRequestError) leak into the application logic. Developers usually catch these with broad try/catch blocks and rethrow Error instances. How should Prisma client exceptions be wrapped into typed domain errors (handling code P2002 for unique constraint violations and P2025 for missing records)? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-16 We want to test our email and password validation helper functions in fp-ts using property-based testing with fast-check. What property assertions should be made on validateEmail and validatePassword functions returning Either<ValidationError, string>? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-14 When validating a shopping cart order containing an array of item IDs, we need to fetch each product concurrently using ProductService.findById(id) which returns an RTE. Standard for...of loops execute sequentially. How should fp-ts array utilities execute this list of RTE lookups concurrently? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-15 To prevent cascading service failures, we want to wrap remote HTTP calls in a circuit breaker pattern in fp-ts. When the circuit state is 'open', calls should immediately return a CircuitOpen error without invoking the wrapped RTE. How should state checking and error tapping be structured in a functional circuit breaker wrapper? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-12 We want to cache the result of an RTE database lookup operation in Redis. If the underlying operation succeeds, update the cache; if the underlying operation fails, attempt to retrieve a stale value from the cache before returning an error. How should this be implemented as an RTE combinator? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-11 An external third-party API call wrapped in a ReaderTaskEither fails intermittently due to network glitches. Developers often put a while loop with try/catch and setTimeout inside the service body. How can we construct a reusable higher-order function decorator in fp-ts that retries an RTE operation with exponential backoff when a retryable error occurs? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-13 I am writing unit tests using Vitest for a UserService.create function that takes user input and returns RTE.ReaderTaskEither<UserDeps, UserError, User>. How should dependencies (db, hasher, mailer) be mocked and supplied to test the service in isolation without spinning up real databases or email servers? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-17 How should individual backend service files (such as src/services/user.service.ts) be structured in an fp-ts codebase? We want to avoid class-based services. How are dependency types, domain errors, and operations exported? | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
▸case-20 I am designing a React frontend component in TypeScript that formats a user's display name and avatar URL based on an Option<UserProfile> props state. Should I use ReaderTaskEither to handle missing avatar image fallbacks in the React render method? | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |