categorical-property-testing

Validate functor, monad, and naturality laws with fp-ts and fast-check.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/HermeticOrmus/hermetic-claude --skill categorical-property-testing-hermeticormus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: categorical-property-testing
Source: https://github.com/HermeticOrmus/hermetic-claude/tree/main/claude/skills/categorical-property-testing
Command: npx skills add https://github.com/HermeticOrmus/hermetic-claude --skill categorical-property-testing-hermeticormus

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fp-ts, fast-check, vitest, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the rigorous validation of functional programming constructs like functors and monads, ensuring your code adheres to fundamental algebraic laws and preventing subtle bugs.

Core Features & Use Cases

  • Property-Based Testing: Leverages fast-check to generate diverse test cases for functional data types.
  • Law Verification: Implements tests for Functor, Monad, and Natural Transformation laws using fp-ts.
  • Use Case: When implementing a new Option or Either type in TypeScript, use this Skill to automatically verify that your implementation satisfies all standard Monad laws, guaranteeing its correctness and predictability.

Quick Start

Use the categorical-property-testing skill to verify the Monad laws for the Option type.

Frequently Asked Questions about categorical-property-testing

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

FAQPage Schema
How do I verify monad laws for a custom Option type in TypeScript?

Verify monad laws for custom TypeScript types using property-based testing with fast-check and fp-ts. This approach generates diverse test cases to ensure your Option implementation satisfies fundamental algebraic laws, preventing subtle functional programming bugs.

What is property-based testing for functional programming constructs in TypeScript?

Property-based testing for functional programming validates algebraic laws like functor and monad rules using generated test cases. It ensures TypeScript constructs adhere to categorical laws automatically, preventing subtle bugs without relying on manually specified example inputs.

Does fp-ts work with fast-check for validating functor laws?

Yes, fp-ts works with fast-check to validate functor laws. You can use fast-check to generate arbitrary inputs and fp-ts to apply the functional constructs, automatically verifying naturality conditions and other algebraic properties.

How do I test naturality conditions for functional data types in TypeScript?

Test naturality conditions by applying property-based testing to your functional data types. This method uses fast-check to generate diverse inputs, verifying that your TypeScript constructs maintain their structural properties under various transformations.

Can I use vitest to run property-based tests for fp-ts monads?

Yes, you can use vitest to run property-based tests for fp-ts monads. The testing framework integrates with fast-check to execute generated test cases that validate functor, monad, and natural transformation laws.

When do I need property-based testing for monad laws in TypeScript?

You need property-based testing for monad laws when implementing new functional types like Option or Either in TypeScript. It ensures your code rigorously adheres to fundamental algebraic properties, preventing subtle bugs that standard example-based tests might easily miss.