Skip to content
Back to skills

Functional Programming

ASecurity

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

  • 755 stars
  • 0 votes
  • 1 copy
  • 17 views
  • Added February 8, 2026
development

Works with

  • claude code

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill functional-programming --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Functional Programming?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Functional Programming
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-functional-programming/badge)](https://www.skillsdirectory.com/skills/majiayu000-functional-programming)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
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)`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.