fp-taskeither-ref

Create, transform, and execute TaskEither values with typed errors in fp-ts workflows.

11|3|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/whatiskadudoing/fp-ts-skills --skill fp-taskeither-ref
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fp-taskeither-ref
Source: https://github.com/whatiskadudoing/fp-ts-skills/tree/main/skills/quick-ref/fp-taskeither-ref
Command: npx skills add https://github.com/whatiskadudoing/fp-ts-skills --skill fp-taskeither-ref

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TaskEither lets you model asynchronous operations that can fail with a typed error, and this quick reference provides clear guidance on creating, transforming, and executing TaskEither values in fp-ts.

Core Features & Use Cases

  • Create: TE.left, TE.right, TE.tryCatch, TE.fromEither
  • Transform: TE.map, TE.mapLeft, TE.flatMap
  • Execute: TE.match, running the task with () or by piping through TE.getOrElse
  • Use Case: wrapping API calls, coordinating parallel requests, and building error-aware async workflows in TypeScript apps

Quick Start

Install and import the TaskEither module, then start with TE.right(value) or TE.left(error) to represent outcomes, wrap asynchronous calls with TE.tryCatch for typed errors, and execute by invoking the resulting TaskEither and awaiting its result.

Frequently Asked Questions about fp-taskeither-ref

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is TaskEither in fp-ts used for?

TaskEither in fp-ts models asynchronous operations that can fail with a typed error, letting you represent outcomes like API calls or IO workflows as trackable values instead of untyped promises.

How do I handle async errors in TypeScript using fp-ts?

You handle async errors in fp-ts by wrapping operations with TE.tryCatch, transforming failures with TE.mapLeft, and executing the task to process the typed error or success value.

How do I create and run a TaskEither for an API call?

To create and run a TaskEither for an API call, wrap the promise with TE.tryCatch, transform the result using TE.map or TE.flatMap, and execute by invoking the task and awaiting its result.

Can I transform typed errors in TaskEither before execution?

Yes, you can transform typed errors in TaskEither before execution by applying TE.mapLeft to change the error shape, or TE.flatMap to chain subsequent async operations that might also fail.

Does this TaskEither reference require external dependencies?

No, this TaskEither reference is designed with minimal external dependencies, requiring only the fp-ts library installed in your TypeScript environment to implement the async error handling patterns.

What is the best way to execute TaskEither and extract the value?

The best way to execute TaskEither and extract the value is by piping it through TE.getOrElse for a fallback value, or using TE.match to handle both success and error branches explicitly.