Back to skills
SkillHub ClubWrite Technical DocsFull StackTech Writer

functional-programming

Use when writing functional code - covers FP best practices (Lea differs from traditional FP languages)

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
3
Hot score
80
Updated
March 20, 2026
Overall rating
C1.6
Composite score
1.6
Best-practice grade
N/A

Install command

npx @skill-hub/cli install mcclowes-lea-functional-programming

Repository

mcclowes/lea

Skill path: .claude/skills/functional-programming

Use when writing functional code - covers FP best practices (Lea differs from traditional FP languages)

Open repository

Best for

Primary workflow: Write Technical Docs.

Technical facets: Full Stack, Tech Writer.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: mcclowes.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install functional-programming into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/mcclowes/lea before adding functional-programming to shared team environments
  • Use functional-programming for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw 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 `let` by default, `maybe` only 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)` becomes `fn(x, a)`
- **Mutable bindings** - `maybe` allows mutation; avoid unless necessary
- **No monads** - Async uses `#async` decorator instead
- **Opt-in types** - Add `:: Type :> ReturnType`, use `#strict` for enforcement

## Notes

- Prefer `let` over `maybe`
- Use pipelines (`/>`) for left-to-right data flow
- Callbacks receive `(element, index)`
functional-programming | SkillHub