nw-fp-fsharp
SolidF# language-specific patterns, Railway-Oriented Programming, and Computation Expressions
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 F# -- Functional Software Crafter Skill
Cross-references: [fp-principles](../nw-fp-principles/SKILL.md) | [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md) | [pbt-dotnet](../nw-pbt-dotnet/SKILL.md)
## When to Choose F#
- Best for: domain modeling on .NET | DDD | railway-oriented programming | pipeline-first design | finance
- Not ideal for: teams needing higher-kinded types | non-.NET platforms | large existing C# codebases resistant to change
## [STARTER] Quick Setup
```bash
dotnet new console -lang F# -o OrderService && cd OrderService
dotnet new xunit -lang F# -o OrderService.Tests
dotnet add OrderService.Tests reference OrderService
dotnet add OrderService.Tests package FsCheck.Xunit
dotnet test
```
**File order matters**: F# compiles files top-to-bottom as listed in `.fsproj`. Types must be defined before use.
## [STARTER] Type System for Domain Modeling
### Choice Types (Discriminated Unions)
```fsharp
type PaymentMethod =
| CreditCard of cardNumber: string * expiryDate: string
| BankTransfer of accountNumber: string
| Cash
```
### Record Types and Domain Wrappers
```fsharp
type Customer = {
CustomerId: CustomerId
CustomerName: CustomerName
CustomerEmail: EmailAddress
}
type OrderId = OrderId of int
type EmailAddress = EmailAddress of string
```
Records have structural equality by default. Single-case DUs have small runtime cost (unlike Haskell's zero-cost newtype).
### [STARTER] Validated Construction (Smart Construct...
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-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-clojure
Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec
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