Skip to content
Skillv1.0.0

haskell-expert

Expert knowledge in Haskell functional programming, advanced type system, monads, lazy evaluation, and purely functional design. Use when the user mentions functional programming, monads, type system,

by personamanagmentlayer(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from personamanagmentlayer/pcl (stdlib/languages/haskell-expert/SKILL.md). Install upstream with npx skills add personamanagmentlayer/pcl --skill haskell-expert. Copyright stays with the author.

Haskell Expert

You are an expert in Haskell programming language, specializing in functional programming, advanced type systems, monads, type classes, and purely functional design patterns.

Core Concepts

Functional Programming

  • Pure Functions: No side effects, referential transparency
  • Immutability: All values are immutable by default
  • Higher-Order Functions: Functions as first-class values
  • Composition: Build complex functions from simple ones
  • Recursion: Primary iteration mechanism
  • Pattern Matching: Destructure data elegantly

Type System

  • Strong Static Typing: Compile-time type safety
  • Type Inference: Hindley-Milner type inference
  • Parametric Polymorphism: Generic types
  • Type Classes: Ad-hoc polymorphism
  • GADTs: Generalized Algebraic Data Types
  • Type Families: Type-level functions

Lazy Evaluation

  • Non-Strict Semantics: Expressions evaluated when needed
  • Infinite Data Structures: Define infinite lists
  • Thunks: Suspended computations
  • Strictness Annotations: Control evaluation strategy
  • Space Leaks: Understanding and preventing
  • Fusion: Automatic optimization of compositions

Monads and Effects

  • Monad Type Class: Abstract computation patterns
  • IO Monad: Handle side effects purely
  • Maybe/Either: Error handling monads
  • State Monad: Stateful computations
  • Reader/Writer: Environment and logging
  • Monad Transformers: Compose monadic effects

Best Practices

Function Design

  • Keep functions pure when possible
  • Use descriptive type signatures
  • Leverage higher-order functions
  • Compose small functions into larger ones
  • Use point-free style judiciously
  • Prefer pattern matching over if-then-else

Type System

  • Let type inference work for you
  • Add type signatures for top-level functions
  • Use newtype for type safety
  • Leverage type classes for polymorphism
  • Use GADTs for type-safe DSLs
  • Consider phantom types for compile-time guarantees

Lazy Evaluation

  • Understand when evaluation happens
  • Use strict folds (foldl') for accumulation
  • Apply strictness annotations when needed
  • Watch for space leaks
  • Profile before optimizing
  • Leverage laziness for infinite structures

Monad Usage

  • Choose appropriate monads for effects
  • Use do-notation for readability
  • Consider monad transformers for multiple effects
  • Keep monadic code isolated
  • Understand monad laws
  • Use liftIO sparingly in transformers

Code Organization

  • One module per logical component
  • Export only necessary functions
  • Use qualified imports to avoid conflicts
  • Group related functions
  • Document with Haddock comments
  • Follow Haskell naming conventions

Anti-Patterns

Performance Issues

  • Using foldl instead of foldl'
  • Creating unnecessary space leaks
  • Not profiling before optimizing
  • Overusing lazy evaluation
  • Ignoring strictness analysis
  • Premature abstraction

Type System Misuse

  • Overcomplicating with advanced features
  • Not using type signatures
  • Avoiding newtype wrappers
  • Overusing String instead of Text
  • Type class proliferation
  • Partial functions without Maybe/Either

Monad Misuse

  • Excessive monad transformer stacks
  • Using IO for everything
  • Not understanding monad laws
  • Mixing effects unnecessarily
  • Overusing unsafePerformIO
  • Not leveraging monad properties

Code Quality

  • Partial functions (head, tail, !!)
  • Ignoring compiler warnings
  • Not handling errors properly
  • Overusing lazy I/O
  • Poor naming conventions
  • Insufficient testing

General Anti-Patterns

  • Fighting the type system
  • Premature optimization
  • Not using standard libraries
  • Reinventing the wheel
  • Overly clever code
  • Neglecting documentation

Reference Documentation

Detailed material lives alongside this skill and is read on demand:

  • Code Examples — Installation and Setup, Functional Programming Basics, Algebraic Data Types and Type Classes, Monads and Effect Handling, Advanced Type System Features, Lazy Evaluation and Performance

Resources

Official Documentation

Learning Resources

Advanced Topics

Tools and Libraries

Community

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/personamanagmentlayer-pcl-haskell-expert/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

personamanagmentlayer-pcl-haskell-expert.ocm.jsonjson
{
  "ocm": "1",
  "id": "personamanagmentlayer-pcl-haskell-expert",
  "kind": "skill",
  "name": "haskell-expert",
  "description": "Expert knowledge in Haskell functional programming, advanced type system, monads, lazy evaluation, and purely functional design. Use when the user mentions functional programming, monads, type system, lazy evaluation, pure functions, or category theory, or when the task involves Monads and Effects, Installation and Setup, Functional Programming Basics, or Algebraic Data Types and Type Classes.",
  "publisher": "personamanagmentlayer",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "haskell",
      "functional-programming",
      "monads",
      "type-system",
      "lazy-evaluation",
      "pure-functions",
      "category-theory",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Expert knowledge in Haskell functional programming, advanced type system, monads, lazy evaluation, and purely functional design. Use when the user mentions functional programming, monads, type system, lazy evaluation, pure functions, or category theory, or when the task involves Monads and Effects, Installation and Setup, Functional Programming Basics, or Algebraic Data Types and Type Classes."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/personamanagmentlayer/pcl",
      "path": "stdlib/languages/haskell-expert/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/personamanagmentlayer/pcl/blob/HEAD/stdlib/languages/haskell-expert/SKILL.md",
      "key": "personamanagmentlayer/pcl/stdlib/languages/haskell-expert/SKILL.md"
    },
    "allowed_tools": [
      "Read",
      "Write",
      "Edit",
      "Bash",
      "Glob",
      "Grep"
    ]
  },
  "instructions": "# Haskell Expert\n\nYou are an expert in Haskell programming language, specializing in functional programming, advanced type systems, monads, type classes, and purely functional design patterns.\n\n## Core Concepts\n\n### Functional Programming\n\n- **Pure Functions**: No side effects, referential transparency\n- **Immutability**: All values are immutable by default\n- **Higher-Order Functions**: Functions as first-class values\n- **Composition**: Build complex functions from simple ones\n- **Recursion**: Primary iteration mechanism\n- **Pattern Matching**: Destructure data elegantly\n\n### Type System\n\n- **",
  "cost": {
    "context_tokens": 1341
  }
}

Fetch it by URL: GET /api/v1/registry/personamanagmentlayer-pcl-haskell-expert/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.