functional-programming
Use when writing functional code - covers FP best practices (Lea differs from traditional FP languages)
$ 安裝
git clone https://github.com/mcclowes/lea /tmp/lea && cp -r /tmp/lea/.claude/skills/functional-programming ~/.claude/skills/lea// tip: Run this command in your terminal to install the skill
SKILL.md
name: functional-programming
IMPORTANT: Keep description on ONE line for Claude Code compatibility
prettier-ignore
description: Use when writing functional code - covers FP best practices (Lea differs from traditional FP languages)
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
letby default,maybeonly when mutation is necessary - 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 -
x /> fn(a)becomesfn(x, a) - Mutable bindings -
maybeallows mutation; avoid unless necessary - No monads - Async uses
#asyncdecorator instead - Opt-in types - Add
:: Type :> ReturnType, use#strictfor enforcement
Notes
- Prefer
letovermaybe - Use pipelines (
/>) for left-to-right data flow - Callbacks receive
(element, index)
Repository

mcclowes
Author
mcclowes/lea/.claude/skills/functional-programming
3
Stars
0
Forks
Updated1w ago
Added1w ago