nw-fp-clojure
SolidClojure language-specific patterns, data-first modeling, REPL-driven development, and spec
AI & Automation 526 stars
55 forks Updated 1 weeks ago MIT
Install
Quality Score: 95/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# FP in Clojure -- Functional Software Crafter Skill
Cross-references: [fp-principles](../nw-fp-principles/SKILL.md) | [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md)
## When to Choose Clojure
- Best for: data-centric domains | REPL-driven exploration | rapid prototyping | frequently evolving data shapes
- Not ideal for: teams wanting compile-time type safety | Android | teams unfamiliar with Lisp syntax
## [STARTER] Quick Setup
```bash
# Install Clojure CLI
brew install clojure/tools/clojure # macOS
# Create project
mkdir -p order-service/src/order_service order-service/test/order_service
# Run REPL: clj | Run tests: clj -X:test
```
**Namespace caveat**: Clojure namespaces use `-` but filenames use `_` (JVM requirement). `order-service.core` lives in `order_service/core.clj`.
## [STARTER] Domain Modeling with Spec
Clojure is dynamically typed. Domain modeling uses maps with qualified keywords, validated at runtime.
```clojure
(require '[clojure.spec.alpha :as s])
;; Domain wrappers as specs
(s/def ::order-id pos-int?)
(s/def ::email (s/and string? #(clojure.string/includes? % "@")))
(s/def ::customer-name (s/and string? #(> (count %) 0)))
;; Record types as spec'd maps
(s/def ::customer (s/keys :req [::customer-name ::email] :opt [::phone]))
;; Choice types as spec alternatives
(s/def ::payment-method
(s/or :credit-card (s/keys :req [::card-number ::expiry-date])
:bank-transfer (s/keys :req [::account-number])
:cash #{:cash}))
```
### ...
Details
- Author
- nWave-ai
- Repository
- nWave-ai/nWave
- Created
- 3 months ago
- Last Updated
- 1 weeks ago
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Solid
nw-fp-fsharp
F# language-specific patterns, Railway-Oriented Programming, and Computation Expressions
526 Updated 1 weeks ago
nWave-ai AI & Automation Solid
nw-fp-haskell
Haskell language-specific patterns, GADTs, type classes, and effect systems
526 Updated 1 weeks ago
nWave-ai AI & Automation Solid
nw-fp-scala
Scala 3 language-specific patterns with ZIO, Cats Effect, and opaque types
526 Updated 1 weeks ago
nWave-ai AI & Automation Solid
nw-fp-kotlin
Kotlin language-specific patterns with Arrow, Raise DSL, and coroutine-based effects
526 Updated 1 weeks ago
nWave-ai AI & Automation Solid
nw-fp-domain-modeling
Domain modeling with algebraic data types, smart constructors, and type-level error handling
526 Updated 1 weeks ago
nWave-ai