nw-fp-haskell
Haskell language-specific patterns, GADTs, type classes, and effect systems
Install / Use
npx skills add nWave-ai/nWave --skill nw-fp-haskellInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of nw-fp-haskell
nw-fp-haskell scores 87/100 on our quality scale, 2226th of 4,702 Development & Engineering skills we index (top 48%).
Its SKILL.md is 7.3 KB long, well organised into 25 sections with 14 code examples: a thorough specification that gives an agent plenty to work with.
It has 617 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so nw-fp-haskell is actively maintained.
- Our last check on 2026-10-11 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
ReviewOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands (1 minor note below). An AI review judged it risky: Line 22 instructs running `curl ... https://get-ghcup.haskell.org | sh` to install GHCup.
- noteInstalls by piping a downloaded script into a shellline 22
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
AI review: risky
- Line 22 instructs running `curl ... https://get-ghcup.haskell.org | sh` to install GHCup.
- As a SKILL.md file, this is a command the agent may execute for the user.
- Piping a remote installer directly into a shell bypasses review and is explicitly flagged as risky for skill/rules files, even though GHCup itself is a legitimate tool.
AI review by kimi-k2.7-code on 2026-10-08. Automated pattern scan on 2026-10-08. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
nw-fp-haskell compared with similar skills
All 4 of these similar skills score higher than nw-fp-haskell; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| nw-fp-haskell (this skill)by nWave-ai | 87 | 617 | 2mo ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 117.6k | 9d ago | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.3k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 47.4k | 3d ago | CLAUDE.md |
| lobehubby lobehub | 100 | 85.7k | today | MCP Server |
Frequently asked questions
- How do I install nw-fp-haskell?
- Run
npx skills add nWave-ai/nWave --skill nw-fp-haskell. The install tabs above show the steps for each supported agent. - Which AI agents does nw-fp-haskell work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is nw-fp-haskell safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands (1 minor note below). An AI review judged it risky: Line 22 instructs running
curl ... https://get-ghcup.haskell.org | shto install GHCup. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand. - Is nw-fp-haskell still maintained?
- The repository was last updated about 2 months ago, so nw-fp-haskell is actively maintained.
Skill content
View source on GitHubname: nw-fp-haskell agent: nw-functional-software-crafter description: Haskell language-specific patterns, GADTs, type classes, and effect systems user-invocable: false disable-model-invocation: true
FP in Haskell -- Functional Software Crafter Skill
Cross-references: fp-principles | fp-domain-modeling | property-based-testing
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
# 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)
data PaymentMethod
= CreditCard CardNumber ExpiryDate
| BankTransfer AccountNumber
| Cash
deriving (Eq, Show)
Record Types and Newtypes
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] Validated Construction (Smart Constructors)
module Domain.Email (EmailAddress, mkEmailAddress, emailToText) where
import Data.Text (Text)
import qualified Data.Text as T
newtype EmailAddress = EmailAddress Text deriving (Eq, Show)
mkEmailAddress :: Text -> Either ValidationError EmailAddress
mkEmailAddress raw
| "@" `T.isInfixOf` raw = Right (EmailAddress raw)
| otherwise = Left (InvalidEmail raw)
Export the type but not the constructor. Only mkEmailAddress can create values.
[INTERMEDIATE] Composition Style
Function Composition (Right-to-Left)
-- (.) composes right-to-left
processOrder :: RawOrder -> Either OrderError Confirmation
processOrder = confirmOrder . priceOrder . validateOrder
Monadic Chaining with do-notation
placeOrder :: RawOrder -> Either OrderError Confirmation
placeOrder raw = do
validated <- validateOrder raw
priced <- priceOrder validated
confirmOrder priced
Applicative for Independent Validation
mkCustomer :: Text -> Text -> Either ValidationError Customer
mkCustomer rawName rawEmail =
Customer
<$> mkCustomerId 0
<*> mkCustomerName rawName
<*> mkEmailAddress rawEmail
Error-Accumulating Validation
import Data.Validation (Validation, failure, success)
mkCustomerV :: Text -> Text -> Validation [ValidationError] Customer
mkCustomerV rawName rawEmail =
Customer
<$> validateName rawName -- Validation [ValidationError] CustomerName
<*> validateEmail rawEmail -- all errors collected, not short-circuited
Unlike Either which stops at first error, Validation accumulates all failures via its Applicative instance.
[INTERMEDIATE] Effect Management
Haskell enforces purity at the compiler level. IO in return type means side effects.
calculateTotal :: Order -> Money -- Pure: compiler guarantees no side effects
calculateTotal order = sumOf (orderLines order)
saveOrder :: Order -> IO () -- Impure: IO in the type
saveOrder order = writeToDatabase order
-- calculateTotal CANNOT call saveOrder -- compiler error
[ADVANCED] Three Layers Pattern (Hexagonal Architecture)
-- Layer 1: Pure domain (no IO, no effects)
module Domain.Order (calculateDiscount, validateOrder) where
calculateDiscount :: Order -> Discount
calculateDiscount order
| totalLines order > 10 = Discount 0.1
| otherwise = Discount 0.0
-- Layer 2: Effect interfaces (type classes as ports)
class Monad m => OrderRepo m where
findOrder :: OrderId -> m (Maybe Order)
saveOrder :: Order -> m ()
-- Layer 3: IO implementations (adapters)
instance OrderRepo IO where
findOrder orderId = queryDatabase orderId
saveOrder order = insertDatabase order
Effect libraries: Effectful (recommended starting point, best performance) | mtl (existing codebases) | Polysemy (algebraic effect semantics).
[INTERMEDIATE] Testing
Frameworks: QuickCheck (original PBT) | Hedgehog (integrated shrinking) | Hspec (BDD) | tasty (composable test tree). See property-based-testing for detailed PBT patterns.
Property Test Example
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = describe "validateOrder" $ do
it "round-trips through serialization" $
property $ \order ->
deserializeOrder (serializeOrder order) === Right order
it "validated orders always have positive totals" $
property $ \rawOrder ->
case validateOrder rawOrder of
Left _ -> discard
Right valid -> orderTotal valid > Money 0
Custom Generator
import Data.Text (pack)
import Test.QuickCheck
genValidEmail :: Gen EmailAddress
genValidEmail = do
user <- listOf1 (elements ['a'..'z'])
domain <- listOf1 (elements ['a'..'z'])
pure (EmailAddress (pack (user ++ "@" ++ domain ++ ".com")))
[ADVANCED] Idiomatic Patterns
GADTs for State Machines
{-# LANGUAGE GADTs, DataKinds #-}
data OrderState = Unvalidated | Validated | Priced
data Order (s :: OrderState) where
UnvalidatedOrder :: RawData -> Order 'Unvalidated
ValidatedOrder :: ValidData -> Order 'Validated
PricedOrder :: PricedData -> Order 'Priced
-- Type-safe transitions: only validated orders can be priced
priceOrder :: Order 'Validated -> Either PricingError (Order 'Priced)
priceOrder (ValidatedOrder d) = Right (PricedOrder (addPricing d))
Lazy Evaluation for Decoupled Pipelines
eligibleOrders :: [Order] -> [Order]
eligibleOrders = take 10 . filter isEligible . sortBy orderDate
Maturity and Adoption
- Steep learning curve: Monads, type classes, category-theory vocabulary create significant onboarding barrier. Budget extra ramp-up time.
- GHC extensions confusion: Over 100 language extensions; knowing which to enable requires experience. Start with
GHC2021defaults. - Space leaks from laziness: Default lazy evaluation causes subtle memory issues. Requires profiling discipline and strict annotations.
- Smaller talent pool: Hiring Haskell developers harder than mainstream languages. Consider team sustainability before committing.
Common Pitfalls
- Lazy space leaks: Use
foldl'(strict) instead offoldl. UseBangPatternsfor strict accumulators. - String vs Text: Never use
String([Char]) for real data. UseData.Text/Data.ByteString. - Orphan instances: Define instances in the module of the type or class. Use newtype wrappers otherwise.
- Over-abstracting with type-level programming: GADTs and type families increase compile times and error complexity. Use for genuine safety gains.
Related Skills
taste-skill
117.6kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
ai-job-search
72.3kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
47.4kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
lobehub
85.7k🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
