Announcing Scrod, like Haddock but faster

by Taylor Fausak on

Homer: There’s three ways to do things: The right way, the wrong way, and the Max Power way.

Bart: Isn’t that the wrong way?

Homer: Yeah, but faster!

I’m happy to announce Scrod, a tool for quickly generating Haskell documentation. Unlike Haddock, Scrod only requires you to parse your module rather than fully compile it. This makes it much faster but somewhat less precise.

Scrod works in the browser via WASM. It also supports command line execution via WASI, along with traditional binaries for Linux, macOS, and Windows. And it is of course usable as a Haskell library.

It can produce either JSON or HTML output. The JSON output conforms to a published schema.

Scrod uses GHC (currently version 9.14.1) to parse modules, so it supports everything that GHC does. It also handles the C pre-processor (CPP), Literate Haskell (both Bird style and LaTeX style), and signatures (Backpack). Basically it (tries to) support anything you want to throw at it.

Scrod is also packaged as a Visual Studio Code extension, which lets you preview documentation locally, live in your editor.

Thanks for reading! Please check out Scrod at scrod.fyi and let me know what you think.