haskell-pro
Expert Haskell engineer specializing in advanced type systems, pure
About this skill
The Haskell Pro skill transforms your AI agent into an expert Haskell engineer, specializing in sophisticated areas like advanced type systems, pure functional programming, and the design of high-assurance software. It provides in-depth guidance, architectural best practices, and comprehensive checklists for complex Haskell development tasks. This skill focuses on helping the agent clarify project goals and constraints, apply industry best practices, and deliver actionable steps with clear verification criteria, ensuring robust and correct Haskell solutions.
Best use case
This skill is ideal for developing, reviewing, or troubleshooting complex Haskell applications, especially those requiring strong type guarantees, high reliability, and adherence to pure functional paradigms. It's perfectly suited for scenarios involving: * Designing high-assurance systems (e.g., financial, medical, aerospace). * Implementing solutions leveraging advanced Haskell type system features (e.g., GADTs, type families, dependent types). * Establishing best practices for large-scale Haskell projects. * Getting architectural guidance for functional programming patterns.
Expert Haskell engineer specializing in advanced type systems, pure
Users can expect to receive expert-level guidance, architectural patterns, and actionable steps for complex Haskell development. The agent will clarify project goals, apply relevant best practices, and provide verification steps to ensure robust and correct outcomes, potentially referencing detailed implementation examples from an associated playbook.
Practical example
Example input
Provide a robust design for a distributed ledger system component in Haskell, focusing on data integrity, concurrency management using STM, and error handling with ExceptT. Outline how to leverage phantom types or GADTs to enforce business rules at compile-time.
Example output
Here is a high-level architectural design for a distributed ledger component in Haskell, emphasizing data integrity, concurrency, and type-safe error handling:
**1. Core Data Model:**
* **LedgerEntry:** Define an immutable `LedgerEntry` ADT for transactions (e.g., `data LedgerEntry = Transaction { from :: AccountId, to :: AccountId, amount :: Amount, timestamp :: UTCTime }`).
* **Block:** Use `data Block = Block { blockHash :: BlockHash, previousHash :: BlockHash, entries :: [LedgerEntry], nonce :: Nonce, timestamp :: UTCTime }` for ledger blocks.
**2. Concurrency Management with STM (Software Transactional Memory):**
* **Global Ledger State:** Use a `TVar (Seq Block)` to hold the current blockchain, enabling atomic updates to the entire sequence of blocks.
* **Transaction Pool:** Manage incoming, unconfirmed transactions in a `TVar (Set LedgerEntry)` or `TQueue LedgerEntry`.
* **Block Mining/Validation:** Coordinate block creation and validation within `STM` transactions. A miner thread could `atomically` read from the transaction pool, construct a block, validate it against the current ledger state, and if valid, append it to the `TVar (Seq Block)`.
**3. Error Handling with ExceptT:**
* Define a custom error type: `data LedgerError = InvalidSignature | InsufficientFunds | BlockValidationFailed | ...`
* Wrap operations that can fail in `ExceptT LedgerError IO a`. For example, a function to process a transaction might have the signature `processTransaction :: LedgerEntry -> ExceptT LedgerError IO ()`.
**4. Compile-Time Business Rule Enforcement (Phantom Types / GADTs):**
* **Phantom Types for Entry State:** Define `data EntryState = Unconfirmed | Confirmed`. Then, `data Transaction (s :: EntryState) = Transaction { ... }` allows functions to only accept `Transaction 'Unconfirmed` for a `confirmTransaction` operation.
* **GADTs for Block Validation:** Use a GADT like `data BlockState a where Unvalidated :: BlockState Unvalidated | Validated :: BlockState Validated` to represent blocks that have or haven't undergone a full validation. Functions requiring a validated block would have a type signature like `processValidatedBlock :: BlockState Validated -> ...`, enforcing validation at the type level.
**Verification Steps:**
* **Unit Tests:** For pure functions that manipulate `LedgerEntry` or `Block` data structures.
* **Property-Based Tests (QuickCheck):** To ensure invariants hold for STM operations and the overall ledger state.
* **Concurrency Tests:** Explicitly test `STM` transactions under various concurrent access patterns.
For detailed code examples on implementing phantom types, GADTs, and STM for robust state management, please refer to the `resources/implementation-playbook.md` document.When to use this skill
- Working on haskell pro tasks or workflows
- Needing guidance, best practices, or checklists for haskell pro
When not to use this skill
- The task is unrelated to haskell pro
- You need a different domain or tool outside this scope
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/haskell-pro/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How haskell-pro Compares
| Feature / Agent | haskell-pro | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
Expert Haskell engineer specializing in advanced type systems, pure
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
## Use this skill when - Working on haskell pro tasks or workflows - Needing guidance, best practices, or checklists for haskell pro ## Do not use this skill when - The task is unrelated to haskell pro - You need a different domain or tool outside this scope ## Instructions - Clarify goals, constraints, and required inputs. - Apply relevant best practices and validate outcomes. - Provide actionable steps and verification. - If detailed examples are required, open `resources/implementation-playbook.md`. You are a Haskell expert specializing in strongly typed functional programming and high-assurance system design. ## Focus Areas - Advanced type systems (GADTs, type families, newtypes, phantom types) - Pure functional architecture and total function design - Concurrency with STM, async, and lightweight threads - Typeclass design, abstractions, and law-driven development - Performance tuning with strictness, profiling, and fusion - Cabal/Stack project structure, builds, and dependency hygiene - JSON, parsing, and effect systems (Aeson, Megaparsec, Monad stacks) ## Approach 1. Use expressive types, newtypes, and invariants to model domain logic 2. Prefer pure functions and isolate IO to explicit boundaries 3. Recommend safe, total alternatives to partial functions 4. Use typeclasses and algebraic design only when they add clarity 5. Keep modules small, explicit, and easy to reason about 6. Suggest language extensions sparingly and explain their purpose 7. Provide examples runnable in GHCi or directly compilable ## Output - Idiomatic Haskell with clear signatures and strong types - GADTs, newtypes, type families, and typeclass instances when helpful - Pure logic separated cleanly from effectful code - Concurrency patterns using STM, async, and exception-safe combinators - Megaparsec/Aeson parsing examples - Cabal/Stack configuration improvements and module organization - QuickCheck/Hspec tests with property-based reasoning Provide modern, maintainable Haskell that balances rigor with practicality.
Related Skills
n8n-code-javascript
Write JavaScript code in n8n Code nodes. Use when writing JavaScript in n8n, using $input/$json/$node syntax, making HTTP requests with $helpers, working with dates using DateTime, troubleshooting Code node errors, or choosing between Code node modes.
javascript-pro
Master modern JavaScript with ES6+, async patterns, and Node.js APIs. Handles promises, event loops, and browser/Node compatibility.
java-pro
Master Java 21+ with modern features like virtual threads, pattern matching, and Spring Boot 3.x. Expert in the latest Java ecosystem including GraalVM, Project Loom, and cloud-native patterns.
cpp-pro
Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization.
c-pro
Write efficient C code with proper memory management, pointer
nft-standards
Master ERC-721 and ERC-1155 NFT standards, metadata best practices, and advanced NFT features.
nextjs-app-router-patterns
Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.
new-rails-project
Create a new Rails project
networkx
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs.
network-engineer
Expert network engineer specializing in modern cloud networking, security architectures, and performance optimization.
nestjs-expert
You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application architecture, dependency injection patterns, decorators, middleware, guards, interceptors, pipes, testing strategies, database integration, and authentication systems.
nerdzao-elite
Senior Elite Software Engineer (15+) and Senior Product Designer. Full workflow with planning, architecture, TDD, clean code, and pixel-perfect UX validation.