nw-fp-haskell

Solid

Haskell language-specific patterns, GADTs, type classes, and effect systems

AI & Automation 526 stars 55 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
91
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# FP in Haskell -- Functional Software Crafter Skill Cross-references: [fp-principles](../nw-fp-principles/SKILL.md) | [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md) | [pbt-haskell](../nw-pbt-haskell/SKILL.md) ## When to Choose Haskell - Best for: correctness-critical systems | compiler-enforced purity | maximum type safety | financial systems - Not ideal for: teams needing fast onboarding | rapid prototyping | .NET/JVM platform requirements ## [STARTER] Quick Setup ```bash # Install GHCup (manages GHC, cabal, stack, HLS) curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh # Create project mkdir order-service && cd order-service && cabal init --interactive # Or: stack new order-service simple && stack build && stack test ``` **Test runner**: `cabal test` or `stack test`. Add `hspec`, `QuickCheck`, `hedgehog` to `build-depends`. ## [STARTER] Type System for Domain Modeling ### Choice Types (Sum Types) ```haskell data PaymentMethod = CreditCard CardNumber ExpiryDate | BankTransfer AccountNumber | Cash deriving (Eq, Show) ``` ### Record Types and Newtypes ```haskell data Customer = Customer { customerId :: CustomerId , customerName :: CustomerName , customerEmail :: EmailAddress } deriving (Eq, Show) newtype OrderId = OrderId Int deriving (Eq, Ord, Show) newtype EmailAddress = EmailAddress Text deriving (Eq, Show) ``` `newtype` is erased at compile time -- zero runtime overhead, full type safety. ### [STARTER] Valid...

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