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:
The documentation can be included in the export list directly, e.g.:
module Foo ( -- * A section heading -- | Some documentation not attached to a particular Haskell entity ... ) where
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
“-- $
”:
module Foo ( -- * A section heading -- $doc ... ) where -- $doc -- Here is a large chunk of documentation which may be referred to by -- the name $doc.
The documentation chunk is given a name, which is the
sequence of alphanumeric characters directly after the
“-- $
”, and it may be
referred to by the same name in the export list.