[haddock] #110: Allow grouping of functions with a corresponding data type

haddock haddock at projects.haskell.org
Sun Jun 21 17:47:56 EDT 2009

#110: Allow grouping of functions with a corresponding data type
Reporter:  duncan  |       Owner:     
    Type:  defect  |      Status:  new
Priority:  minor   |   Milestone:     
 Version:  2.4.2   |    Keywords:     
 Suppose you're refactoring to use smart constructors. So you switch from

 data WindowBits
  = WindowBits Int
  | DefaultWindowBits
 data WindowBits

 defaultWindowBits :: WindowBits

 windowBits :: Int -> WindowBits

 Currently the former is presented with a more logical grouping than the
 latter. In the constructor case we get the docs for the whole lot all in
 one block which clearly indicates that they are related. With the latter,
 each smart constructor is just an independent top level function and only
 the order makes them look in any way related (obviously the names and
 types make them look related, but the structure and presentation does

 So what I'd like is a way to group related top level exports, so that when
 there is a very strong relation, such as in the smart constructor case, I
 can indicate that in the markup and have it presented nicer.

 Currently there is a disincentive to switch from constructors to smart
 constructors because it makes the API look bigger and less organised. This
 is a bit of a shame.

 The obvious question is how should the grouping be indicated and how
 should it affect the default presentation.

Ticket URL: <http://trac.haskell.org/haddock/ticket/110>
haddock <http://www.haskell.org/haddock>
Haddock, The Haskell Documentation Tool

More information about the Haddock mailing list