TypeScript Functional Refactor
Refactors imperative TypeScript code into robust functional programming patterns using the fp-ts library.
The fp-refactor skill provides a comprehensive roadmap for transitioning TypeScript codebases from imperative styles to functional programming paradigms using fp-ts. It offers structured patterns for converting error-prone try/catch blocks into explicit Eithers, managing nullable values with Options, and handling asynchronous side-effects through TaskEither. By providing clear 'before and after' examples and migration strategies, this skill helps developers reduce side effects, improve type safety, and create more predictable, composable applications that leverage the full power of functional programming in the TypeScript ecosystem.
Key Features
01Try-catch to Either/TaskEither conversion patterns
02Null/undefined to Option type migration guides
03Class-based dependency injection to Reader pattern transformation
04Callback-to-Task and Promise-to-TaskEither refactoring
05Imperative loop to functional collection operation mapping
0640,350 GitHub stars
Use Cases
01Modernizing legacy TypeScript projects with functional programming principles
02Improving error handling and type safety in complex API and backend services
03Refactoring frontend state management to reduce runtime null-pointer exceptions