effect-data

Replace native JavaScript array, object, and string methods with Effect-TS functional equivalents.

68|13|Updated Aug 9, 2025
One-click install
npx skills add https://github.com/kriegcloud/beep-effect --skill effect-data
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-data
Source: https://github.com/kriegcloud/beep-effect/tree/main/.agents/skills/effect-data
Command: npx skills add https://github.com/kriegcloud/beep-effect --skill effect-data

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the common practice of using native JavaScript methods on collections and primitives, which can lead to null/undefined leaks and less composable code. It promotes a functional programming paradigm by replacing these with the Effect library's pipeable functions.

Core Features & Use Cases

  • Safer Data Transformations: Utilizes Effect's Array, Record, and String modules to perform operations like mapping, filtering, and grouping, returning Option types instead of potentially null/undefined values.
  • Enhanced Composability: Encourages the use of pipe and flow for building complex data processing pipelines in a declarative and readable manner.
  • Type Safety: Leverages Effect's predicate functions (P.isString, P.isNumber, etc.) for robust type guarding.
  • Use Case: Refactor existing JavaScript codebases to adopt Effect's functional approach for data manipulation, improving code quality and reducing runtime errors.

Quick Start

Use the effect-data skill to refactor the provided array filtering logic to use Effect's pipe and A.filter.

Frequently Asked Questions about effect-data

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

FAQPage Schema
How do I replace native JavaScript array methods with Effect-TS for safer data transformation?

To replace native JavaScript array methods with Effect-TS, use the Effect Array module's pipeable functions like `A.filter` within a `pipe` or `flow` composition. This returns Option types instead of null or undefined values, enforcing functional purity and type safety.

Why does using native JavaScript object methods lead to null leaks and how does Effect-TS prevent this?

Native JavaScript object methods often return undefined values that leak into runtime. Effect-TS prevents this by replacing native object manipulation with the Record module, returning Option types for safer data transformations and robust type guarding.

How do I refactor existing JavaScript code to use Effect pipe and flow for data processing?

Refactor existing JavaScript code to use Effect by replacing native Array, Object, and String methods with Effect's pipeable functions. Build declarative data processing pipelines using `pipe` and `flow` to enhance readability and composability.

Can I use Effect-TS predicate functions for type guarding in JavaScript data transformations?

Yes, you can use Effect-TS predicate functions like `P.isString` and `P.isNumber` for robust type guarding during data transformation. This ensures type safety when replacing native JavaScript collection operations with functional equivalents.

What is the best way to handle string processing in functional programming with Effect-TS?

The best way to handle string processing with Effect-TS is to replace native String methods with Effect's String module functions. This approach leverages pipeable functions and Option types to enforce functional purity and eliminate null leaks.

Does refactoring to Effect-TS functional equivalents eliminate null leaks in JavaScript data transformation?

Yes, refactoring to Effect-TS functional equivalents eliminates null leaks in JavaScript data transformation. By utilizing Effect's Option types and pipeable functions, operations like mapping and filtering return safe results instead of potentially null values.