Data Types

Explain Effect core data types for type-safe logic and error handling.

8|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/andrueandersoncs/claude-skill-effect-ts --skill data-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Data Types
Source: https://github.com/andrueandersoncs/claude-skill-effect-ts/tree/main/skills/data-types
Command: npx skills add https://github.com/andrueandersoncs/claude-skill-effect-ts --skill data-types

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often struggle to effectively leverage Effect's built-in data types across applications. This Skill consolidates essential data structures like Option, Either, Cause, Exit, Data, Chunk, Duration, and DateTime, framing them in practical, actionable guidance.

Core Features & Use Cases

  • Clear explanations of each core data type and their common patterns (Option/Some, Either/Left-Right, Cause details, Exit results, and Data equality concepts).
  • Real-world use cases showing how to compose data structures, handle errors, and model immutable state with Chunk and Hash-like collections.
  • Interoperability guidance with Schema and Effect APIs to build type-safe, maintainable code bases.

Quick Start

Run a quick example demonstrating Option.some(1) and Either.right("ok") usage inside an Effect.gen block.

Frequently Asked Questions about Data Types

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

FAQPage Schema
How do I use Effect Option and Either for type-safe error handling?

Effect Option represents optional values while Either models success or failure, composing safely inside Effect.gen blocks. Use Option.some and Either.right to wrap values, handling errors without exceptions across your application logic.

What is the best way to model immutable collections with Effect Chunk?

Effect Chunk provides an immutable collection for efficient data modeling and state management. Use Chunk operations to build type-safe, immutable sequences that interoperate seamlessly with other Effect APIs for robust collection handling.

When should I use Effect Cause and Exit in my workflows?

Use Effect Cause to capture detailed failure information and Exit to represent results that can succeed or fail. They model typed errors and results explicitly, enabling structured error handling across your application workflows.

How do I handle date-time and duration operations using Effect data types?

Effect DateTime and Duration provide type-safe primitives for temporal operations. Use them to model time spans, parse date-time values, and perform duration calculations that integrate cleanly with Effect workflows.

Can I use Effect Data types with Schema for data validation?

Effect Data provides value equality for immutable data structures, integrating with Schema for validation. Define data models using Data constructors, then validate and parse inputs through Schema to achieve type-safe application boundaries.

Does Effect Option work for both front-end and back-end code?

Effect Option, Either, and related data types are designed for universal use across front-end and back-end code. They provide consistent type-safe logic for error handling, optional values, and data modeling regardless of the platform target.