using-fpdart

Installation
SKILL.md

Functional Programming with fpdart

Goal

Implement robust, type-safe, and predictable business logic using functional programming principles. Replace side-effect-prone imperative code with pure functions and composable monads (Option, Either, Task), ensuring that error handling and null-safety are enforced at the type level rather than through runtime exceptions.

Process

Phase 1: Basic Data Containment

Use primitives to handle common edge cases without branching logic:

  • Option<T>: Replaces T?. Use Option.of(val) or Option.none(). Access via match or getOrElse.
  • Either<L, R>: Replaces try-catch. L (Left) is for errors, R (Right) is for success.
  • Unit: Replaces void to allow functional composition.

Phase 2: Execution & Async Flow

Manage side effects and asynchronous operations through wrappers that defer execution:

  • IO<T>: Synchronous wrapper for pure/safe side effects.
  • Task<T>: Asynchronous wrapper for Future that never fails.
  • TaskEither<L, R>: The standard for API requests. Composes Future and Either into a single monadic flow.
Installs
15
GitHub Stars
7
First Seen
May 18, 2026