Documenting Modules
Now that you’ve learned how to create modules that other developers can use, we should look at how to make modules that other developers want to use, by ensuring that our code is well documented. Haddock[8] is the most popular way to document Haskell programs. Haddock generates HTML-formatted documentation from your source code and specially formatted comments. All of the documentation on Hackage[9] is generated using Haddock. In this section, you’ll get a quick introduction to using Haddock to document your modules. We won’t cover all of the functionality of Haddock here, so be sure to read the official documentation to learn more about how you can document your code.
Let’s start by running cabal haddock, generating some ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access