<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3.5. Named chunks of documentation</title><link rel="stylesheet" href="fptools.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="Haddock User Guide"><link rel="up" href="markup.html" title="Chapter 3. Documentation and Markup"><link rel="prev" href="ch03s04.html" title="3.4. Controlling the documentation structure"><link rel="next" href="hyperlinking.html" title="3.6. Hyperlinking and re-exported entities"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.5. Named chunks of documentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s04.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Documentation and Markup</th><td width="20%" align="right"> <a accesskey="n" href="hyperlinking.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2548037"></a>3.5. Named chunks of documentation</h2></div></div></div><p>Occasionally it is desirable to include a chunk of documentation which is not attached to any particular Haskell declaration. There are two ways to do this:</p><div class="itemizedlist"><ul type="disc"><li><p>The documentation can be included in the export list directly, e.g.:</p><pre class="programlisting"> module Foo ( -- * A section heading -- | Some documentation not attached to a particular Haskell entity ... ) where </pre></li><li><p>If the documentation is large and placing it inline in the export list might bloat the export list and obscure the structure, then it can be given a name and placed out of line in the body of the module. This is achieved with a special form of documentation annotation “<span class="quote"><code class="literal">-- $</code></span>”:</p><pre class="programlisting"> module Foo ( -- * A section heading -- $doc ... ) where -- $doc -- Here is a large chunk of documentation which may be referred to by -- the name $doc. </pre><p>The documentation chunk is given a name, which is the sequence of alphanumeric characters directly after the “<span class="quote"><code class="literal">-- $</code></span>”, and it may be referred to by the same name in the export list.</p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="markup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="hyperlinking.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.4. Controlling the documentation structure </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.6. Hyperlinking and re-exported entities</td></tr></table></div></body></html>