Ticket #839 (closed merge: fixed)

Opened 7 years ago

Last modified 5 years ago

Generate documentation for built-in types and primitve operations

Reported by: simonpj Owned by: igloo
Priority: normal Milestone: 6.6.1
Component: Documentation Version: 6.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: N/A Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj) (diff)

GHC has a bunch of primitive types, which are not definable in Haskell, such as

They are defined in TysPrim but nowhere documented.

GHC also has a handful of built-in functions, that are

  • Not primops
  • Are not definable in Haskell
  • But are definable in Core
  • Are defined in the compiler itself, in basicTypes/MkId.lhs
  • Come from the pseudo-module GHC.Prim, like primops and primitive types.

The examples I can think of are

  • unsafeCoerce
  • inline
  • lazy

Currently they are documented in the (HEAD) user manual.

However, both the primitive types, and these built-in functions, are invisible to Haddock, and hence do not appear in the online Haddock documentation. This is bad.

You might think that the same would be true of the primitive operations (primops). However, the primops are described by a text file prelude/primops.txt.pp}}, and there's a preprocessor ({{{utils/genprimopcode) that generates the base-package pseudo-module GHC/Prim.hs from the text file. This pseudo-module is not compiled; but it is given to Haddock, and that's how the primops appear in the Haddock docs.

So the task is to add a bit of extra markup syntax to primops.txt.pp so that it can describe these special built-in types and functions, and inject their type signatures and documentation into GHC/Prim.hs, so that Haddock can see it. Not a huge task.

Thanks to Neil Mitchell for pointing out the difficulty.

Change History

Changed 7 years ago by simonpj

  • description modified (diff)
  • summary changed from Generate documentation for built-in functiuons to Generate documentation for built-in types and functions

Changed 7 years ago by igloo

  • testcase set to N/A
  • milestone set to 6.6.1

Changed 7 years ago by simonmar

  • priority changed from normal to low

Changed 7 years ago by simonpj

  • summary changed from Generate documentation for built-in types and functions to Generate documentation for built-in types and primitve operations

Changed 6 years ago by simonmar

  • owner set to igloo
  • priority changed from low to normal
  • component changed from Compiler to Documentation
  • type changed from task to merge

Fixed, thanks to Dinko Tenev for the patch. To merge:

Wed Feb 28 16:34:42 GMT 2007  Simon Marlow <simonmar@microsoft.com>
  * Fix #839 (Generate documentation for built-in types and primitve operations

Changed 6 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Merged.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.