BlazeHtml is an open-source Haskell library that generates HTML markup through composable combinator functions, aiming to be the fastest way to produce HTML in Haskell.
What is BlazeHtml?
BlazeHtml is a Haskell combinator library for generating HTML, distributed on Hackage as the blaze-html package and maintained by jaspervdj on GitHub. It accepts Haskell expressions built from element and attribute combinators and outputs HTML markup, so developers write and type-check markup entirely inside Haskell code instead of concatenating strings. The project's stated goal is to be the fastest way to generate HTML in Haskell, and it ships a test suite and a benchmark suite to verify that claim. A companion tool, blaze-from-html, has moved to a separate repository.
Key Features
- Combinator-based API — HTML is constructed by composing Haskell functions, so markup is built and type-checked inside Haskell rather than as string templates.
- Performance focus — the project states its aim is the fastest HTML generation in Haskell, and it ships a benchmark suite to measure speed.
- Code generation — part of the combinator code is auto-generated; running
make combinatorsproduces these modules before building. - Hackage and Stackage distribution — the package is published on Hackage as blaze-html and tracked in Stackage LTS and Nightly snapshots.
- Test suite —
make testruns the project's tests to verify behavior. - Benchmark suite —
make benchmarkruns performance benchmarks to measure generation speed. - Companion tool — the blaze-from-html tool is maintained separately at github.com/jaspervdj/blaze-from-html.
Who is it for?
- Haskell web developers — generate server-rendered HTML directly from Haskell code without leaving the language or using external template files.
- Library authors — use blaze-html as the HTML-generation layer beneath higher-level web frameworks or templating libraries.
- Performance-conscious teams — use the included benchmark suite to compare HTML generation speed against other approaches.
What can you do with BlazeHtml?
- Server-rendered pages: build complete HTML pages as Haskell values composed from element and attribute combinators, then serialize them to markup.
- Reusable markup fragments: write Haskell functions that return HTML, so repeated page sections such as navbars, footers, and tables become callable functions.
- Typed attribute and tag construction: the combinator API builds element and attribute markup from Haskell expressions, so generated markup flows through the compiler rather than string interpolation.
How does BlazeHtml work?
The repository uses a Makefile for common tasks. Because part of the code is generated automatically, you first run make combinators to produce the derived modules, then build your project against them. Tests are run with make test and benchmarks with make benchmark.
FAQ
Is BlazeHtml open source?
Yes — BlazeHtml is an open-source Haskell library distributed through Hackage, with its source hosted on GitHub under the jaspervdj organization and monitored by a Haskell-CI workflow.
Does BlazeHtml have benchmarks?
Yes — the repository includes a benchmark suite that you can run with make benchmark. The project's stated goal of being the fastest way to generate HTML in Haskell is measured against this suite.
How do I run BlazeHtml's tests?
From the repository root, run make test to execute the test suite. Before building the project, run make combinators first, because part of the combinator code is generated automatically.
Where can I find blaze-from-html?
The blaze-from-html tool has moved to its own repository at github.com/jaspervdj/blaze-from-html, separate from the main blaze-html repository.
What does BlazeHtml generate?
BlazeHtml takes Haskell expressions composed from HTML combinators and produces HTML markup as its output, so you can build and serialize full pages without concatenating strings.








