Haskell
Execute these commands after EVERY implementation (see AGENT_AUTOMATION module for full workflow).
11 stars
byhivellm
Best use case
Haskell is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Execute these commands after EVERY implementation (see AGENT_AUTOMATION module for full workflow).
Teams using Haskell should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
$curl -o ~/.claude/skills/haskell/SKILL.md --create-dirs "https://raw.githubusercontent.com/hivellm/rulebook/main/templates/skills/languages/haskell/SKILL.md"
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/haskell/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Haskell Compares
| Feature / Agent | Haskell | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Execute these commands after EVERY implementation (see AGENT_AUTOMATION module for full workflow).
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.
SKILL.md Source
<!-- HASKELL:START -->
# Haskell Project Rules
## Agent Automation Commands
**CRITICAL**: Execute these commands after EVERY implementation (see AGENT_AUTOMATION module for full workflow).
```bash
# Complete quality check sequence (Stack):
stack build --fast --test --no-run-tests # Build check
hlint . # Linting
ormolu --mode check $(find . -name '*.hs') # Format check
stack test # All tests (100% pass)
stack test --coverage # Coverage
# Or with Cabal:
cabal build
cabal test
cabal haddock # Documentation check
```
## Haskell Configuration
**CRITICAL**: Use GHC 9.4+ with strict compiler flags and HLint.
- **Compiler**: GHC 9.4+
- **Build Tool**: Stack or Cabal
- **Linter**: HLint
- **Formatter**: Ormolu or Fourmolu
- **Testing**: Hspec, Tasty, or QuickCheck
### package.yaml (Stack) Requirements
```yaml
name: your-project
version: 0.1.0.0
github: "you/your-project"
license: MIT
author: "Your Name"
maintainer: "you@example.com"
extra-source-files:
- README.md
- CHANGELOG.md
dependencies:
- base >= 4.17 && < 5
- text >= 2.0
- bytestring >= 0.11
ghc-options:
- -Wall
- -Wcompat
- -Widentities
- -Wincomplete-record-updates
- -Wincomplete-uni-patterns
- -Wmissing-export-lists
- -Wmissing-home-modules
- -Wpartial-fields
- -Wredundant-constraints
- -Werror
library:
source-dirs: src
executables:
your-project:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- your-project
tests:
your-project-test:
main: Spec.hs
source-dirs: test
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- your-project
- hspec
- QuickCheck
```
## Code Quality Standards
### Mandatory Quality Checks
**CRITICAL**: After implementing ANY feature, you MUST run these commands in order.
**IMPORTANT**: These commands MUST match your GitHub Actions workflows to prevent CI/CD failures!
```bash
# Pre-Commit Checklist - Stack (MUST match .github/workflows/*.yml)
# 1. Format check (matches workflow)
fourmolu --mode check $(find src test -name '*.hs')
# 2. Lint (MUST pass with no suggestions - matches workflow)
hlint src test
# 3. Build (MUST pass with no warnings - matches workflow)
stack build --test --no-run-tests --pedantic
# 4. Run all tests (MUST pass 100% - matches workflow)
stack test
# 5. Run QuickCheck properties (matches workflow)
stack test --ta '--quickcheck-tests=1000'
# 6. Check coverage (matches workflow)
stack test --coverage
stack hpc report --all
# Pre-Commit Checklist - Cabal (MUST match .github/workflows/*.yml)
# 1. Format check
fourmolu --mode check $(find src test -name '*.hs')
# 2. Lint
hlint src test
# 3. Build
cabal build all --enable-tests --ghc-options="-Werror"
# 4. Test
cabal test all
# If ANY fails: ❌ DO NOT COMMIT - Fix first!
```
**Why This Matters:**
- Example: Using `fourmolu --mode inplace` locally but `fourmolu --mode check` in CI = failure
- Example: Missing `--pedantic` flag = warnings pass locally but fail in CI
### Example Code
```haskell
{-# LANGUAGE OverloadedStrings #-}
module Data.Processor
( DataProcessor(..)
, process
, validate
) where
import Data.Text (Text)
import qualified Data.Text as T
-- | A data processor with configurable threshold
data DataProcessor = DataProcessor
{ threshold :: Double
, verbose :: Bool
} deriving (Eq, Show)
-- | Process input data
--
-- >>> process (DataProcessor 0.5 False) [1,2,3]
-- [2,3]
process :: DataProcessor -> [Int] -> [Int]
process dp xs = filter (> floor (threshold dp)) xs
-- | Validate input
validate :: Text -> Either String ()
validate input
| T.null input = Left "Input cannot be empty"
| otherwise = Right ()
```
<!-- HASKELL:END -->Related Skills
We are still matching the closest adjacent skills for this page. In the meantime, continue through the full directory.