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 ...
Get Effective Haskell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.