| name | fp-taskeither-ref |
| description | Quick reference for TaskEither. Use when user needs async error handling, API calls, or Promise-based operations that can fail. |
| type | skill |
| created | 2026-02-27T00:00:00.000Z |
| domain | communication-content |
| category | documentation |
| risk | unknown |
| source | community |
| tags | ["skill","communication-content","documentation","taskeither","ref"] |
TaskEither Quick Reference
TaskEither = async operation that can fail. Like Promise<Either<E, A>>.
When to Use
- You need a quick fp-ts reference for async operations that can fail.
- The task involves API calls, Promise wrapping, or composing asynchronous error-handling pipelines.
- You want a concise cheat sheet for
TaskEither operators and patterns.
Create
import * as TE from 'fp-ts/TaskEither'
TE.right(value)
TE.left(error)
TE.tryCatch(asyncFn, toError)
TE.fromEither(either)
Transform
TE.map(fn)
TE.mapLeft(fn)
TE.flatMap(fn)
TE.orElse(fn)
Execute
const result = await myTaskEither()
(
myTaskEither,
.(
.(err),
.(val)
)
)()