Claude-skill-registry functional-programming
Use when writing functional code - covers FP best practices (Lea differs from traditional FP languages)
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/functional-programming" ~/.claude/skills/majiayu000-claude-skill-registry-functional-programming && rm -rf "$T"
manifest:
skills/data/functional-programming/SKILL.mdsource content
Functional Programming Best Practices
Quick Start
-- Prefer pure functions and immutable data let double = (x) -> x * 2 [1, 2, 3] /> map(double) /> filter((x) -> x > 2)
Core Principles
- Immutability: Use
by default,let
only when mutation is necessarymaybe - Pure functions: No side effects, same input always produces same output
- Composition: Build complex behavior from simple, composable functions
- Higher-order functions: Pass functions as arguments, return functions
Lea-Specific Warnings
Lea differs from traditional FP languages:
- No currying - Use placeholders:
5 /> add(3, input) - Pipes prepend -
becomesx /> fn(a)fn(x, a) - Mutable bindings -
allows mutation; avoid unless necessarymaybe - No monads - Async uses
decorator instead#async - Opt-in types - Add
, use:: Type :> ReturnType
for enforcement#strict
Notes
- Prefer
overletmaybe - Use pipelines (
) for left-to-right data flow/> - Callbacks receive
(element, index)