# sdiehl/write-you-a-haskell

Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)

Repository: https://github.com/sdiehl/write-you-a-haskell
Canonical: https://ross.abutalabs.com/products/write-you-a-haskell
Language: Haskell
License: MIT
License Family: permissive
Topics: haskel, compiler, book, evaluation, lambda-calculus, type, type-checking, type-system, pdf-book, functional-programming, functional-language, hindley-milner, type-inference, type-theory, intermediate-representation
Last push: 2021-01-11T13:56:03+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4258, "days_push": 2060, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3482, forks 257 (observed 2026-08-28T04:08:06.897765+00:00)

## What it is
A free online book by Stephen Diehl that teaches how to build a modern functional language compiler from first principles in Haskell. It covers parsing, lambda calculus, type systems, Hindley-Milner inference, and code generation to LLVM.

## Use cases
- learn how compilers work
- implement hindley-milner type inference
- build a functional programming language
- learn haskell through a compiler project
- understand type systems and type checking
- generate code with llvm from a custom language

## When to choose
- you want a deep, principled walkthrough of building a functional compiler
- you want to learn type inference and type theory with concrete Haskell code
- you prefer a free book with HTML and PDF versions

## When to avoid
- you need a production compiler or library
- you want a finished resource - the book is a work in progress with later chapters incomplete
- you are a Haskell beginner with no functional programming background

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: compiler, interpreter, parser, type-system, documentation
- domain: compilers, programming-languages, tutorials
- platform: cross-platform
- tags: book, hindley-milner, type-inference, lambda-calculus, functional-programming, pdf-book, llvm, type-theory, haskell

## Member repositories
- sdiehl/write-you-a-haskell (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:06.897765+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:36:26.746008+00:00, confidence not recorded.
  - readme: https://github.com/sdiehl/write-you-a-haskell (fetched 2026-08-28T04:08:06.897765+00:00, sha a21cfbce13ae)
- Data as of 2026-08-30T08:39:29.467469+00:00.
