haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
361 stars 241 forks source link

Show signatures in index page #1485

Open ffaf1 opened 2 years ago

ffaf1 commented 2 years ago

See as an example this index page on hackage. Having:

attrib :: LString -> (String, LString)

would be better than current layout (plain attrib, no sig, just module link).

see also: people disagreeing with me.

Kleidukos commented 2 years ago

@ffaf1 The package documentation you show as an example happens to be generated with an older version of the Haddock theme. Let's consider a more recently-updated package instead: https://hackage.haskell.org/package/servant-openapi3-2.0.1.5/docs/doc-index.html

Screenshot 2022-05-17 at 09-44-20 servant-openapi3-2 0 1 5 Generate a Swagger_OpenAPI_OAS 3 0 specification for your servant API  (Index)

In this example, we can see that the space if fairly constrained, so the type signatures cannot easily be displayed by default.

If we want to go through with this, we'd have to display the type signatures with a tooltip.